(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
This commit is contained in:
N V 2020-05-17 11:51:25 -04:00 committed by GitHub
parent 1b5e55b6c4
commit 78b518efd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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