(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.
This commit is contained in:
Jethro Kuan 2020-07-22 20:59:35 +08:00 committed by GitHub
parent b5f3f04318
commit d099f9bef9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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