* Org capture templates - file paths
@ 2010-08-19 8:52 Gustav Wikström
2010-08-19 9:36 ` Puneeth
2010-08-19 11:56 ` Magnus Henoch
0 siblings, 2 replies; 4+ messages in thread
From: Gustav Wikström @ 2010-08-19 8:52 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 757 bytes --]
Hello!
I'm having some trouble with org-capture. Could someone explain to me why
the following is not working? (And what to do to get it to work..)
Code:
(defvar my-gtd-inbox-file (concat my-gtd-root "inbox.org"))
;;; Capture templates
(setq org-capture-templates
'(("n" "Note" entry (file my-gtd-inbox-file)
"* %?\n %i\n %a")
("j" "Journal" entry (file+datetree my-gtd-journal-file)
"* %?\nEntered on %U\n %i\n %a")))
End code.
what I've figured so far is that variables cannot be used in templates... Is
there some workaround for this, or could it possibly be implemented? I need
it since i'm on multiple systems where paths to the same files might differ
depending on the system in use...
Regards Gustav Wikström
[-- Attachment #1.2: Type: text/html, Size: 1276 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Org capture templates - file paths
2010-08-19 8:52 Org capture templates - file paths Gustav Wikström
@ 2010-08-19 9:36 ` Puneeth
2010-08-19 11:56 ` Magnus Henoch
1 sibling, 0 replies; 4+ messages in thread
From: Puneeth @ 2010-08-19 9:36 UTC (permalink / raw)
To: Gustav Wikström; +Cc: emacs-orgmode
2010/8/19 Gustav Wikström <gustav.erik@gmail.com>:
> Hello!
> I'm having some trouble with org-capture. Could someone explain to me why
> the following is not working? (And what to do to get it to work..)
> Code:
> (defvar my-gtd-inbox-file (concat my-gtd-root "inbox.org"))
> ;;; Capture templates
> (setq org-capture-templates
> '(("n" "Note" entry (file my-gtd-inbox-file)
> "* %?\n %i\n %a")
> ("j" "Journal" entry (file+datetree my-gtd-journal-file)
> "* %?\nEntered on %U\n %i\n %a")))
> End code.
> what I've figured so far is that variables cannot be used in templates... Is
> there some workaround for this, or could it possibly be implemented? I need
> it since i'm on multiple systems where paths to the same files might differ
> depending on the system in use...
From what I understand from the docs (I didn't look at the code),
variables cannot be used.
One way to work around this problem is to use the org-directory variable.
(setq org-directory "~/life-in-plain-text/")
Then, you need not specify the path in the capture templates. You can
just specify the file name (inbox.org)
HTH,
Puneeth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Org capture templates - file paths
2010-08-19 8:52 Org capture templates - file paths Gustav Wikström
2010-08-19 9:36 ` Puneeth
@ 2010-08-19 11:56 ` Magnus Henoch
2010-08-19 12:14 ` Puneeth
1 sibling, 1 reply; 4+ messages in thread
From: Magnus Henoch @ 2010-08-19 11:56 UTC (permalink / raw)
To: emacs-orgmode
Gustav Wikström <gustav.erik@gmail.com> writes:
> (setq org-capture-templates
> '(("n" "Note" entry (file my-gtd-inbox-file)
> "* %?\n %i\n %a")
> ("j" "Journal" entry (file+datetree my-gtd-journal-file)
> "* %?\nEntered on %U\n %i\n %a")))
Backquotes and commas are your friends:
(setq org-capture-templates
`(("n" "Note" entry (file ,my-gtd-inbox-file)
"* %?\n %i\n %a")
("j" "Journal" entry (file+datetree ,my-gtd-journal-file)
"* %?\nEntered on %U\n %i\n %a")))
Read more at
http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html .
Magnus
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-19 12:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-19 8:52 Org capture templates - file paths Gustav Wikström
2010-08-19 9:36 ` Puneeth
2010-08-19 11:56 ` Magnus Henoch
2010-08-19 12:14 ` Puneeth
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).