emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: D <d.williams@posteo.net>
Cc: org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: Documentation: Side effects of org-entry-properties and others
Date: Mon, 17 Feb 2020 19:08:03 -0500	[thread overview]
Message-ID: <CAJ51ETrG_m+JjcXDuo6cwvGJ9w5NyjXfRbuXEeuzUciy1gi5nA@mail.gmail.com> (raw)
In-Reply-To: <90aecaeb-c182-cc2e-9f31-4dc24db65af9@posteo.net>

[-- Attachment #1: Type: text/plain, Size: 1479 bytes --]

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
@johnkitchin
http://kitchingroup.cheme.cmu.edu



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.
>
>

[-- Attachment #2: Type: text/html, Size: 2162 bytes --]

  reply	other threads:[~2020-02-18  0:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 23:19 Documentation: Side effects of org-entry-properties and others D
2020-02-18  0:08 ` John Kitchin [this message]
2020-02-18  0:53 ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ51ETrG_m+JjcXDuo6cwvGJ9w5NyjXfRbuXEeuzUciy1gi5nA@mail.gmail.com \
    --to=jkitchin@andrew.cmu.edu \
    --cc=d.williams@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).