(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

@ -43,19 +43,16 @@ The recommended method is using use-package and straight, or a similar package m
(use-package org-roam
:after org
:hook
((org-mode . org-roam-mode)
(after-init . org-roam--build-cache-async) ;; optional!
)
(after-init . org-roam-mode)
:straight (:host github :repo "jethrokuan/org-roam" :branch "develop")
:custom
(org-roam-directory "/path/to/org-files/")
:bind
("C-c n l" . org-roam)
("C-c n t" . org-roam-today)
("C-c n f" . org-roam-find-file)
("C-c n b" . org-roam-switch-to-buffer)
("C-c n i" . org-roam-insert)
("C-c n g" . org-roam-show-graph))
:bind (:map org-roam-mode-map
(("C-c n l" . org-roam)
("C-c n f" . org-roam-find-file)
("C-c n g" . org-roam-show-graph))
:map org-mode-map
(("C-c n i" . org-roam-insert))))
```
For more detailed installation instructions (including instructions for