branch: externals/denote-journal commit bbb32c3c442d7779f52869c3789734a20f832cda Author: Ettore Berardi <ett...@fastmail.com> Commit: Ettore Berardi <ett...@fastmail.com>
Extend the Calendar face to work in the TTY. --- denote-journal.el | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/denote-journal.el b/denote-journal.el index da2a9e7274..48d89b4912 100644 --- a/denote-journal.el +++ b/denote-journal.el @@ -114,11 +114,6 @@ journal entry (refer to the `tmr' package on GNU ELPA)." :group 'denote-journal :type 'hook) -(defcustom denote-journal-terminal-calendar-marker ?* - "Character to mark a Denote journal entry in the `calendar` when in terminal mode." - :group 'denote-journal - :type 'character) - (defun denote-journal-directory () "Make the variable `denote-journal-directory' and its parents." (if-let* (((stringp denote-journal-directory)) @@ -310,17 +305,12 @@ file's title. This has the same meaning as in `denote-link'." ;;;; Integration with the `calendar' -(defface denote-journal-calendar '((t :box (:line-width (-1 . -1)))) +(defface denote-journal-calendar + '((((supports :box t)) + :box (:line-width (-1 . -1))) + (t :inverse-video t)) "Face to mark a Denote journal entry in the `calendar'.") -(defun denote-journal--get-calendar-marker (date) - "Return the appropriate marker for DATE. -If GUI Emacs, return the symbol 'denote-journal-calendar. -If terminal Emacs, return the character `denote-journal-terminal-calendar-marker'." - (if (display-graphic-p) - 'denote-journal-calendar - denote-journal-terminal-calendar-marker)) - (defun denote-journal-calendar--file-to-date (file) "Convert FILE to calendar date by interpreting its identifier." (when-let* ((identifier (denote-retrieve-filename-identifier file)) @@ -361,7 +351,7 @@ If terminal Emacs, return the character `denote-journal-terminal-calendar-marker (dates (delq nil (mapcar #'denote-journal-calendar--file-to-date files)))) (dolist (date dates) (when (calendar-date-is-visible-p date) - (calendar-mark-visible-date date (denote-journal--get-calendar-marker date)))))) + (calendar-mark-visible-date date 'denote-journal-calendar))))) (defun denote-journal-calendar--date-to-time (calendar-date) "Return internal time of `calendar' CALENDAR-DATE.