emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] org-capture templates with file+olp target


From: Erik Iverson
Subject: [Orgmode] org-capture templates with file+olp target
Date: Sun, 22 Aug 2010 22:56:37 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

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")
           "")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]