Kristoffer Balintona <[email protected]> writes: > I believe I have encountered a bug with `org-element-interpret-data`. > Below is a simple case that demonstrates the misbehavior I observe. > > Given an org buffer will just the following plain list: > + foo > 1) bar > when I call `(org-element-interpret-data (org-element-parse-buffer))`, I > expect the returned string to be identical to the contents of the > buffer, since to my understanding `org-element-interpret-data` is the > reciprocal of `org-element-parse-buffer`.
This expectation is not correct. `org-element-interpret-data' loses certain information along the way and normalizes keywords. For example, indentation is not retained and keywords are downcased. In your case, lists are renumbered and normalized to use consistent standard bullets. > Instead, the returned string is this: > - foo > 1. bar > As is seen, the bullet points in the plain list are changed. It seems > that all non-numbered bullet points are set to the "-" bullet point and > all numbered bullet points are changed to "1."-style bullet points. This > is true regardless of how large and how many levels the plain list is. This is expected and intentional. Not a bug. Canceled. We can discuss whether parsing/printing loop should truly retain the buffer contents byte-to-byte, but such feature would require major changes in the parser and interpreter. It is not just about lists. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
