Skip to content

Commit a00473f

Browse files
Bug fix: repeating events appeared multiple times
The bug was that a repeating event appeared multiple times at the first day it was scheduled/deadline; the reason is this package scrapes the agenda for data and in day-mode an individual repeating events appears in all the future dates so need to dedup it.
1 parent 26ab323 commit a00473f

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

calfw-org.el

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,23 @@ For example,
9696
"[internal] Return org schedule items between BEGIN and END."
9797
(let ((org-agenda-prefix-format " ")
9898
(org-agenda-include-inactive-timestamps
99-
cfw:org-agenda-inactive-timestamps)
99+
cfw:org-agenda-inactive-timestamps)
100100
(span 'day))
101101
(setq org-agenda-buffer
102-
(when (buffer-live-p org-agenda-buffer)
103-
org-agenda-buffer))
102+
(when (buffer-live-p org-agenda-buffer)
103+
org-agenda-buffer))
104104
(org-compile-prefix-format nil)
105-
(loop for date in (cfw:enumerate-days begin end) append
106-
(loop for file in (or cfw:org-icalendars (org-agenda-files nil 'ifmode))
107-
append
108-
(progn
109-
(org-check-agenda-file file)
110-
(apply 'org-agenda-get-day-entries
111-
file date
112-
cfw:org-agenda-schedule-args))))))
105+
(delete-duplicates
106+
(loop for date in (cfw:enumerate-days begin end) append
107+
(loop for file in (or cfw:org-icalendars (org-agenda-files nil 'ifmode))
108+
append
109+
(progn
110+
(org-check-agenda-file file)
111+
(apply 'org-agenda-get-day-entries
112+
file date
113+
cfw:org-agenda-schedule-args))))
114+
:from-end t
115+
:test (lambda (x y) (equal (cfw:org-tp x 'date) (cfw:org-tp y 'date))))))
113116

114117
(defun cfw:org-onclick ()
115118
"Jump to the clicked org item."

0 commit comments

Comments
 (0)