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 | ab1b0fb832722f1eed8106987069926078540758 (patch) | |
| tree | 06120b1239a0ba47acc63c20155d2d9d5e9f4233 /tests/test-org-drill-first-function.el | |
| parent | f00975d8b27d69f26fd8b5dfbf0d014a5831e6c1 (diff) | |
| download | dotemacs-ab1b0fb832722f1eed8106987069926078540758.tar.gz dotemacs-ab1b0fb832722f1eed8106987069926078540758.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 'tests/test-org-drill-first-function.el')
0 files changed, 0 insertions, 0 deletions
