Commit Graph

648 Commits

Author SHA1 Message Date
Daniel - b670ee57f6
Only search Org buffers when querying for backlinks
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.
2022-04-16 10:08:11 +02:00
Daniel - 1d5f318b5b
Add function to return list of Org items linking to item at point
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.
2022-04-16 09:58:46 +02:00
Daniel - fdc32eaa6d
Clear refile cache when updating the headline of an org mode item 2022-04-02 08:56:18 +02:00
Daniel - 367c8969fc
Make going back and forth in timeline buffers more robust
Do not treat the headline as a valid line.
2022-03-31 14:22:52 +02:00
Daniel - 3c7ea1b987
Simplify extraction of timeline entries from timeline buffer 2022-03-31 13:35:12 +02:00
Daniel - e5818fdb8c
Remove 'marker text property in timelines
The marker is contained in the entry anyway, so let's use that.
2022-03-31 13:07:21 +02:00
Daniel - b80f05d49f
Add first version to move around rows in timelines 2022-03-31 13:05:09 +02:00
Daniel - 9f0a890b1c
Perform code cosmetics in timeline tools 2022-03-31 13:04:55 +02:00
Daniel - 8068107326
Stop before headline when going to previous timeline line 2022-03-31 12:41:39 +02:00
Daniel - 4428db4f82
Apply minor cosmetics 2022-03-30 08:44:15 +02:00
Daniel - cfc11ec807
Keep Org links after insertion by default
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.
2022-03-30 08:42:06 +02:00
Daniel - 0db003d442
Try fixing adding note in headline update function
Let's not try to use the Org mode functions to add notes, but instead do it
directly manually.  I hope this works better now …
2022-03-24 20:16:50 +01:00
Daniel - 9d7e88df0e
Ensure functioning of Org Clock hydra even if no task is clocked
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.
2022-02-26 10:16:13 +01:00
Daniel - 83421c072a
Remove trailing whitespace after HTML rendering a file
Those whitespaces are neither necessary nor helpful.
2022-02-06 20:57:36 +01:00
Daniel - efb7500202
Add original value as default when changing Org item headlines
This allows to make simple changes to the original headline of an item.
2022-01-08 15:42:40 +01:00
Daniel - d23a8dc817
Fix adding notes when updating headlines
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 :)
2022-01-08 09:11:02 +01:00
Daniel - 407f5d70f2
Add newlines when inserting templates
I find myself inserting these newlines whenever I insert a template, so let's
let them insert them automatically.
2022-01-02 09:31:29 +01:00
Daniel - 5bc7c70882
Add function to copy template of Org Mode item to location at point
This is a convenience function and has been bound to a shortcut for easier
usage.  This function is supposed to be the standard way to copy templates.
2021-12-15 09:43:50 +01:00
Daniel - 80eeca1e44
Add simple function to find template via special property
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.
2021-12-13 21:32:05 +01:00
Daniel - eafebe1cb9
Add simple function to directly render html from a file
This is simpler than opening the file in a buffer and calling shr-render-buffer,
with some buffer maneuvring afterwards.
2021-12-13 21:17:45 +01:00
Daniel - cedaae00e8
Make template copy function more robust
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.
2021-12-13 21:17:18 +01:00
Daniel - 159c8c0eb6
First check for major mode when update Org item headline 2021-11-29 17:39:33 +01:00
Daniel - 5c36dba12c
Make function to update Org item headlines also work in agenda 2021-11-29 17:39:27 +01:00
Daniel - 25a7051c12
Add function to update headline of Org mode item and log note
This allows changing the headline of an item if it's scope changes and record
this change in a note.
2021-11-29 17:16:25 +01:00
Daniel - 6064f0e4b3
Add more test cases for base45 decoder 2021-11-07 10:04:16 +01:00
Daniel - b072e32988
Add more test cases for base45 decoder function 2021-11-07 09:10:09 +01:00
Daniel - 24bb768e3d
Simplify character conversion in base45-decode-string
This actually renders the separate translation function obsolete, it has been
inlined now.
2021-11-07 08:56:06 +01:00
Daniel - f1c3af9ea7
Add some regression tests for base45 decoder 2021-11-07 08:41:00 +01:00
Daniel - f52f48273a
Allow input of base45 decoder to also contain lower-case letters 2021-11-07 08:40:30 +01:00
Daniel - e15be73bc1
Fix insertion of text from hex numbers
Using `insert` directly makes use of character conversion and may scramble the
byte when inserting into the buffer (indeed, `insert` does not seem to insert
the byte, but the characters whose code-points is given in the string; same for
`insert-char`).
2021-11-06 17:49:49 +01:00
Daniel - a8cfeaf69f
Add simple function for base45 decoding
For playing around with EU Covid Certificates.
2021-11-06 17:49:46 +01:00
Daniel - ef2932fed7
Always print two bytes when converting text to hex 2021-11-06 15:35:29 +01:00
Daniel - 0d1fe48e6f
Allow to copy template from outside of current file
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.
2021-10-29 14:35:35 +02:00
Daniel - 747e505fda
Revert "Exclude NOTEs as refile targets"
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.
2021-10-24 12:56:29 +02:00
Daniel - 6b5d40b09b
Update local copy of plantuml-mode 2021-10-16 18:45:41 +02:00
Daniel - 5b10f83303
Fix typo 2021-10-16 12:27:56 +02:00
Daniel - c17bc4c1ab
Explicitly set frame title when current Org task changes
This should enable new frames to show the correct title, and not just the
default "emacs" string.
2021-10-16 12:21:02 +02:00
Daniel - 90b6e91051
Exclude NOTEs as refile targets
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.
2021-10-16 10:12:51 +02:00
Daniel - b952504c81
Fix org mode category refresh when redisplaying timelines
Iterating over the current set of file names may not work when no files are
given (in which case all agenda files should be visisted).  However, instead of
fixing the set of files, it should be more robust to find all referenced buffers
by iterating over the markers of the entries.  In that case, even if a file is
visited by multiple buffers, we can be sure that the right buffers are referesh
before the timeline is redrawn.
2021-09-30 15:35:18 +02:00
Daniel - 785db3ded8
Fix typo in linking hydra 2021-09-04 16:17:35 +02:00
Daniel - a1f0acfd87
Add custom function to list git-annex files via dired
This can already be done by using `db/dired-from-shell-command`, but it's more
convenient to have a specific command for this.
2021-08-24 10:18:36 +02:00
Daniel - e14a7248b0
Directly complain when not file are available in custom dired view
Otherwise, a rather confusing error message is displayed about not being able to
find a file called "Command output" in the current directory.
2021-08-22 09:32:05 +02:00
Daniel - 106f286285
Include symlinks in custom file listings, even if they are dangling
When listing files, it's not relevant whether the file is readable or whether
a symbolic link points to a non-existing file.  What matters is that the file
itself exists, either as a file or as a symbolic link.

This is relevant when using `git annex find` to list files matching some search
criteria.
2021-08-21 09:51:54 +02:00
Daniel - 158601f012
Make custom function to query for locations in Org mode files public
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.
2021-08-08 13:51:52 +02:00
Daniel - ca679b2274
Refactory template copy function into function to copy item bodies
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.
2021-08-08 13:49:07 +02:00
Daniel - b4621122cc
Update local copy of plantuml-mode
This is now at e7c08c588b/plantuml-mode.el.
2021-08-07 17:31:27 +02:00
Daniel - b0703bee01
Update local copy of plantuml-mode
This contains an experimental implementation for file exporting.
2021-08-03 20:40:09 +02:00
Daniel - 54263ab599
Add local copy of plantuml-mode
This contains my changes, it will be removed as soon as upstream catches up.
2021-08-03 17:38:21 +02:00
Daniel - 76990dcdf2
Allow fast link creation to items recentely associated with clocking
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`.
2021-07-17 08:47:37 +02:00
Daniel - b85246ae7c
Add shortcut to timeline for deleting other windows 2021-07-03 17:54:15 +02:00