[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] lisp/org-clock.el (org-clock-sum): Rewrite regex using rx
From: |
Morgan Smith |
Subject: |
Re: [PATCH] lisp/org-clock.el (org-clock-sum): Rewrite regex using rx |
Date: |
Wed, 19 Jun 2024 10:57:30 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Ihor Radchenko <yantar92@posteo.net> writes:
> Ping ;)
So I gave up on this specific patch because I wrote a patch to just
rewrite the entire `org-clock-sum' function using org-element API.
Attached is the `org-clock-sum' rewrite patch which I've been using for
a while with no issues. I have half finished patches locally to add
more clocktable tests and to add clocktable benchmarks which is why I
hadn't submitted this yet.
This probably belongs in this email thread instead:
https://list.orgmode.org/87y18vxgjs.fsf@localhost/
I believe I fixed all the points you brought up in that thread.
While this patch is probably ready to merge, doing so might cause
regressions to the fix applied in commit
fd8ddf2874ca00505aa096c6172ea750cd5e9eaa.
Ideally the fix in that commit should be ported to the org-element API.
Notably, the malformed clock from the email thread from that commit is
parsed a little strangely by org-element. I'm not sure what effect this
has on my rewrite patch but regardless, we should probably fix this.
Notice how ":day-end" and ":minute-end" are set but not ":hour-start" or
":minute-start".
I have attached a rough patch adding a test for this case but my brain
is currently melting from a heatwave so it might take me a while to make
it into something good. Feel free to work on this yourself if you have
time.
"CLOCK: [2012-01-01 sun. 00rr:01]--[2012-01-01 sun. 00:02] => 0:01"
(clock
(:standard-properties ...
:status closed :value
(timestamp
(:standard-properties ...
:type inactive-range :range-type daterange :raw-value
"[2012-01-01 sun. 00rr:01]--[2012-01-01 sun. 00:02]" :year-start 2012
:month-start 1 :day-start 1 :hour-start nil :minute-start nil :year-end
2012 :month-end 1 :day-end 1 :hour-end 0 :minute-end 2))
:duration "0:01"))
0001-lisp-org-clock.el-org-clock-sum-Rewrite-using-elemen.patch
Description: Text Data
0002-malformed-clock-tests.patch
Description: Text Data