branch: externals/denote-journal commit 462dc5f4a33db36804e667af19f359313847ceb9 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Make denote-journal-calendar-mode add hooks locally and clarify its doc string Thanks to Stefan Monnier for suggesting this course of action on the emacs-devel mailing list: <https://lists.gnu.org/archive/html/emacs-devel/2025-03/msg01621.html>. --- README.org | 3 ++- denote-journal.el | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index 197b38bada..1efcb9b6f6 100644 --- a/README.org +++ b/README.org @@ -422,7 +422,8 @@ Denote Journal is meant to be a collective effort. Every bit of help matters. + Author/maintainer :: Protesilaos Stavrou. -+ Contributions to code or the manual :: Honza Pokorny, Vineet C. Kulkarni. ++ Contributions to code or the manual :: Honza Pokorny, Stefan + Monnier, Vineet C. Kulkarni. + Ideas and/or user feedback :: Kevin McCarthy. diff --git a/denote-journal.el b/denote-journal.el index cd50b7359b..5b384f6dbb 100644 --- a/denote-journal.el +++ b/denote-journal.el @@ -371,14 +371,15 @@ among them." "Key map for `denote-journal-calendar-mode'.") (define-minor-mode denote-journal-calendar-mode - "Mark Denote journal entries in the `calendar' using `denote-journal-calendar' face." + "Mark Denote journal entries using `denote-journal-calendar' face. +Add the function `denote-journal-calendar-mode' to the +`calendar-mode-hook' for changes to take effect." :global nil - :init-value nil (if denote-journal-calendar-mode (dolist (hook '(calendar-today-visible-hook calendar-today-invisible-hook)) - (add-hook hook #'denote-journal-calendar-mark-dates)) + (add-hook hook #'denote-journal-calendar-mark-dates nil :local)) (dolist (hook '(calendar-today-visible-hook calendar-today-invisible-hook)) - (remove-hook hook #'denote-journal-calendar-mark-dates)))) + (remove-hook hook #'denote-journal-calendar-mark-dates nil :local)))) (provide 'denote-journal) ;;; denote-journal.el ends here