unpackaged.el
unpackaged.el copied to clipboard
improve unpackaged/org-forward-to-entry-content
Thanks, but this feels like a bogus fix. Narrowing to the subtree doesn't seem like it should be necessary. Are you sure you've followed the code and figured out what it's doing wrong, e.g. with Edebug?
I wouldn't be surprised if this is a bogus fix either as I am not very good at programming or elisp :)
The problem as I understand it is, when a node has a drawer but no content, goto the end of the drawer would reach the start of the next node.
I first tried just narrowing to subtree, but that caused the function to be stuck in infinite loop, since once it reaches the end of last drawer it'll process that drawer again and again((org-element-at-point)
keeps getting the same drawer). So then I added the condition (> (- pos (point)) 1)) since from what I understand, when narrowed, the maximum position is 1 less than the :end
of the last drawer, when the loop reaches there it should stop.