[emacs] Fix org roam hook

Don't trigger if we're not in an org-roam document.
This commit is contained in:
Correl Roush 2021-06-28 19:39:52 -04:00
parent f8d2f352e0
commit 0ced34adaf

View file

@ -1006,8 +1006,9 @@ Makes for a much nicer note-taking experience.
;; set properly
(add-hook 'hack-local-variables-hook
(lambda ()
(when (f-child-of? (or (buffer-file-name) default-directory)
(expand-file-name org-roam-directory))
(when (and org-roam-directory
(f-child-of? (or (buffer-file-name) default-directory)
(expand-file-name org-roam-directory)))
(writeroom-mode t)))
nil t))