From 78b518efd32eeb5168ac96516328a4d21ad7f104 Mon Sep 17 00:00:00 2001 From: N V <44036031+progfolio@users.noreply.github.com> Date: Sun, 17 May 2020 11:51:25 -0400 Subject: [PATCH] (fix): org-roam-capture--capture shadow org-capture-templates-contexts (#662) Lexically bind org-capture-templates-contexts to nil before calling org-capture with org-roam-capture-templates. Otherwise, contexts may shadow org-roam-templates which have same keys as org-capture-templates. mentioned in #651 --- org-roam-capture.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org-roam-capture.el b/org-roam-capture.el index a6f076a..334d929 100644 --- a/org-roam-capture.el +++ b/org-roam-capture.el @@ -317,7 +317,8 @@ Suitable for moving point." The templates are defined at `org-roam-capture-templates'. The GOTO and KEYS argument have the same functionality as `org-capture'." - (let ((org-capture-templates (mapcar #'org-roam-capture--convert-template org-roam-capture-templates))) + (let ((org-capture-templates (mapcar #'org-roam-capture--convert-template org-roam-capture-templates)) + org-capture-templates-contexts) (when (= (length org-capture-templates) 1) (setq keys (caar org-capture-templates))) (add-hook 'org-capture-after-finalize-hook #'org-roam-capture--save-file-maybe-h)