[emacs] Update reminders

This commit is contained in:
2026-09-16 20:05:56 -04:00
parent 9e0ef60bc0
commit 896fbc5c63

View File

@ -114,6 +114,16 @@ The default interval is appended unless REM suppresses it."
(setq found (match-string 0))) (setq found (match-string 0)))
(and found (org-reminder-ts-to-seconds found))))) (and found (org-reminder-ts-to-seconds found)))))
(defun org-reminder-entry-anchor (subtree-end)
"Return epoch seconds of the reminder anchor for the entry at point.
Prefers the DEADLINE, then SCHEDULED, then the first inline active
timestamp in the body before SUBTREE-END."
(or (org-reminder-ts-to-seconds (org-entry-get nil "DEADLINE"))
(org-reminder-ts-to-seconds (org-entry-get nil "SCHEDULED"))
(progn
(org-end-of-meta-data t)
(org-reminder-first-inline-ts subtree-end))))
(defun org-reminder-parse-file (file) (defun org-reminder-parse-file (file)
"Parse FILE and return its list of reminder specs. "Parse FILE and return its list of reminder specs.
Each spec is (ID HEADING FIRE-TIME LABEL SECONDS)." Each spec is (ID HEADING FIRE-TIME LABEL SECONDS)."
@ -130,9 +140,7 @@ Each spec is (ID HEADING FIRE-TIME LABEL SECONDS)."
(id (or (org-entry-get nil "ID") (id (or (org-entry-get nil "ID")
(format "%s|%s" file heading))) (format "%s|%s" file heading)))
(rem (org-entry-get nil "REMINDER" t)) (rem (org-entry-get nil "REMINDER" t))
(anchor (progn (anchor (org-reminder-entry-anchor subtree-end)))
(org-end-of-meta-data t)
(org-reminder-first-inline-ts subtree-end))))
(when anchor (when anchor
(dolist (interval (org-reminder-task-intervals rem)) (dolist (interval (org-reminder-task-intervals rem))
(push (list id heading (push (list id heading