[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] org-agenda.el: Fix clocking issues regex
From: |
Tim Frana |
Subject: |
[PATCH] org-agenda.el: Fix clocking issues regex |
Date: |
Sat, 15 May 2021 16:14:33 +0200 |
Hi,
The method org-agenda-show-clocking-issues has a faulty regex, which
leads to false-positive
clocking issues: " Clocked: +(-\\|\\([0-9]+:[0-9]+\\))"
There is no outer group to limit the OR-expression \\|, so the right
half will match timestamps with
a closing parenthesis without any "Clocked" in front of it.
I added a non-capturing group in the attached patch: " Clocked:
+(\\(?:-\\|\\([0-9]+:[0-9]+\\)\\))".
Reproduction:
Define a custom agenda:
(setq org-agenda-custom-commands '(("d" "Clock report for today" agenda ""
((org-agenda-span 1)
(org-agenda-start-with-clockreport-mode t)
(org-agenda-start-with-log-mode
'clockcheck)))))
Use an org file that is included in org-agenda-files, and add this
sample headline:
Sample headline with time and closing parenthesis in it (it happened at
12:00)
Clock in and out of the headline, make sure the clock timespan is at
least 1 minute, and open the
agenda defined above. Observe that the headline is reported as
overlapping with itself, as the
faulty regex will match twice on its agenda line.
Best Regards,
Tim
0001-org-agenda.el-Fix-clocking-issues-regex.patch
Description: Text document
- [PATCH] org-agenda.el: Fix clocking issues regex,
Tim Frana <=