I guess org-element-context and (org-element-at-point) also do this too (or at least once did), because I have code that wraps them in save-match data with notes to my self that match-data changes. 

There are other things that unexpectedly do this, like split-string I think (again based on code using this that is wrapped in save-match-data).


John

-----------------------------------
Professor John Kitchin 
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803


On Mon, Feb 17, 2020 at 6:20 PM D <d.williams@posteo.net> wrote:
Hi,

it seems a few functions meant to expose org internals to programmers
seem to cause undocumented side effects.  A particular example being
org-entry-properties.  When called, it changes the match-data.  This can
cause issues in cases where leaking match-data can cause font-lock to
behave inconsistently or throw errors.  I think it would be a good idea
to add a prominent warning to such interfacing functions, or document it
somewhere in the module.

The same is true for org-element-lineage, but I am not so sure whether
it is intended for hacking purposes as much as org-entry-properties.
Sadly, I have no overview over the scope of this issue, so I do not know
whether my suggestion is unrealistic (for example, because it would mean
adding warnings practically everywhere).

Regards,

D.