aboutsummaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-30 09:25:09 -0500
committerCraig Jennings <c@cjennings.net>2026-04-30 09:25:09 -0500
commit259060b46986877eaea4520a5ce4df049ca738da (patch)
tree3d95e20b7e4a9f4022c461fbf8d330e6eff164fb /init.el
parent31e2e6e5d7fa19a60a4892f4c1fc1a318e36836a (diff)
downloaddotemacs-259060b46986877eaea4520a5ce4df049ca738da.tar.gz
dotemacs-259060b46986877eaea4520a5ce4df049ca738da.zip
fix(config-utilities): repair validate-org-agenda-timestamps property check
Two bugs in cj/validate-org-agenda-timestamps surfaced while extracting testable helpers. 1. The DEADLINE / SCHEDULED / TIMESTAMP property lookup used (intern (downcase prop)) as the key, producing 'deadline, 'scheduled, 'timestamp. org-element-property expects keywords (:deadline, :scheduled, :timestamp) and returns nil for plain symbols. The property-check branch had never reported anything since the function was written. Only inline-regex matches inside headline contents have ever been flagged. Fixed by building the keyword form: (intern (concat ":" (downcase prop))). 2. Once #1 is fixed, every property timestamp would also match the inline-timestamp regex during the contents scan (since the DEADLINE: / SCHEDULED: / TIMESTAMP lines fall inside contents-begin/end on a parsed headline), producing duplicate reports. Added a per-headline list of property timestamp strings and a member check before pushing an inline match. The function is also restructured into three pieces to make it testable: - cj/--validate-timestamps-in-buffer FILE — pure-ish: walks the current buffer, returns a list of (FILE POS HEAD PROP TS) tuples. - cj/--format-validation-report-section FILE INVALID — pure: returns the per-file org-formatted string. - cj/validate-org-agenda-timestamps (interactive) — orchestrates both helpers across org-agenda-files into a report buffer. The interactive entry-point's behaviour is unchanged from the user's side except that DEADLINE / SCHEDULED / TIMESTAMP property timestamps are now actually checked.
Diffstat (limited to 'init.el')
0 files changed, 0 insertions, 0 deletions