unpackaged.el
unpackaged.el copied to clipboard
unpackaged/org-forward-to-entry-content goes to wrong heading in some cases
If unpackaged/org-forward-to-entry-content
is called on the first entry below, it'll skip over to the next heading and point
will end up at "hello world"
Because the :end
of the drawer is the same as the :begin
of the next heading.
* test
:LOGBOOK:
CLOCK: [2022-02-21 Mon 23:28]--[2022-02-21 Mon 23:28] => 0:00
:END:
* heading 2
hello world
Hi David,
Thanks for reporting this. I don't have much time to work on this at the moment, so patches welcome if I don't get to it first. :)
Hi David,
Thanks for reporting this. I don't have much time to work on this at the moment, so patches welcome if I don't get to it first. :)
Can you check if the change here will work: https://github.com/alphapapa/unpackaged.el/pull/23
Related discussion here: https://www.reddit.com/r/orgmode/comments/hrxc6a/move_to_first_line_after_drawers/?utm_source=share&utm_medium=web2x&context=3; not sure if the regex based solution there will work, but I've been using that function for a while.
Using a regexp search would probably not be as good as using org-element
, because regexps can become outdated when Org changes, and it's easy to forget to account for all possibilities. The latter problem afflicts both methods, of course, which is the problem here. Someone(TM) "just" needs to step through the existing code in a case which doesn't work correctly, identify the org-element
that needs to be handled in the code, and add such a case to it.