From d099f9bef948b9a0bef1c56229e360257c30fe27 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Wed, 22 Jul 2020 20:59:35 +0800 Subject: [PATCH] (fix): enable org-mode in temp buffers (#957) Fixes #956. The extraction of links rely on appropriate regexp being set for outline-mode, to determine the outline information. Because the information were extracted in a temporary buffer, the outline regexp was not set. This corrects for that, but probably adds significant extraction time. --- org-roam-macs.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org-roam-macs.el b/org-roam-macs.el index 3522951..9604ef2 100644 --- a/org-roam-macs.el +++ b/org-roam-macs.el @@ -45,7 +45,9 @@ If FILE, set `org-roam-temp-file-name' to file and insert its contents." (let ((current-org-roam-directory (make-symbol "current-org-roam-directory"))) `(let ((,current-org-roam-directory org-roam-directory)) (with-temp-buffer - (let ((org-roam-directory ,current-org-roam-directory)) + (let ((org-roam-directory ,current-org-roam-directory) + (org-mode-hook nil)) + (org-mode) (when ,file (insert-file-contents ,file) (setq-local org-roam-file-name ,file))