branch: externals/denote-journal
commit db08050dc33628c882899937679b4a11229c7635
Merge: d05996ca29 7eed95a981
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: GitHub <nore...@github.com>

    Merge pull request #12 from brabalan/main
    
    calendar-mark-visible-date only called on visible dates
---
 denote-journal.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/denote-journal.el b/denote-journal.el
index 0df3f0bd9a..6a3eeb1359 100644
--- a/denote-journal.el
+++ b/denote-journal.el
@@ -325,9 +325,11 @@ file's title.  This has the same meaning as in 
`denote-link'."
                           (calendar-extract-year calendar-date)))
                (`(,current-month ,_ ,current-year) calendar-date)
                (`(,previous-month . ,previous-year) 
(calendar-increment-month-cons (- interval 1)))
+               (`(,previous-month-2 . ,previous-year-2) 
(calendar-increment-month-cons (- interval 2)))
                (`(,next-month . ,next-year) (calendar-increment-month-cons (+ 
interval 1)))
-               (years (list previous-year current-year next-year))
-               (months (list previous-month current-month next-month))
+               (`(,next-month-2 . ,next-year-2) (calendar-increment-month-cons 
(+ interval 2)))
+               (years (list previous-year-2 previous-year current-year 
next-year next-year-2))
+               (months (list previous-month-2 previous-month current-month 
next-month next-month-2))
                (time-regexp (concat (regexp-opt (mapcar #'number-to-string 
years))
                                     (regexp-opt (mapcar (lambda (number) 
(format "%02d" number)) months))))
                (keyword-regexp (denote-journal--keyword-regex)))
@@ -345,7 +347,8 @@ file's title.  This has the same meaning as in 
`denote-link'."
               (files (denote-journal-calendar--get-files date))
               (dates (delq nil (mapcar #'denote-journal-calendar--file-to-date 
files))))
     (dolist (date dates)
-      (calendar-mark-visible-date date 'denote-journal-calendar))))
+      (when (calendar-date-is-visible-p 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.

Reply via email to