From dd2406ec926bf03d3c059a09d8533f4ba79c788a Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Thu, 21 May 2020 13:14:06 +0800 Subject: [PATCH] (fix): fix 'ref context not returning path to file (#678) --- org-roam-capture.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org-roam-capture.el b/org-roam-capture.el index bf5d0d0..78363fd 100644 --- a/org-roam-capture.el +++ b/org-roam-capture.el @@ -265,8 +265,9 @@ This function is used solely in Org-roam's capture templates: see ('ref (let ((completions (org-roam--get-ref-path-completions)) (ref (cdr (assoc 'ref org-roam-capture--info)))) - (or (cdr (assoc ref completions)) - (org-roam-capture--new-file)))) + (if-let ((pl (cdr (assoc ref completions)))) + (plist-get pl :path) + (org-roam-capture--new-file)))) (_ (error "Invalid org-roam-capture-context"))))) (org-roam-capture--expand-template) (org-roam-capture--put :file-path file-path)