Browse Source

capture: Set `org-capture-current-plist' before `org-capture-mode-hook'

* org-capture.el (org-capture-place-template): Allow
`org-capture-current-plist' access during `org-capture-mode-hook'

Ensure consistency between org-capture's hooks.

`org-capture-after-finalize-hook' is now the only hook that cannot
access `org-capture-current-plist' because the capture buffer is
killed when it is run.
Nicholas Vollmer 11 months ago
parent
commit
3ba4f056d7
2 changed files with 3 additions and 2 deletions
  1. 1 0
      etc/ORG-NEWS
  2. 2 2
      lisp/org-capture.el

+ 1 - 0
etc/ORG-NEWS

@@ -478,6 +478,7 @@ function, ~org-edit-latex-fragment~. This functions in a comparable
 manner to editing inline source blocks, bringing up a minibuffer set
 to LaTeX mode. The math-mode deliminators are read only.
 
+*** org-capture: ~org-capture-current-plist~ accessible during ~org-capture-mode-hook~
 * Version 9.3
 
 ** Incompatible changes

+ 2 - 2
lisp/org-capture.el

@@ -1128,8 +1128,8 @@ may have been stored before."
     (`plain (org-capture-place-plain-text))
     (`item (org-capture-place-item))
     (`checkitem (org-capture-place-item)))
-  (org-capture-mode 1)
-  (setq-local org-capture-current-plist org-capture-plist))
+  (setq-local org-capture-current-plist org-capture-plist)
+  (org-capture-mode 1))
 
 (defun org-capture-place-entry ()
   "Place the template as a new Org entry."