From c8a360afdd96a99c14de1bd22f5f9cd16f2580a6 Mon Sep 17 00:00:00 2001 From: lennonhill <31923882+lennonhill@users.noreply.github.com> Date: Thu, 24 Feb 2022 18:11:20 +0100 Subject: [PATCH] (fix)capture: don't update org-id-locations if file is unknown (#2103) --- org-roam-capture.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org-roam-capture.el b/org-roam-capture.el index 475b53b..9c639a9 100644 --- a/org-roam-capture.el +++ b/org-roam-capture.el @@ -715,7 +715,9 @@ the current value of `point'." (when (find-buffer-visiting new-file) (kill-buffer (find-buffer-visiting new-file))) (delete-file new-file)) - (org-id-add-location (org-roam-capture--get :id) (org-roam-capture--get :new-file)) + (when-let* ((buffer (plist-get org-capture-plist :buffer)) + (file (buffer-file-name buffer))) + (org-id-add-location (org-roam-capture--get :id) file)) (when-let* ((finalize (org-roam-capture--get :finalize)) (org-roam-finalize-fn (intern (concat "org-roam-capture--finalize-" (symbol-name finalize)))))