I am new to org-mode (and to Emacs in general) and am trying to set up org-capture. I would like to define a todo capture item whose template is located in the file ~/.emacs.d/org-templates/todo.tmpl
. I have tried with
(global-set-key (kbd "C-c c") 'org-capture)
(setq org-directory "~/org/")
(setq org-default-notes-file (concat org-directory "notes.org"))
(setq org-todo-template (concat user-emacs-directory "org-templates/todo.tmpl"))
(setq org-capture-templates
'(("t"
"Todo list item"
entry
(file+headline org-default-notes-file "Tasks")
(file org-todo-template)
)))
I get the error:
Wrong type argument: stringp, org-todo-template
if I replace the line
(file org-todo-template)
with
(file "~/.emacs.d/org-templates/todo.tmpl")
then it works, and I do not understand why.
For reference, the content of the file ~/.emacs.d/org-templates/todo.tmpl
is
* TODO %^{Description}
%i
%a
- %?
:LOGBOOK:
CREATED: %U
:END: