This special kind of dynamic block inserts all planned tasks between two dates
and sums up it's efforts. This could help in deciding what additional tasks to
accept or what dates to promise for completion of new tasks.
This partially reverts cff8720a44, but keeps the
doc-string.
Rationale: TOPICs may contain notes which should be reviewd regularly. Those
TOPICs should also be tagged with NOTE but could (and should) in addition
contain sub-items about concrete tasks. In this case refiling to a NOTE should
be allowed.
Maybe limiting refiling to NOTE:TOPIC combinations would be more strict here,
but I think this complexity is not (yet) worth it.
Sometimes only the backlinks to the items itself might be interesting, or
backlinks to the current item and its direct parent. To allow for easy
insertion of dynamic backlink blocks in those cases as well, include a
:parent-depth parameter. The default value of nil means no limit is imposed, as
has been the case until now.
The idea is that those entries represent project notes which should not get
tasks refiled as sub-items (sub-headings to structure these notes are fine,
though, and must be added directly). To connect tasks with project notes, use
links and backlinks instead.
This helps to prevent accidental refiling of tasks under notes and loosing them
there. A drawback is that `C-u org-refile` won't list notes as visiting targets
anymore; for this, use imenu instead.
Mostly making use of pcase-*, but I am not quite sure whether the `(,foo . ,bar)
syntax really helps …
Also adjusted some comments and some formatting.
We are interested in the backlinks so we now put them first. The backlink
targets (i.e., current item or any of its parents) are now grouped after the
priority of the item containing the backlink.
This dynamic block will list all items (including their priority) that link to
the item at point or to any of its parent items. The use case for this is to
have a series of periodic appointments where certain topics should be
discussed (“jour fixe”), and where those topics can be referenced in those
appointments via backlinks. However, simple backlinks to an item on a fixed
date is not sufficient here, as there might not be enough time on that day to
discuss all items. To avoid having to manipulate all backlinks that could not
be discussed, one could simply add a reference to the parent item of all
appointments of the jour fixe series. Using the new dynamic block introduced
here, this item will be on the list of open topics until it's closed.
It does not make sense to look in non-Org buffers for backlinks of items, but
this was indeed what happend until now: the function `db/org-get-location` only
checked whether the current buffer is associated with a file, and if so uses it
for querying the user for an item to select. This does not make sense, as
`db/org-get-location` is supposed to return a mark to an Org item.
This is now fixed by `db/org-get-location` to also check whether the current
buffer is also an Org buffer. It's as simple as that.
This function is not meant for interactive use, but instead should be used in
source blocks such as
```
(db/org-backlinks-to-item-at-point)
```
This will add a table of all items linking to the current item at point, and cut
be used in item templates, for example.
Background: I tried to achive this functionality with `org-ql` directly, but
somehow failed. This function simply encapsulates the corresponding call to
`org-ql-query`, adding the ID property of item at point automatically.
When inserting links multiple times, it's annoying to have to go back to the
original place the link points to and reinsert it into the stored link list.
Using a universal argument to toggle `org-link-keep-stored-after-insertion` is
also not an option, as I keep forgetting to use it.
Instead, by default keep all links after insertion. To be able to handle the
growing list of links, we now provide a function `db/org-clear-stored-links` to
set the list of stored links to the empty list.
It happens sometimes that the clock is not active, in which case hydra tried to
replace strings in `org-clock-current-task`, then a nil value. Fixed this.
I think I just did it wrong, so let's try adding a note by calling
`org-add-note` directly. So far it's working better, but I am not quite sure
whether I really did it right this time. In any way, `org-add-note` keeps track
of all the bookkeeping for taking notes, so my code is simpler now :)
This allows both a more fine-grained and more flexible control over where
templates can be located and which templates are suppoed to be used for the item
at point. This function could also be bound to a custom key binding to make it
easier to invoke.
Instead of going upward from the end, we now just start from the beginning and
skip all drawers we may encounter. This should also allow to copy subtrees in
templates, although adjustments to the headline indentations might be necessary
if the template and point are on different levels.
My checklist template are usually located in a separate file, and sometimes even
in more than one. Being able to copy those template to point is thus crucial.
Excluding NOTEs as refile targets also excludes them as jump targets for C-u C-c
C-w, which is bad. Better move all NOTEs out of the main task list into a
separate notes.org or something.
This reverts commit 90b6e91051.
NOTEs are meant to hold information for the project at hand, and not to collect
tasks, because NOTEs are meant to live longer than those tasks. Use dedicated
subprojects to group tasks. Task may (and probably should) refer to NOTEs for
keeping long lasting information, though.
This function is referenced in some doc string already, and could as well be
public, so let's make it so. This amounts to removing a dash from it's function
name.
This allows the same copy behavior as before (apart from newly introduced bugs,
that is), but in addition gives the possibility to copy bodies of arbitraty
items that can be choosen interactively. This might come in handy when copying
general checklists from anywhere in the main Org mode file to the current task.
This allows to insert links to items that were recently clocked into. The
selection to those items is done via `org-clock-select-task`, which itself will
display items from `org-clock-history`.
So far, we only considered one link in a headline and replaced it with its
description when linking to it. When there are multiple links, this will fail.
This commit changes this by iterating over all links in the headline, not only
the first one.
So far, when a link is discovered in a headline, we only keep the description of
that link. This will throw away the context of that link, which is
undesirable. So let's keep it.