emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LOGBOOK drawer now being created with blank line afterwards


From: Kris Nelson
Subject: Re: LOGBOOK drawer now being created with blank line afterwards
Date: Sat, 18 May 2024 12:44:07 -0600

On 2024-05-17 05:22, Ihor Radchenko wrote:
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=288c7069c

Thanks Kris for reporting, and thanks Rens for hunting down the cause!
Thanks for the prompt fix, Ihor! I tested it out and confirmed I'm not seeing a blank space after the LOGBOOK anymore.

However, I did notice that it now errors out when creating the LOGBOOK on a heading which is at the end of the buffer. The error is:

Error in post-command-hook (org-add-log-note): (end-of-buffer)

I did some debugging and found that the error was coming from the (forward-char) call in the following line:

(if (eolp) (forward-char) (insert "\n"))

I've taken a crack at fixing this, which seems to work correctly from all my tests. See attached for the patch file.

The basic reasoning behind the included changes is:
- Keep point at the end of the LOGBOOK entry (right after :END:) instead of needing it to be on the line after. - Adjust the values for folding the drawer and moving the point after folding based on the logic above.

Attachment: 0001-org-log-beginning-Fix-error-creating-LOGBOOK-drawer-.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]