[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] lisp/org-clock.el (org-clock-sum): Rewrite regex using rx
From: |
Morgan Smith |
Subject: |
[PATCH] lisp/org-clock.el (org-clock-sum): Rewrite regex using rx |
Date: |
Thu, 11 Apr 2024 13:20:49 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hello!
See two attached patches. All tests pass on my computer.
Every once in a while I feel obligated to go back to org-clock-sum to
try and optimize it. I have a file with 8 clocktables in it and it
takes forever to update. This time I decided instead of trying to
optimize, I'm just going to try and understand.
The regex has been altered slightly.
1. Instead of using "[ \t]", I decided to use [[:blank:]]. No real
reason. I just think it's easier to read and maybe slightly more
correct?
2. For the timestamps, instead of ".*?" (using a non-greedy ".*") I
decided to use "[^]]*" (accept everything except "]"). I did this simply
because I'm not used to using non-greedy regex's. Maybe this way
performs better? I didn't test that.
3. I used the variable `org-outline-regexp' but that doesn't actually
change the regex.
0001-lisp-org-clock.el-org-clock-sum-Rewrite-regex-using-.patch
Description: Text Data
0002-Test-clock-times-without-timestamps.patch
Description: Text Data
- [PATCH] lisp/org-clock.el (org-clock-sum): Rewrite regex using rx,
Morgan Smith <=