From 45aa3e69738c4280e558921e4e2f5c1d28448896 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Thu, 22 Apr 2021 00:23:10 +0800 Subject: [PATCH] fill-template: fill from plist --- org-roam-capture.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/org-roam-capture.el b/org-roam-capture.el index b85f3ca..87d44a8 100644 --- a/org-roam-capture.el +++ b/org-roam-capture.el @@ -484,10 +484,16 @@ run Org-capture's template expansion." (funcall (if org-capture-p #'org-capture-fill-template #'identity) (s-format str (lambda (key) - (let ((fn (intern (concat "org-roam-node-" key)))) - (if (fboundp fn) - (funcall fn org-roam-capture--node) - (completing-read (format "%s: " key) nil))))))) + (let ((fn (intern (concat "org-roam-node-" key))) + (ksym (intern (concat ":" key)))) + (cond + ((fboundp fn) + (funcall fn org-roam-capture--node)) + ((plist-get org-roam-capture--info ksym) + (plist-get org-roam-capture--info ksym)) + (t (let ((r (completing-read (format "%s: " key) nil))) + (plist-put org-roam-capture--info ksym r) + r)))))))) (defun org-roam-capture--goto-location () "Initialize the buffer, and goto the location of the new capture.