From bc833a9ff46ab4ed9fdc71b09fa72423c8e21adf Mon Sep 17 00:00:00 2001 From: HyunggyuJang Date: Sun, 26 Sep 2021 16:00:53 +0900 Subject: [PATCH] (fix)capture: ignore file template upon capture goto. (#1858) Currently, roam allows file template *nominally*, but, if one tries to set up, it causes trouble. `goto` functions, like `org-roam-dailies-goto-*`, tries to expand file template with `org-roam-format-template`, which assumes template is string. Hence, complains about it. This commit suppress such malfunctions by do nothing for non-string template. --- org-roam-capture.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org-roam-capture.el b/org-roam-capture.el index edbe339..dbb8ccc 100644 --- a/org-roam-capture.el +++ b/org-roam-capture.el @@ -466,8 +466,11 @@ capture target." (let ((id (cond ((run-hook-with-args-until-success 'org-roam-capture-preface-hook)) (t (org-roam-capture--setup-target-location))))) (org-roam-capture--adjust-point-for-capture-type) - (org-capture-put :template - (org-roam-capture--fill-template (org-capture-get :template))) + (let ((template (org-capture-get :template))) + (when (stringp template) + (org-capture-put + :template + (org-roam-capture--fill-template template)))) (org-roam-capture--put :id id) (org-roam-capture--put :finalize (or (org-capture-get :finalize) (org-roam-capture--get :finalize)))))