[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 0e7033e0ca 6/7: org-capture: Expand sexps in templa
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 0e7033e0ca 6/7: org-capture: Expand sexps in template with Org mode being active |
Date: |
Thu, 9 Jun 2022 04:58:10 -0400 (EDT) |
branch: externals/org
commit 0e7033e0ca14a5c4717d4d04b3c2d2b8d5d93fea
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org-capture: Expand sexps in template with Org mode being active
* lisp/org-capture.el (org-capture-fill-template): Enable `org-mode'
in the temporary template expansion buffer. Update docstring
accordingly.
(org-capture-templates): Clarify that %(sexp) expansion happens in a
temporary Org mode buffer.
Fixes
https://orgmode.org/list/CABUh-776V-_+_JAZwcKQm9ATcs0WUV9SmGwjooGFbt=CtwQj8g@mail.gmail.com
---
lisp/org-capture.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 5ca4e1f2fd..773234967a 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -309,6 +309,8 @@ be replaced with content and expanded:
introduced with %[pathname] are expanded this way.
Since this happens after expanding non-interactive
%-escapes, those can be used to fill the expression.
+ The evaluation happens with Org mode set as major mode
+ in a temporary buffer.
%<...> The result of `format-time-string' on the ... format
specification.
%t Time stamp, date only. The time stamp is the current
@@ -1572,7 +1574,9 @@ Lisp programs can force the template by setting KEYS to a
string."
"Fill a TEMPLATE and return the filled template as a string.
The template may still contain \"%?\" for cursor positioning.
INITIAL content and/or ANNOTATION may be specified, but will be overridden
-by their respective `org-store-link-plist' properties if present."
+by their respective `org-store-link-plist' properties if present.
+
+Expansion occurs in a temporary Org mode buffer."
(let* ((template (or template (org-capture-get :template)))
(buffer (org-capture-get :buffer))
(file (buffer-file-name (or (buffer-base-buffer buffer) buffer)))
@@ -1645,6 +1649,7 @@ by their respective `org-store-link-plist' properties if
present."
(setq buffer-file-name nil)
(setq mark-active nil)
(insert template)
+ (org-mode)
(goto-char (point-min))
;; %[] insert contents of a file.
(save-excursion
- [elpa] externals/org updated (c02c0d660d -> d9963c58dc), ELPA Syncer, 2022/06/09
- [elpa] externals/org 819409baab 4/7: org-get-buffer-tags: Improve performance, ELPA Syncer, 2022/06/09
- [elpa] externals/org 0e7033e0ca 6/7: org-capture: Expand sexps in template with Org mode being active,
ELPA Syncer <=
- [elpa] externals/org d9963c58dc 7/7: lisp/ol.el: Fix shadowed radio targets, ELPA Syncer, 2022/06/09
- [elpa] externals/org 96746438c0 1/7: org-element--cache-find: Do not hash section/org-data/table elements, ELPA Syncer, 2022/06/09
- [elpa] externals/org 46df681336 2/7: org.el: Improve performance of deletion commands, ELPA Syncer, 2022/06/09
- [elpa] externals/org 4487acc630 5/7: org-element-cache: Do not compare buffer positions with cache keys, ELPA Syncer, 2022/06/09
- [elpa] externals/org 93821b431c 3/7: org-element--cache-for-removal: Improve performance, ELPA Syncer, 2022/06/09