refactor(emacs): remove DEADLINE logic, keep only CALDAV_UNTIL property
Some checks failed
CI / check (push) Has been cancelled
Some checks failed
CI / check (push) Has been cancelled
DEADLINE doesn't limit recurring event display - agenda skip function handles that now. Simplified advice to only store CALDAV_UNTIL property. Also made debug logging unconditional to diagnose why some events don't get the property. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -181,34 +181,24 @@
|
|||||||
|
|
||||||
;; Handle UNTIL in recurring events
|
;; Handle UNTIL in recurring events
|
||||||
;; org-caldav ignores UNTIL from RRULE - events repeat forever.
|
;; org-caldav ignores UNTIL from RRULE - events repeat forever.
|
||||||
;; This advice extracts UNTIL and adds a DEADLINE without repeater,
|
;; This advice extracts UNTIL and stores it as a property for agenda filtering.
|
||||||
;; which Org 9.7+ interprets as the recurrence end date.
|
(defun my/org-caldav-add-until-property (orig-fun eventdata-alist)
|
||||||
(defun my/org-caldav-add-until-deadline (orig-fun eventdata-alist)
|
"Advice to store CALDAV_UNTIL property for recurring events."
|
||||||
"Advice to add DEADLINE for UNTIL in recurring events."
|
|
||||||
(let ((result (funcall orig-fun eventdata-alist)))
|
(let ((result (funcall orig-fun eventdata-alist)))
|
||||||
(let* ((rrule-props (alist-get 'rrule-props eventdata-alist))
|
(let* ((rrule-props (alist-get 'rrule-props eventdata-alist))
|
||||||
(until-str (cadr (assoc 'UNTIL rrule-props)))
|
(until-str (cadr (assoc 'UNTIL rrule-props)))
|
||||||
(summary (alist-get 'summary eventdata-alist)))
|
(summary (alist-get 'summary eventdata-alist)))
|
||||||
;; Debug: log what we're seeing (remove after debugging)
|
;; Debug: log what we're seeing
|
||||||
(when rrule-props
|
(message "CALDAV-DEBUG: %s | rrule-props: %S | until: %s"
|
||||||
(message "CALDAV-DEBUG: %s | rrule-props: %S | until: %s"
|
(or summary "?") rrule-props until-str)
|
||||||
(or summary "?") rrule-props until-str))
|
|
||||||
(when until-str
|
(when until-str
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(org-back-to-heading t)
|
(org-back-to-heading t)
|
||||||
;; Store original UNTIL for reference
|
(org-entry-put nil "CALDAV_UNTIL" until-str))))
|
||||||
(org-entry-put nil "CALDAV_UNTIL" until-str)
|
|
||||||
;; Parse UNTIL: format is YYYYMMDD or YYYYMMDDTHHMMSSZ
|
|
||||||
(when (string-match "^\\([0-9]\\{4\\}\\)\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)" until-str)
|
|
||||||
(let* ((year (string-to-number (match-string 1 until-str)))
|
|
||||||
(month (string-to-number (match-string 2 until-str)))
|
|
||||||
(day (string-to-number (match-string 3 until-str)))
|
|
||||||
(deadline-ts (format "<%d-%02d-%02d>" year month day)))
|
|
||||||
(org-add-planning-info 'deadline deadline-ts))))))
|
|
||||||
result))
|
result))
|
||||||
|
|
||||||
(advice-add 'org-caldav-insert-org-event-or-todo
|
(advice-add 'org-caldav-insert-org-event-or-todo
|
||||||
:around #'my/org-caldav-add-until-deadline)
|
:around #'my/org-caldav-add-until-property)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun my/get-rbw-password (alias)
|
(defun my/get-rbw-password (alias)
|
||||||
|
|||||||
Reference in New Issue
Block a user