(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.
This commit is contained in:
HyunggyuJang
2021-09-26 16:00:53 +09:00
committed by GitHub
parent ec8d250f6c
commit bc833a9ff4

View File

@ -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)))))