[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about Org syntax
From: |
Ihor Radchenko |
Subject: |
Re: Question about Org syntax |
Date: |
Sun, 16 May 2021 16:01:07 +0800 |
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> It should be a paragraph. I'll fix it soon.
>
> Note the problem can be reproduced with only
>
> * test
> :end:
Thanks!
Also, I have few more questions (or maybe bug reports) about
syntax/parsing:
1. Does org-element--current element suppose to return (paragraph ...)
on empty buffer?
2. Some of the element parsers honour LIMIT argument partially. Part of
the parsing is typically done using looking-at (ignoring the LIMIT)
and part is honouring it. This can backfire when LIMIT is before
first characteristic line of the element. For example take headline
parser:
<point>* Example<limit> headline
:contents-begin of the parsed headline will be _after_ :end
Or even
<point><limit>* example headline
:contents-begin is equal to :begin, sometimes leading to infinite
loops in org-element--parse-to called by org-element-cache (hence,
known bug with Emacs hangs when org-element-use-cache is non-nil)
Some of the parsers potentially causing similar issues are:
In particular, org-element-footnote-definition-parser,
org-element-headline-parser, org-element-inlinetask-parser,
org-element-plain-list-parser, org-element-property-drawer-parser,
org-element-babel-call-parser, org-element-clock-parser,
org-element-comment-parser, org-element-diary-sexp-parser,
org-element-fixed-width-parser, org-element-horizontal-rule-parser,
org-element-keyword-parser, org-element-node-property-parser,
org-element-paragraph-parser, ...
3. Some of the element parsers ignore LIMIT altogether:
org-element-item-parser, org-element-section-parser...
Is there any reason behind this? I though that parsing narrowed
buffer is supposed to honour narrowing. Also, ignoring LIMIT might
cause issue when trying to parse only visible elements.
Best,
Ihor