emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [HELP} Capture Template
@ 2020-11-19 18:41 Tim Cross
  2020-11-19 19:10 ` Marco Wahl
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Cross @ 2020-11-19 18:41 UTC (permalink / raw)
  To: Org-mode


I'm trying to get a capture template to work, but without luck. Not sure
what I'm doing wrong, but figured someone on this list could help by
pointing out my probably obvious error.

The template is

 ("e" "expense" entry
  (file+headline "~/Documents/org-data/refile.org" "Expenses")
  "* Expense: %^{Description} :EXPENSE:\n\n | Date | %u |\n | Description | %\1 |\n | Amount | %^{Amount} |\n"
  :empty-line-after 1)

The problem is with the %\1 expansion. According to the docs, the %\N
expansion is replaced with the Nth %^{PROMPT} input. i.e. %\1 should be
the data from the 1st %^{PROMPT} expansion (in this case
%^{Description}.

The problem is, it isn't. Instead, I get %^A as the result instead of
the text I enter with the first %^{Description} expansion. The rest of
the template works fine.

Anyone got any ideas?

Tim

--
Tim Cross


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [HELP} Capture Template
  2020-11-19 18:41 [HELP} Capture Template Tim Cross
@ 2020-11-19 19:10 ` Marco Wahl
  0 siblings, 0 replies; 2+ messages in thread
From: Marco Wahl @ 2020-11-19 19:10 UTC (permalink / raw)
  To: emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> I'm trying to get a capture template to work, but without luck. Not sure
> what I'm doing wrong, but figured someone on this list could help by
> pointing out my probably obvious error.
>
> The template is
>
>  ("e" "expense" entry
>   (file+headline "~/Documents/org-data/refile.org" "Expenses")
>   "* Expense: %^{Description} :EXPENSE:\n\n | Date | %u |\n | Description | %\1 |\n | Amount | %^{Amount} |\n"
>   :empty-line-after 1)
>
> The problem is with the %\1 expansion. According to the docs, the %\N
> expansion is replaced with the Nth %^{PROMPT} input. i.e. %\1 should be
> the data from the 1st %^{PROMPT} expansion (in this case
> %^{Description}.
>
> The problem is, it isn't. Instead, I get %^A as the result instead of
> the text I enter with the first %^{Description} expansion. The rest of
> the template works fine.
>
> Anyone got any ideas?

What about a further backslash? I.e. use %\\1 instead of %\1?


Ciao, Marco





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-19 19:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 18:41 [HELP} Capture Template Tim Cross
2020-11-19 19:10 ` Marco Wahl

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).