emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Karl Voit <news1142@karl-voit.at>, emacs-orgmode@gnu.org
Subject: Re: Capture template using variable
Date: Thu, 05 May 2016 20:45:00 +0000	[thread overview]
Message-ID: <CAFyQvY1Hh6B5ZyvBEBokx4e5KejeAiAenNxa8ZcwEu3vOrk4uA@mail.gmail.com> (raw)
In-Reply-To: <2016-05-05T22-34-16@devnull.Karl-Voit.at>

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

Try

(setq my-capture-template-next "* NEXT %?\n:PROPERTIES:\n:CREATED:
%U\n:END:\n\n")

(setq org-capture-templates
      `(  ; Note the backquote here!!
        ("1" "first version with string" entry (file+headline
"~/share/all/org-mode/misc.org" "shorts")
         "* NEXT %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1)
        ("2" "second version with variable" entry (file+headline
"~/share/all/org-mode/misc.org" "shorts")
         ,my-capture-template-next :empty-lines 1) ; and comma before
my-capture-..
        ))

My guess is you need to evaluate my-capture-template-next before putting it
in org-capture-templates and the backquote/comma above do that.
-- 

-- 
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 1095 bytes --]

  reply	other threads:[~2016-05-05 20:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 20:36 Capture template using variable Karl Voit
2016-05-05 20:45 ` Kaushal Modi [this message]
2016-05-05 21:11   ` Karl Voit
2016-05-05 21:27     ` Karl Voit

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=CAFyQvY1Hh6B5ZyvBEBokx4e5KejeAiAenNxa8ZcwEu3vOrk4uA@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=news1142@karl-voit.at \
    /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).