Fix: contrib/journal: `buffer-file-name' is nil in *Capture* buffer

This commit is contained in:
Benjamin Andresen 2020-04-17 16:17:23 +02:00
parent 65dacd1016
commit b8de456a73

View file

@ -29,6 +29,7 @@
(defun +org-journal-mode-maybe () (defun +org-journal-mode-maybe ()
"Activate `org-journal-mode', maybe." "Activate `org-journal-mode', maybe."
(and (eq major-mode 'org-mode) (and (eq major-mode 'org-mode)
(stringp buffer-file-name)
(string-match-p org-journal-file-pattern buffer-file-name) (string-match-p org-journal-file-pattern buffer-file-name)
(let ((org-mode-hook (remq '+org-journal-mode-maybe org-mode-hook))) (let ((org-mode-hook (remq '+org-journal-mode-maybe org-mode-hook)))
(org-journal-mode)))) (org-journal-mode))))