From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Capture template and elisp expression Date: Thu, 06 Jan 2011 18:41:16 -0500 Message-ID: <26474.1294357276@gamaville.americas.hpqcorp.net> References: <4D25B0BE.3040408@gmail.com> <23766.1294352789@gamaville.americas.hpqcorp.net> Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=52089 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PazSJ-0000WC-Hs for emacs-orgmode@gnu.org; Thu, 06 Jan 2011 18:41:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PazSI-0000wr-I9 for emacs-orgmode@gnu.org; Thu, 06 Jan 2011 18:41:19 -0500 Received: from g6t0187.atlanta.hp.com ([15.193.32.64]:37624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PazSI-0000wl-Dt for emacs-orgmode@gnu.org; Thu, 06 Jan 2011 18:41:18 -0500 In-Reply-To: Message from Carsten Dominik of "Thu, 06 Jan 2011 23:44:56 +0100." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: nicholas.dokos@hp.com, emacs-orgmode , Rainer M Krug Carsten Dominik wrote: > > [fn:1] Is there an easier way to get the filename of the file I was > > visiting when I initiated the capture? If not, should there be? > > Perhaps > > a %f escape? > > Hi Nick, > > you can use > > (buffer-file-name (org-capture-get :original-buffer)) > > and we could certainly introduce a special escape for it if helpful. > > If it is easier, we can also put the filename itself into the property > list, > and any other information we like. This should happen in the function > org-capture, > close to the location where the buffer is stored, so near this line: > > (org-capture-put :original-buffer orig-buf :annotation annotation > :initial initial) > > org-capture uses this property list precisely so that it is simple > to add any information required. > > Note that, after the template has been filled in, it is better > to access information in the property list with > > > (org-capture-get PROPERTY 'local) > > to avoid conflicts with other ongoing capture processes. > > Hope this helps. > It sure does - thanks! Nick