[Top][All Lists]

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

[PATCH] Re: Bug: Duplicate logbook entry for repeated tasks [9.4.6 (9.4.

From: Ihor Radchenko
Subject: [PATCH] Re: Bug: Duplicate logbook entry for repeated tasks [9.4.6 (9.4.6-gab9f2a @ /home/gustavo/.emacs.d/elpa/org-9.4.6/)]
Date: Sat, 10 Jul 2021 21:48:08 +0800

Bhavin Gandhi <bhavin7392@gmail.com> writes:

> I was able to reproduce this, and here are my findings as well as a
> reproducible configuration with only a few settings.

The breakage was introduced in commit c67037:

[c670379adfbdc4883d3cfa230289fd2829993265] Fix `org-agenda-todo' undo behavior 
when logging (not adding note)

The fix is attached.


>From ff3c0f6524d4165518ec0c53b49a58162ff7b2a9 Mon Sep 17 00:00:00 2001
From: Ihor Radchenko <yantar92@gmail.com>
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].

 lisp/org.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ffcc5945d..3d15771a2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10939,9 +10939,7 @@ (defun org-add-log-setup (&optional purpose state 
prev-state how extra)
        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."

reply via email to

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