Re: Querying cached parse trees without opening files

2025-06-08 Thread Ihor Radchenko
Kristoffer Balintona writes: > Is there a necessity for org-element’s cache to be sparse? Is it mostly > to avoid having to parse entire buffers (or at least large chunks of > them) when they change? When I first heard about org’s caching, I had > the (extremely) naive question of what technical

Re: Querying cached parse trees without opening files

2025-06-08 Thread Kristoffer Balintona
On Sun, Jun 08 2025, Ihor Radchenko wrote: > "Martin Edström" writes: > >> I'll conclude a yes on the feasibility analysis. I do wonder if it'd >> make sense for Org itself to have such an API (think a thin wrapper >> around org-element-parse-buffer results), because then org-agenda / >> org-ql

Re: Querying cached parse trees without opening files

2025-06-08 Thread Ihor Radchenko
"Martin Edström" writes: > I'll conclude a yes on the feasibility analysis. I do wonder if it'd > make sense for Org itself to have such an API (think a thin wrapper > around org-element-parse-buffer results), because then org-agenda / > org-ql / etc could be rewritten to make use of it, solving

Re: Querying cached parse trees without opening files

2025-05-28 Thread Martin Edström
Yeah, pretty much! Thanks for the example. As for control sum, perhaps file and directory mtimes would be sufficient. >From experience, something like (secure-hash 'sha1) takes whole seconds to do on all my files, which would reduce the frequency of times you can check for changes if you don't

Re: Querying cached parse trees without opening files

2025-05-27 Thread chris
On Tuesday, 27 May 2025 18:44:19 UTC Martin Edström wrote: > Well-explained! Thank you, Kristoffer :) > > On Mon, 26 May 2025 16:02:30 -0500, Kristoffer Balintona wrote: > > On Mon, May 26, 2025 at 12:02 PM chris wrote: > > > Org-node seems very interesting! I noticed that your > > > [parser.el

Re: Querying cached parse trees without opening files

2025-05-27 Thread Martin Edström
Well-explained! Thank you, Kristoffer :) On Mon, 26 May 2025 16:02:30 -0500, Kristoffer Balintona wrote: > On Mon, May 26, 2025 at 12:02 PM chris wrote: > > > Org-node seems very interesting! I noticed that your [parser.el](https:// > > github.com/meedstrom/org-mem/blob/main/org-mem-parser.el

Re: Querying cached parse trees without opening files

2025-05-26 Thread Kristoffer Balintona
On Mon, May 26, 2025 at 12:02 PM chris wrote: > Org-node seems very interesting! I noticed that your [parser.el](https:// > github.com/meedstrom/org-mem/blob/main/org-mem-parser.el) is only about 600 > lines long, whereas Org-mode’s parser seems larger and possibly more > scattered? Are they roug

Re: Querying cached parse trees without opening files

2025-05-26 Thread chris
On Friday, 23 May 2025 16:48:08 UTC Martin Edström wrote: > Hi > > I've made the package org-mem (https://github.com/meedstrom/org-mem), which > has its own parser. Org-node seems very interesting! I noticed that your [parser.el](https:// github.com/meedstrom/org-mem/blob/main/org-mem-parser.el)

Re: Querying cached parse trees without opening files

2025-05-25 Thread Martin Edström
My takeaways from a conversation with Ihor - Well, Org's own automatic cache (`org-element-cache-persistent`) is sparse, so it will not be useful directly. - But the output of running `(org-element-parse-buffer)` in a given file could be written somewhere, via org-persist perhaps, and then I co

Querying cached parse trees without opening files

2025-05-23 Thread Martin Edström
Hi I've made the package org-mem (https://github.com/meedstrom/org-mem), which has its own parser. I'm wondering if it would be possible to write something similar to use Org's own parse trees instead, since it does seem able to persist cache to disk. Here's what I envision: - Let's say at in