Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert time is taken from clock line in logbook drawer #42

Open
elfehr opened this issue Sep 19, 2024 · 0 comments
Open

Alert time is taken from clock line in logbook drawer #42

elfehr opened this issue Sep 19, 2024 · 0 comments

Comments

@elfehr
Copy link

elfehr commented Sep 19, 2024

Let's consider for example this task scheduled today without a time. Org-alert acts like it's scheduled at 15:34 (the timestamp in the oldest clocked time).

*** TODO Laundry
SCHEDULED: <2024-09-19 Thu .+7d>
:LOGBOOK:
- State "DONE"       from "TODO"       [2024-09-12 Thu 13:53]
CLOCK: [2022-04-29 Fri 23:59]--[2022-04-30 Sat 00:07] =>  0:08
- State "STARTED"    from "TODO"       [2022-04-29 Fri 15:43]
CLOCK: [2022-04-29 Fri 15:30]--[2022-04-29 Fri 15:34] =>  0:04
- State "DONE"       from "TODO"       [2022-03-07 Mon 17:46]
:END:

I tracked the problem to org-alert--parse-entry. It seems that string-match doesn't stop at line boundaries like for example re-search-forward does, so it will match SCHEDULED: < from the scheduling line and 15:34] => from the last clock line.

Probably it would be more robust to change org-alert--parse-entry, but if anybody else has the same problem, removing the first wildcards from org-alert-time-match-string works for me:

(setq org-alert-time-match-string "\\(?:SCHEDULED\\|DEADLINE\\): *<[0-9-]\\{10\\} [A-Z][a-z]\\{2\\} \\([0-9]\\{2\\}:[0-9]\\{2\\}\\).*>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant