diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-30 09:25:09 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-30 09:25:09 -0500 |
| commit | f90a087d5025952f0ca1b81d322f29891a40e540 (patch) | |
| tree | 3d95e20b7e4a9f4022c461fbf8d330e6eff164fb /README.org | |
| parent | c5ef22aacd5954106f55c8c7b6ae52f7f7bbfa76 (diff) | |
| download | dotemacs-f90a087d5025952f0ca1b81d322f29891a40e540.tar.gz dotemacs-f90a087d5025952f0ca1b81d322f29891a40e540.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 'README.org')
0 files changed, 0 insertions, 0 deletions
