unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / 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

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git