Fix duplicate logbook entry for repeated tasks

* lisp/org.el (org-add-log-setup): Always run `org-add-log-note' via
`post-command-hook'.  Otherwise, there is no way to know if a note was
requested for `this-command'.  Running `org-add-log-note' directly
would, for example, break `org-auto-repeat-maybe' as reported in [1].

[1] https://orgmode.org/list/CAOn=hbcaW1R6vtun-E2r4LS=j3dp=VjqmjGtzy8UC1SyPArKbA@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2021-07-10 21:43:44 +08:00 committed by Bastien
parent e23815ba61
commit aea7cab707
1 changed files with 1 additions and 3 deletions

View File

@ -10863,9 +10863,7 @@ EXTRA is additional text that will be inserted into the notes buffer."
org-log-note-extra extra
org-log-note-effective-time (org-current-effective-time)
org-log-setup t)
(if (eq how 'note)
(add-hook 'post-command-hook 'org-add-log-note 'append)
(org-add-log-note purpose)))
(add-hook 'post-command-hook 'org-add-log-note 'append))
(defun org-skip-over-state-notes ()
"Skip past the list of State notes in an entry."