emacs-orgmode
[Top][All Lists]
Advanced

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

Using variables in org-capture-templates


From: Nathan Neff
Subject: Using variables in org-capture-templates
Date: Tue, 12 Nov 2019 09:27:31 -0600

Hello all,

I'm sure this is a basic elisp thing but I'd like some help:

I wanted to abstract the "sprintf-like" formats of the template expansion
into readable variables that I can reuse in my templates.  However, upon
substituting variable for the formats, I am getting "Invalid capture template"
for the capture template "T" below -- for comparison the "t" template works.

What am I doing wrong?  I'm sure it has to do with the '() value of org-capture templates,
and the fact that the (concat) is not evaluated.  What is the "correct" way to do this
in elisp?

Here's my code:
 
#+begin_src emacs-lisp
(setq org-capture-templates '())
(setq njn-clocked-entry "\nclocked: %K\n")
(setq njn-from-entry "\nfrom: %a\n")
(setq njn-capture-trailer "\n--\n")

(setq org-capture-templates '(
    ("T" "Todo: Detailed" entry (file+headline "" "Tasks")
        (concat "* todo %^{Heading}\n%U\n%?" njn-from-entry njn-clocked-entry njn-capture-trailer) :prepend t)
    ("t" "Todo: Basic" entry (file+headline "" "Tasks") "* todo %^{Heading}\n%U\n%?\nclocked: %K\n" :prepend t)))

Thanks,
--Nate


reply via email to

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