On 2025-10-18  15:00, Ihor Radchenko wrote:

> *** Org parser now records boundaries of verbatim contents and post-blank 
> lines
> 
> All the parser objects can now contain new standard properties:
> 
> - =:value-begin=, =:value-end= :: Boundaries of verbatim contents of
>   inside the AST node, as buffer positions.  For example, in source
>   blocks, the new properties store the boundaries of the code.
> - =:pos-before-blank= :: Position after syntax node, before all its
>   blank lines (for elements) or blank spaces after (for objects).
> 
> These 3 new AST node properties can cover all the examples you provided
> just fine. They will also be more consistent with the existing
> org-element approach (:begin/:end, :contents-begin/end).

Nice, in particular to get (in the long term) rid of the whitespace
skipping, which I found particularly annoying.

> Note that there is nothing special about skipping whitespace inside
> code/verbatim blocks. But your examples did not use that feature either.
> 
> WDYT?

I think it's rather obvious: Your APIs are simpler for sure, in
the positive sense of "simple".

However, I made the experience (to some extent backed up by the
examples I sent) that

- boundaries tend to get accessed pair-wise and

- boundaries tend to get tested for inclusion of point at the
  same time they are accessed.

`org-element-boundaries' covers both of the above.

But then people have been happily hacking at Org mode for many
years without complaining about the lack even of your simpler
APIs, so realistically my more complex API probably never will
fly...

I leave it to you, I can easily live with
`org-element-boundaries' existing in my .emacs only.  Regardless
of where `org-element-boundaries' will live, I will redo it in
terms of your new APIs as far as possible.

Thanks!


Reply via email to