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
|
||||
;; org-caldav ignores UNTIL from RRULE - events repeat forever.
|
||||
;; This advice extracts UNTIL and adds a DEADLINE without repeater,
|
||||
;; which Org 9.7+ interprets as the recurrence end date.
|
||||
(defun my/org-caldav-add-until-deadline (orig-fun eventdata-alist)
|
||||
"Advice to add DEADLINE for UNTIL in recurring events."
|
||||
;; This advice extracts UNTIL and stores it as a property for agenda filtering.
|
||||
(defun my/org-caldav-add-until-property (orig-fun eventdata-alist)
|
||||
"Advice to store CALDAV_UNTIL property for recurring events."
|
||||
(let ((result (funcall orig-fun eventdata-alist)))
|
||||
(let* ((rrule-props (alist-get 'rrule-props eventdata-alist))
|
||||
(until-str (cadr (assoc 'UNTIL rrule-props)))
|
||||
(summary (alist-get 'summary eventdata-alist)))
|
||||
;; Debug: log what we're seeing (remove after debugging)
|
||||
(when rrule-props
|
||||
(message "CALDAV-DEBUG: %s | rrule-props: %S | until: %s"
|
||||
(or summary "?") rrule-props until-str))
|
||||
;; Debug: log what we're seeing
|
||||
(message "CALDAV-DEBUG: %s | rrule-props: %S | until: %s"
|
||||
(or summary "?") rrule-props until-str)
|
||||
(when until-str
|
||||
(save-excursion
|
||||
(org-back-to-heading t)
|
||||
;; Store original UNTIL for reference
|
||||
(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))))))
|
||||
(org-entry-put nil "CALDAV_UNTIL" until-str))))
|
||||
result))
|
||||
|
||||
(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)
|
||||
|
||||
Reference in New Issue
Block a user