I am trying to write a custom org-capture
template, but I get an error if I try to use the %\N
functionality to insert the N-th prompt. The relevant excerpt of my org-capture-templates
variable is
("ao" "Other meeting" entry
(file+headline "~/org/meeting.org" "Meetings")
"* %^{meeting date}u Meeting with %^{meeting with}
:PROPERTIES:
:MEETWITH: %\\2
:DESCRIPTION: %\\3
:END:
Created on %U
Description: %^{description}
%?" :jump-to-captured t :empty-lines 1)
When I try to capture, everything goes fine until I C-c C-c
the note. Then, the new note fails to save due to the following error:
org-capture: Capture abort: Wrong type argument: stringp, nil
This error only occurs when I try to use the %\N
functionality, not otherwise. I assume the issue must be somehow related to the relevant section of org-capture-fill-template
, but I am unable to discern what could be causing this errant behaviour. That section of code is as follows (from org-capture.el
).
;; Replace %n escapes with nth %^{...} string.
(setq strings (nreverse strings))
(save-excursion
(while (re-search-forward "%\\\\\\([1-9][0-9]*\\)" nil t)
(unless (org-capture-escaped-%)
(replace-match
(nth (1- (string-to-number (match-string 1))) strings)
nil t))))
Note: I have org-roam
and org-roam-bibtex
installed. Could this have anything to do with it?