emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/org 0ebb36caea: lisp/org-capture.el: Restore org-store-


From: ELPA Syncer
Subject: [elpa] externals/org 0ebb36caea: lisp/org-capture.el: Restore org-store-link-plist
Date: Sat, 18 May 2024 06:58:38 -0400 (EDT)

branch: externals/org
commit 0ebb36caeafddb8245ac2ef261ab96a91281f8bd
Author: Anand Deopurkar <anandrdeopurkar@gmail.com>
Commit: Ihor Radchenko <yantar92@posteo.net>

    lisp/org-capture.el: Restore org-store-link-plist
    
    * org-capture.el (org-capture-fill-template): Restore original
    `org-store-link-plist' after calling `org-store-link'.
    
    To replace a %K escape (link to currently clocked task),
    `org-capture-fill-template' calls `org-store-link'.  This call has the
    side-effect of replacing the contents of `org-store-link-plist'.  As a
    result, expected template expansions using the original
    `org-store-link-plist' do not happen.
    
    For example, suppose `org-capture' is called from a message buffer with the
    template "%:subject %:from" while the clock is running.  Then
    %:subject and %:from are not substituted because of the behaviour
    above.  If the clock is not running, there is no problem.
    
    Current fix restores `org-store-link-plist' to its original value
    after `org-capture-fill-template' calls `org-store-link'.
    
    TINYCHANGE
---
 lisp/org-capture.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index da14f45c08..9d8f855ef7 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1675,9 +1675,12 @@ Expansion occurs in a temporary Org mode buffer."
                  (org-no-properties org-clock-heading)
                ""))
         (v-K (if (marker-buffer org-clock-marker)
-                  (org-with-point-at org-clock-marker
-                    (org-store-link nil nil))
-               ""))
+                  (let ((original-link-plist org-store-link-plist)
+                        (clocked-task-link (org-with-point-at org-clock-marker
+                                             (org-store-link nil nil))))
+                    (setq org-store-link-plist original-link-plist)
+                    clocked-task-link)
+               ""))
         (v-f (or (org-capture-get :original-file-nondirectory) ""))
         (v-F (or (org-capture-get :original-file) ""))
         (org-capture--clipboards



reply via email to

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