From aea7cab707412a002f7e228d56fbb05a9c429029 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 10 Jul 2021 21:43:44 +0800 Subject: [PATCH] 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 --- lisp/org.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 051987e0c..44c70e9fa 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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."