branch: externals/org
commit 0f534d5d63f54bc6998b9e7337b9002452ce24a1
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>
Clarify possible confusion about %(EXP) placeholder forms
* doc/org-manual.org (Template expansion):
* lisp/org-agenda.el (org-agenda-prefix-format):
* lisp/org-capture.el (org-capture-templates): Clarify what %(EXP)
stands for, add some examples.
Reported-by: arthur miller <[email protected]>
Link:
https://orgmode.org/list/du2pr02mb101097b5c68664adf39c3d13596...@du2pr02mb10109.eurprd02.prod.outlook.com
---
doc/org-manual.org | 11 ++++++-----
lisp/org-agenda.el | 9 +++++----
lisp/org-capture.el | 1 +
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/doc/org-manual.org b/doc/org-manual.org
index f57f08210c..b64e3ba38a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -8314,12 +8314,13 @@ given here:
- =%(EXP)= ::
- Evaluate Elisp expression {{{var(EXP)}}} and replace it with the
- result. The {{{var(EXP)}}} form must return a string. Only
- placeholders pre-existing within the template, or introduced with
- =%[file]=, are expanded this way. Since this happens after
- expanding non-interactive "%-escapes", those can be used to fill the
+ Evaluate Elisp expression ~(EXP)~ and replace it with the result.
+ The ~(EXP)~ form must return a string. Only placeholders
+ pre-existing within the template, or introduced with =%[file]=, are
+ expanded this way. Since this happens after expanding
+ non-interactive "%-escapes", those can be used to fill the
expression.
+ Examples: =%(org-id-new)=, =%(eval default-directory)=
- =%<FORMAT>= ::
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 7849637aa2..306d8cc077 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1760,11 +1760,12 @@ meaning:
%t the HH:MM time-of-day specification if one applies to the entry
%s Scheduling/Deadline information, a short string
%b show breadcrumbs, i.e., the names of the higher levels
- %(expression) Eval EXPRESSION and replace the control string
- by the result.
+ %(expression) Eval `(EXPRESSION)' and replace the control string by
+ the result.
+
-EXPRESSION is evaluated with point and buffer associated with agenda
-entry/line being rendered. For example, heading lines will be
+`(EXPRESSION)' is evaluated with point and buffer associated with
+agenda entry/line being rendered. For example, heading lines will be
evaluated with point in the Org buffer at that corresponding heading.
However, diary records will not be evaluated in an Org buffer, but
inside diary buffer. Auxiliary agenda lines like time grids will be
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 5d5b1ed70a..b88d9cb9c4 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -374,6 +374,7 @@ be replaced with content and expanded:
%-escapes, those can be used to fill the expression.
The evaluation happens with Org mode set as major mode
in a temporary buffer.
+ Examples: %(org-id-new), %(eval default-directory)
%<...> The result of `format-time-string' on the ... format
specification.
%t Time stamp, date only. The time stamp is the current