(feature): global org-roam-mode (#143)

Makes org-roam-mode a global minor mode. This mode adds an advice to find-file-function, which decides whether to turn on the local post-command-hook and after-save-hook.

It also advices delete-file and rename-file to ensure cache consistency. Also fixes a bug introduced with #142
This commit is contained in:
Jethro Kuan
2020-02-20 17:33:30 +08:00
committed by GitHub
parent dd4b1a97a1
commit 8523fb43b4
5 changed files with 188 additions and 181 deletions

View File

@ -46,7 +46,8 @@
(let ((original-dir org-roam--tests-directory)
(new-dir (expand-file-name (make-temp-name "org-roam") temporary-file-directory)))
(copy-directory original-dir new-dir)
(setq org-roam-directory new-dir)))
(setq org-roam-directory new-dir))
(org-roam-mode +1))
(defun org-roam--test-build-cache ()
"Builds the caches synchronously."