1

In emacs.el I am using the following construct to set up an org-remember template:

(setq org-remember-templates
    '(("Todo" ?t "* TODO %^{Brief Description} %^g\n%?\nAdded: %U" "~/GTD/newgtd.org" "Tasks")
))

That works OK, but now I'd like to introduce parameters into this template definition. Specifically, I'd like to use a variable (or a constant) in place of "~/GTD/newgtd.org"

Let's say I have this definition earlier in the emacs.el:

(setq todo-file (concat org-directory "todo.org"))

How can I use thid variable todo-file in the setq org-remember-templates definition?

I have tried 'todo-file, "todo-file and simply todo-file in place of "~/GTD/newgtd.org" with no luck. What is the secret to reference a variable value here?

1
2

Like this:

(setq org-remember-templates
      `(("Todo"
         ?t
         "* TODO %^{Brief Description} %^g\n%?\nAdded: %U"
         ,todo-file "Tasks")))

It's called backquote.

1
  • That's working, but could you provide a reference to emacs docs please to learn this feature in depth? Thanks! – Alexander Shcheblikin May 7 '15 at 17:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.