The values persisted here seem to be irrelevant across Emacs
installations, so there is no need to track those. It also does not
seem to officially customize the location that persist.el uses for
persisting variables: the variable that stores the directory path is
called `persist--directory-location`, indicating a private variable.
Pandoc supports grid tables, which are supported in Emacs via `table.el`.
By default, the alignment markers for those tables (:) are not
recognized in table.el, so let's add those. Furthermore, editing grid
tables in `markdown-mode` does not work, since `jit-lock-mode`
overwrites the `keymap` text property that `table.el` relies on to
enable table editing. Using `edit-indirect` to edit those tables in an
indirect buffer where everything works nicely. Indeed, editing
`table.el` tables in Org also uses an indirect buffer, for the exact
same reason.
This change is an experimental, as quite a bit of code had to be
touched. Further testing and bug hunting will be necessary.
Workload overview reports now only allow increments of one day
(`+1d`), since the current implementation cannot accomodate for arbitray
time ranges anymore (my fault, sorry). Also, the default start time for
workload overview reports has been changed to 23:59 on the previous
day (`"-1d 23:59"`) to include the current day in the report. The
rational behind this is that since the remaining work hours of today are
now included in the computation for the report, showing the entry for
today will show an accurate estimation of the remaining work time in
contrast to a constant value.
There are now additional parameters named `:work-hours` and
`:work-items-match` that specify how much work time is available on a
day and which Org items are considered work, respectively.
`:work-hours` can also take a function to compute for a given date how
much time can be spent on work. An example could be something like
this:
```emacs-lisp
(defun db/get-worktime-for-date (date)
"Return planned working time for DATE."
;; This is a simplification, as `date' might be the start of the day or the end.
(cond
((string-match-p "Sa" date) "6:00")
((string-match-p "So\\|Sun" date) "4:00")
((string-match-p "Wed\\|Mi" date) "3:00")
(t "2:00")))
```
An example report is then the following:
```
| End Time | Planned Work | Work Hours | Utilization |
| <r> | <r> | <r> | <r> |
|------------------------+--------------+------------+-------------|
| [2024-10-06 Sun 23:59] | 1:00 | 1:00 | *100.00%* |
| [2024-10-07 Mon 23:59] | 4:15 | 3:00 | *141.67%* |
| [2024-10-08 Tue 23:59] | 7:00 | 5:00 | *140.00%* |
| [2024-10-09 Wed 23:59] | 9:15 | 8:00 | *115.62%* |
| [2024-10-10 Thu 23:59] | 12:30 | 10:00 | *125.00%* |
| [2024-10-11 Fri 23:59] | 13:15 | 12:00 | *110.42%* |
| [2024-10-12 Sat 23:59] | 19:30 | 18:00 | *108.33%* |
| [2024-10-13 Sun 23:59] | 1d 1:30 | 22:00 | *115.91%* |
| [2024-10-14 Mon 23:59] | 1d 1:45 | 1d 0:00 | *107.29%* |
| [2024-10-15 Tue 23:59] | 1d 2:30 | 1d 2:00 | *101.92%* |
|------------------------+--------------+------------+-------------|
```
Whenever I try to check what I actually in the past couple of days, I
try to use a clocktable for this. However, those clocktables are
usually littered with small entries, i.e. entries where I only spent a
couple of minutes on (example: a quick chat with a colleague). Those
entries clutter the view for the relevant entries, making it hard to
make sense of past activities.
Restricting the clocktable to a certain depth somehow helps, but major
single tasks are hidden this way, and I usually want to see those.
The custom formatter added in this commit tries to alleviate this
situation by providing a mechanism to filter out those entries using a
minimum clocktime threshold. Let's see how this feature plays out.
Previously, links which end in a closing brackets got a non-breaking
space appended via a separate advice to `org-link-make-string`.
However, this did not work well with the other advice that removes
statistics cookies from links, mostly because I messed up the order in
which the advices were applied. To remedy this, the advice to remove
statistics cookies now also adds a non-breaking spaces as described
above.
When a headline ends on a closing bracket, Org adds an escape character
to the link text to distinguish the end of the link from the link
description. This escape character is a zero-width space, which is
counted for Org table alignment as one character, but the link itself is
displayed shorter, because the zero-width character is displayed as a
single pixel by emacs.
To work around this issue until the upstream fix is released, let's add
a final non-breaking space to those link descriptions to avoid the need
for the zero-width escape characters.
I found that opening this output on the right side to be annoying, so
let's switch try the bottom side window instead. This also works with
having an eshell buffer open at the same time, resulting in a nice reuse
of the right space of eshell windows that is usually empty.
This is especially useful when skipping weekends, but also allows for
future extensions where based on the date more complex skipping criteria
can be implemented, e.g. for holidays or vacations.
With vertico, using the default `yank-pop` is nice enough. Furthermore,
yanking with helm does not update the current candidate selection when
in a minibuffer prompt (like for `find-file` or `org-insert-link`),
sometimes leading to confusion.
The algorithm has been simplified and has been commented where
appropriate (from my point of view). An extensive docstring has been
added to describe the intention of the approch and its recursive nature.
With `common-lisp-indent-function`, the indentation of `while` was not
correct – oops.
This change will break some current indentations, though. Stay tuned.