GNU bug report logs -
#80062
31.0.50; Feature request: Allow full Lisp in capture-templates expansions (unobtrusive opt-in)
Previous Next
To reply to this bug, email your comments to 80062 AT debbugs.gnu.org.
There is no need to reopen the bug first.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80062; Package
emacs.
(Tue, 23 Dec 2025 09:17:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
arthur miller <arthur.miller <at> live.com>:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org.
(Tue, 23 Dec 2025 09:17:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Currently, it is not possible to use variables directly in embedded lisp
templates in org-capture templates. For example this is not possible to
type:
%(default-directory)
since current embedded lisp evaluator can only evaluate functions.
The proposed patch suggests unintrosive, per-template opt-in that allows
for %() expansions with full lisp evaluation.
It adds a new keyword to the template keywords,
:allow-full-lisp as a selector for the new evaluator. The default is the
old one of course, so all old templates would run untouched. Newly
written templates have to explicitly opt-in with the new keyword. It also
adds a new optional argument to org-capture-fill-template, so it is
possible to select new evaluatore even if org-capture-fill-template is
called outside of org-capture itself.
New expander have also relaxed requirement for the return value of the
evaluation. Instead of asking the user to ensure that evaluation returns
a string, we are using printing representation of returned value. That
is slightly more convenient then calling (prin1 myvar) possibly in many
places in a template. With this patch we could type:
%(default-directory) => "~/..."
%(most-positive-fixnum) => 230...
%((buffer-name)) => "Capture..."
Motivation for this is a wish to use org-capture-templates as a more
general template expansion tool. Attached is an example of a template to
generate a README file in org format. As seen from the example, a
variable may be repeated many times. In this case there is only one,
'project-name' but there could be of course more. Having to basically
repeat prin1 many times, something like this: '(prin1 project-name)',
feels elaborate and unnecessary.
There are other template engines available, I am using Skeleton myself
in several places, but I find org-capture templates with
palceholders more convenient to work with. The only nuissance is we
can't use variables directly, but that is not hard to add in. The
proposed patch is a relatively short function, and is completely
unintrusive to all existing users of org-capture templates.
This is just a preliminary test of idea, if that would be acceptable in this
form I can rework other details, docs etc. I hope this one is more
acceptable than the previous suggestion.
[Message part 2 (text/html, inline)]
[README.org (application/vnd.lotus-organizer, attachment)]
[0001-New-evaluator-for-in-capture-templates.patch (application/octet-stream, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80062; Package
emacs.
(Tue, 23 Dec 2025 13:37:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 80062 <at> debbugs.gnu.org (full text, mbox):
> From: arthur miller <arthur.miller <at> live.com>
> Date: Tue, 23 Dec 2025 09:10:44 +0000
>
> Currently, it is not possible to use variables directly in embedded lisp
> templates in org-capture templates. For example this is not possible to
> type:
>
> %(default-directory)
>
> since current embedded lisp evaluator can only evaluate functions.
>
> The proposed patch suggests unintrosive, per-template opt-in that allows
> for %() expansions with full lisp evaluation.
Thanks, but since this is an Org-specific issue, please submit the
patch to the Org developers.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80062; Package
emacs.
(Tue, 23 Dec 2025 18:18:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 80062 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
________________________________
Från: Eli Zaretskii <eliz <at> gnu.org>
Skickat: den 23 december 2025 14:36
Till: arthur miller <arthur.miller <at> live.com>
Kopia: 80062 <at> debbugs.gnu.org <80062 <at> debbugs.gnu.org>
Ämne: Re: bug#80062: 31.0.50; Feature request: Allow full Lisp in capture-templates expansions (unobtrusive opt-in)
> Thanks, but since this is an Org-specific issue, please submit the
> patch to the Org developers.
Does org have their own bug tracker?
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80062; Package
emacs.
(Tue, 23 Dec 2025 19:02:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 80062 <at> debbugs.gnu.org (full text, mbox):
arthur miller <arthur.miller <at> live.com> writes:
>> Thanks, but since this is an Org-specific issue, please submit the
>> patch to the Org developers.
>
> Does org have their own bug tracker?
See https://orgmode.org/manual/Feedback.html#Feedback
TL;DR: Just send to the mailing list. If you want the request to be more
visible, prefix subject with [FR].
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80062; Package
emacs.
(Tue, 23 Dec 2025 19:46:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 80062 <at> debbugs.gnu.org (full text, mbox):
> From: arthur miller <arthur.miller <at> live.com>
> CC: "80062 <at> debbugs.gnu.org" <80062 <at> debbugs.gnu.org>
> Date: Tue, 23 Dec 2025 18:17:28 +0000
>
> ----------------------------------------------------------------------------
> Från: Eli Zaretskii <eliz <at> gnu.org>
> Skickat: den 23 december 2025 14:36
> Till: arthur miller <arthur.miller <at> live.com>
> Kopia: 80062 <at> debbugs.gnu.org <80062 <at> debbugs.gnu.org>
> Ämne: Re: bug#80062: 31.0.50; Feature request: Allow full Lisp in capture-templates expansions
> (unobtrusive opt-in)
>
> > Thanks, but since this is an Org-specific issue, please submit the
> > patch to the Org developers.
>
> Does org have their own bug tracker?
Yes, type "M-x org-submit-bug-report RET".
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80062; Package
emacs.
(Wed, 24 Dec 2025 03:01:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 80062 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
________________________________
Från: Eli Zaretskii <eliz <at> gnu.org>
Skickat: den 23 december 2025 20:45
Till: arthur miller <arthur.miller <at> live.com>
Kopia: 80062 <at> debbugs.gnu.org <80062 <at> debbugs.gnu.org>
Ämne: Re: bug#80062: 31.0.50; Feature request: Allow full Lisp in capture-templates expansions (unobtrusive opt-in)
>> Does org have their own bug tracker?
> Yes, type "M-x org-submit-bug-report RET".
Aha. Ok. Thanks, no prob., Didn't actually know.
[Message part 2 (text/html, inline)]
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility.
(Wed, 24 Dec 2025 14:00:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
arthur miller <arthur.miller <at> live.com>:
bug acknowledged by developer.
(Wed, 24 Dec 2025 14:00:03 GMT)
Full text and
rfc822 format available.
Message #25 received at 80062-done <at> debbugs.gnu.org (full text, mbox):
> From: arthur miller <arthur.miller <at> live.com>
> CC: "80062 <at> debbugs.gnu.org" <80062 <at> debbugs.gnu.org>
> Date: Wed, 24 Dec 2025 03:00:34 +0000
>
> ----------------------------------------------------------------------------
> Från: Eli Zaretskii <eliz <at> gnu.org>
> Skickat: den 23 december 2025 20:45
> Till: arthur miller <arthur.miller <at> live.com>
> Kopia: 80062 <at> debbugs.gnu.org <80062 <at> debbugs.gnu.org>
> Ämne: Re: bug#80062: 31.0.50; Feature request: Allow full Lisp in capture-templates expansions
> (unobtrusive opt-in)
>
> >> Does org have their own bug tracker?
>
> > Yes, type "M-x org-submit-bug-report RET".
>
> Aha. Ok. Thanks, no prob., Didn't actually know.
Thanks, closing.
This bug report was last modified 3 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.