A periodic task is a task tagged with :PERIODIC:, and whose first child is an
item called "Template". Following the template are the instances of the
periodic tasks, which constitute the actual things to do and which can be
scheduled independently of each other. Whenever such an instance is due, the
template of the periodic task is supposed to be copied to the instance as a
first step. This copying can be done manually, but of course doing it
automatically is easier. The new function added in this commit represents a
first try to add such an automatism.
As described in [1], we are sometimes representing recurring tasks as lists of
single tasks plus a recurring task to create new instances once in a while. All
of this is grouped under a common headline, and those headlines should be marked
with PERIODIC to inhibit automatic clock-in.
[1]: https://karl-voit.at/2017/01/15/org-clone-subtree-with-time-shift/
This reenables automatic gap filling in case it has been configure with
`timeline-tools-filter-functions', but somehow breaks undo of killing in the
timeline buffer. The problem seems to be that undoing a kill only restores the
killed line, but not the original line entries of the lines right before and
after the lined that had been killed. In this way, the timeline of the buffer
has overlapping entries, resulting in odd behavior.
The problem is not quite understood yet, but it seems to be that undo does not
notice the changes to the surrounding lines (maybe because they have not been
done by text editing functions).
This does not play nicely with undo, because undo won't track changes to local
variables. Thus, if we every want to have a working undo in timeline buffers,
the timeline needs to be saved as something textual. Luckily, we already store
each entry of the timeline as a text property in the timeline table, and from
now on we will extract the timeline from there whenever we need it.
Undo is still not working fully yet, there are some oddities that need to be
addressed first.
RFC documents do not change over time. The custom org mode link handler
`db/org-rfc-open' now makes use of this by downloading RFC documents to
`db/rfc-cache-path' (if defined) and opening the files locally. If
`db/rfc-cache-path' is not defined, the RFC is opened in an external browser as
before.
This allows to keep a selection of used RFC documents locally on the filesystem
for future reference, without the need to retrieve them again from the IETF.
Since this is all org mode related, the handler now also resides in `db-org'
instead of `db-utils'.
This test could not have been added before, because conversion was not
guaranteed to work for dates before the unix epoch. It now is, and we finally
can check the start of the NTP epoch! :)
The previous implementation made use of `encode-time', which is not
guaranteed to work with times before the unix epoch. Indeed, on at least one
Windows machine, the corresponding function `db/ntp-to-time' could not handle
such dates. However, Calc can handle those independently of `encode-time',
and `db/ntp-to-time' has now been reimplemented in terms of the corresponding
Calc functions.
All (both) tests still pass.
It's only necessary when editing the buffer, not when only traversing it. Moved
it to the only function where this is actually done, and added a comment to the
docstring of `timeline-tools-map-clocklines' to remind everyone that editing the
buffer through this function may yield funny surprises :)
The setter will now complain if the file to be added to `org-agenda-files' does
not exist and is not readable. It also now uses the proper functions from `org'
to update `org-agenda-files'.
This makes ‘db-helm’ obsolete again (already after one commit!). The function
to extract all files from ‘db/important-path’ has also been dropped in favor of
the standard ‘directory-files-recursively’. It’s not clear yet whether this
will also work on Windows, though.
Instead of giving a list, we now create the sources directly. This gives us the
possibility to configure certain aspects of the sources like matching behavior
and highlighting. Now we are much closer to the standard behavior of helm than
before.
Actually, we add the text properties ‘marker’ and ‘entry’ to the whole line, but
the alinging of the table somehow removes the text properties between two
columns. It is kept in the fields, though, and that is enough.
This is the main entry point to play automatically generated playlists (“auto
playlists”). It is using the value of ‘db/auto-playlist-file-function’ to
generate a list of files to play. This list if currently played using EMMS, via
‘db/-emms-playlist-from-files’.
Sometimes the string "Output of ‘…’" seems to be interpreted as directory name,
and then dired complains about it not being existent. It is not completely
understood yet when this will happen, and an easy workaround seems to be to
stick to a fixed string that works. This is what’s used now.
All music related functions that do not directly depend on EMMS will now go into
‘db/music’, with the intention that if we in the future replace EMMS with
something else, the API provided by ‘db/music’ will still be valid. This does
not mean, however, that functions in ‘db/music’ may not use functions from EMMS.
For this a new function ‘timeline-tools-clockline-no-org-agenda-conflicts’ as
been added that reads in a clock line (start and end times), updates all org
agenda files to fix conflicting clock lines, and returns the string of the new
clock line. This works for all complete clock lines (i.e., those with end
times), but not for open clock lines (i.e., those missing an end timestamp).
I do not know whether this is really necessary, but since ‘let’ should bind
variables like ‘smtpmail-smtp-server’ and the like dynamically, it feels better
to have them loaded before binding them.
Up to now, ‘org-agenda-files’ only consisted of the four variables customizable
in init.el, namly ‘db/org-default-work-file’, ‘db/org-default-home-file’,
‘db/org-default-notes-file’, and ‘db/org-default-refile-file’. However, this
meant that no *additional* agenda files were possible, like including multiple
files for notes. This should not be the case any longer.
This variable is called ‘db/other-gnus-accounts’ and can be set with the
customize interface. This change also obsolete ‘db/personal-gnus-filter-rules’,
is it’s definition can now be inlined directly into the one of
‘db/other-gnus-accounts’.
Undoing changes in the timeline buffer may make the display inconsistent with
the values of the internal variables (in particular when lines got killed and
the like).
Moved actual configuration back from db-emms.el to init.el.
May very well be that the configuration is now broken again, let’s see how it’s
working out.