[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Capture template -- Global replacement of prompt string in buffe
From: |
Bernt Hansen |
Subject: |
Re: [O] Capture template -- Global replacement of prompt string in buffer? |
Date: |
Sun, 25 Nov 2012 19:33:21 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Michael Baum <address@hidden> writes:
> I'm not sure (because I didn't understand what was going on) if this is the
> same question that Sebastian Fischmeister asked earlier ("Custom escapes &
> the evaluation order in fill-template"), but is it
> possible to construct a capture template using something like the %{prompt}
> that replaces _all_ occurrences of the prompt string throughout the capture
> buffer, rather than just at the insertion point of
> the escape expression?
>
> I want to do something like this:
> -----------8<--------------------------------
> ("p" "phone log" entry (file+datetree org-phone-log)
> "* %^{Organization} - %^{First Name} %^{Last Name}
> :PROPERTIES:
> :FIRST_NAME: {First Name}
> :LAST_NAME: {Last Name}
> :ORG: {Organization}
> :END:
>
> usw.
> -----------8<--------------------------------
>
> where the value entered in response to {First Name} gets globally substituted
> in two or more places in the template.
>
> Can this be done?
Hi Michael,
Yes this is possible but you have to reference the prompt fields by
position.
--8<---------------cut here---------------start------------->8---
("p" "phone log" entry (file+datetree org-phone-log)
"* %^{Organization} - %^{First Name} %^{Last Name}
:PROPERTIES:
:FIRST_NAME: %\\2
:LAST_NAME: %\\3
:ORG: %\\1
:END:
")
--8<---------------cut here---------------end--------------->8---
Should do what you want I think.
Regards,
Bernt