unpackaged.el icon indicating copy to clipboard operation
unpackaged.el copied to clipboard

unpackaged/org-forward-to-entry-content goes to wrong heading in some cases

Open whudwl opened this issue 3 years ago • 4 comments

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 

whudwl avatar Feb 21 '22 12:02 whudwl

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. :)

alphapapa avatar Mar 01 '22 10:03 alphapapa

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

whudwl avatar Apr 21 '22 03:04 whudwl

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.

apc avatar Sep 27 '22 20:09 apc

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.

alphapapa avatar Sep 28 '22 12:09 alphapapa