From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Iverson Subject: org-capture templates with file+olp target Date: Sun, 22 Aug 2010 22:56:37 -0500 Message-ID: <4C71F175.2040809@ccbr.umn.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=59045 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnO8X-0005uA-Cf for Emacs-orgmode@gnu.org; Sun, 22 Aug 2010 23:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnO8V-0000Fo-UW for Emacs-orgmode@gnu.org; Sun, 22 Aug 2010 23:55:53 -0400 Received: from pegasus.biostat.wisc.edu ([144.92.73.35]:39387) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnO8V-0000Fc-Q9 for Emacs-orgmode@gnu.org; Sun, 22 Aug 2010 23:55:51 -0400 Received: from [192.168.1.117] (c-24-118-198-210.hsd1.mn.comcast.net [24.118.198.210]) (authenticated bits=0) by pegasus.biostat.wisc.edu (8.13.6/8.13.6) with ESMTP id o7N3tflQ029801 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Sun, 22 Aug 2010 22:55:43 -0500 (CDT) 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: Emacs-orgmode@gnu.org Hello, Using latest org-mode from git. I'm trying to set up a simple org-capture template, to write to a file test.org. The first two lines below simply define a path to some org mode file. My confusion with the template is when I invoke org-capture -- I have it set to C-c c --, and then hit `t`, everything works as I'd hope. (the file+headline target) But when I hit `b`, (the file+olp target), I get an error, which I can avoid by hardcoding the filename instead of using the org-test-file variable in that case. I get the error: find-file-noselect: Wrong type argument: stringp, org-test-file from the org-find-olp function in org.el. I tried to debug, and it looks like that variable is not getting evaluated for some reason. I'm sure it's obvious to someone, but is there a way around this? Hardcoding the path is actually problematic, since my org files are passed around various machines using git/Dropbox, and therefore the path is different depending on where I am located. Below is the simplest example I could come up with, just create a ~/test.org file and try it out. ;; a path to some org-files (setq org-test-path "/tmp") ;; a specific org-file (setq org-test-file (concat org-test-path "/test.org")) (setq org-capture-templates '(("t" "Todo" entry (file+headline org-test-file "Tasks") "* TODO %?\n %i\n %a") ("b" "Buy" item (file+olp org-test-file "Stuff to Buy" "House") "")))