Re: `org-element-cache-map' misses elements at end of buffer

2024-04-21 Thread Ihor Radchenko
Morgan Smith writes: >> It is the time to refactor this function yet again. >> (a tricky endeavour considering all the edge cases we can encounter when >> there are changes in buffer while `org-element-cache-map' is mapping >> over it). > > See attached for a way to break :from-pos as well. I wo

Re: `org-element-cache-map' misses elements at end of buffer

2024-04-21 Thread Morgan Smith
Ihor Radchenko writes: > > Hmm. :after-element keyword logic is broken. It does not account for the > case when :after-element is past the START point. > > It is the time to refactor this function yet again. > (a tricky endeavour considering all the edge cases we can encounter when > there are ch

Re: `org-element-cache-map' misses elements at end of buffer

2024-04-21 Thread Ihor Radchenko
Morgan Smith writes: > So I found another bug in `org-element-cache-map'. > > Executing the following code just freezes up. I am struggling to work > through the logic of `org-element-cache-map'. If no-one else magically > solves my issues, I'll figure it out eventually. But I would appreciate

Re: `org-element-cache-map' misses elements at end of buffer

2024-04-19 Thread Ihor Radchenko
Morgan Smith writes: > I may or may not have been trying to rewrite `org-clock-sum' for like > the 5th time. > > Anyways I was wanting to parse a file using `org-element-cache-map' that > looked roughly like this: > > > * clock > :LOGBOOK: > CLOCK: [2024-03-24 Sun 15:18]--[2024-03-24 Sun

Re: `org-element-cache-map' misses elements at end of buffer

2024-04-19 Thread Morgan Smith
So I found another bug in `org-element-cache-map'. Executing the following code just freezes up. I am struggling to work through the logic of `org-element-cache-map'. If no-one else magically solves my issues, I'll figure it out eventually. But I would appreciate some advice on how to debug thi

`org-element-cache-map' misses elements at end of buffer

2024-04-18 Thread Morgan Smith
Hello! I may or may not have been trying to rewrite `org-clock-sum' for like the 5th time. Anyways I was wanting to parse a file using `org-element-cache-map' that looked roughly like this: * clock :LOGBOOK: CLOCK: [2024-03-24 Sun 15:18]--[2024-03-24 Sun 15:39] => 0:21 :END: === H