From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Capture template -- Global replacement of prompt string in buffer? Date: Sun, 25 Nov 2012 19:33:21 -0500 Message-ID: <87ip8tp5im.fsf@norang.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tcmdj-00073N-FA for emacs-orgmode@gnu.org; Sun, 25 Nov 2012 19:33:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tcmdg-0005TC-Py for emacs-orgmode@gnu.org; Sun, 25 Nov 2012 19:33:35 -0500 Received: from mho-03-ewr.mailhop.org ([204.13.248.66]:57772 helo=mho-01-ewr.mailhop.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tcmdg-0005RS-MO for emacs-orgmode@gnu.org; Sun, 25 Nov 2012 19:33:32 -0500 In-Reply-To: (Michael Baum's message of "Fri, 2 Nov 2012 14:13:34 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Baum Cc: emacs-orgmode@gnu.org Michael Baum writes: > I'm not sure (because I didn't understand what was going on) if this is t= he same question that Sebastian Fischmeister=C2=A0 asked earlier ("Custom e= scapes & the evaluation order in fill-template"), but is it > possible to construct a capture template using something like the %{promp= t} that replaces _all_ occurrences of the prompt string throughout the capt= ure buffer,=C2=A0 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 substit= uted 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