branch: externals/denote-journal
commit f4d369a4e398246ffddaed0b407c4987f0a330aa
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Tweak the denote-journal-calendar-mode to avoid repetition
---
 denote-journal.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/denote-journal.el b/denote-journal.el
index d783b3d99c..74bc7dd864 100644
--- a/denote-journal.el
+++ b/denote-journal.el
@@ -408,10 +408,9 @@ among them."
 Add the function `denote-journal-calendar-mode' to the
 `calendar-mode-hook' for changes to take effect."
   :global nil
-  (if denote-journal-calendar-mode
-      (dolist (hook '(calendar-today-visible-hook 
calendar-today-invisible-hook))
-        (add-hook hook #'denote-journal-calendar-mark-dates nil :local))
-    (dolist (hook '(calendar-today-visible-hook calendar-today-invisible-hook))
+  (dolist (hook '(calendar-today-visible-hook calendar-today-invisible-hook))
+    (if denote-journal-calendar-mode
+        (add-hook hook #'denote-journal-calendar-mark-dates nil :local)
       (remove-hook hook #'denote-journal-calendar-mark-dates :local))))
 
 (provide 'denote-journal)

Reply via email to