emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Erik Iverson <eriki@ccbr.umn.edu>
To: Emacs-orgmode@gnu.org
Subject: org-capture templates with file+olp target
Date: Sun, 22 Aug 2010 22:56:37 -0500	[thread overview]
Message-ID: <4C71F175.2040809@ccbr.umn.edu> (raw)

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	other threads:[~2010-08-23  3:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23  3:56 Erik Iverson [this message]
2010-08-23  4:00 ` org-capture templates with file+olp target Erik Iverson
2010-08-23 18:54 ` David Maus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C71F175.2040809@ccbr.umn.edu \
    --to=eriki@ccbr.umn.edu \
    --cc=Emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).