I would like to define an function using org-roam
's capture system. However, I want to create a new function, not use the variable org-roam-capture-templates
and the related function org-roam-capture
.
I want to create a function that takes a string as an argument so that I can use it in the captured text. In this case, I want to be able to specificy a string (e.g. "TODO", "DONE", or other states) that is added to the beginning of the captured item.
This is my attempt so far:
(defun org-roam-capture-inbox-test (item-string)
(interactive)
(org-roam-capture- :node (org-roam-node-create)
:templates '(("i" "inbox" plain "* %(eval item-string) %?"
:if-new (file "Inbox.org")))))
Evaluating this function creates this capture item: * %![Error: (void-variable item-string)]
. Unless I'm mistaken, this means that item-string
is out of scope when it is called in org-roam-capture-
.
Why is item-string
out of scope in this case? How can I pass it to org-roam-capture-
?