branch: externals/org
commit 75adbec2bfe971f68601264fcaa7a25f645fb833
Author: Bibek Panthi <bpanthi...@gmail.com>
Commit: Ihor Radchenko <yanta...@posteo.net>

    lisp/org-capture.el: Cancel new clock when capture is killed
    
    * org-capture.el (org-capture-finalize): Don't keep newly started
    clock when capture is aborted.
    
    When a clock is started due to :clock-in t, it is saved when
    :clock-keep is t.  But this should only be done when capture is
    finalized and not when killed/aborted.  This change adds a check to
    ensure that the clock is not kept when the capture was aborted.
    
    TINYCHANGE
---
 lisp/org-capture.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 2d9ce0ba42..cc940e501d 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -824,7 +824,7 @@ captured item after finalizing."
   (when (and org-capture-clock-was-started
             (equal org-clock-marker org-capture-clock-was-started))
     ;; Looks like the clock we started is still running.
-    (if org-capture-clock-keep
+    (if (and org-capture-clock-keep (not org-note-abort))
        ;; User may have completed clocked heading from the template.
        ;; Refresh clock mode line.
        (org-clock-update-mode-line t)

Reply via email to