From mboxrd@z Thu Jan 1 00:00:00 1970 From: D Subject: Documentation: Side effects of org-entry-properties and others Date: Tue, 18 Feb 2020 00:19:46 +0100 Message-ID: <90aecaeb-c182-cc2e-9f31-4dc24db65af9@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58118) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3pg8-0007pZ-Jk for emacs-orgmode@gnu.org; Mon, 17 Feb 2020 18:19:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3pg7-0004R2-84 for emacs-orgmode@gnu.org; Mon, 17 Feb 2020 18:19:52 -0500 Received: from mout02.posteo.de ([185.67.36.66]:48071) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j3pg6-0004QG-Lp for emacs-orgmode@gnu.org; Mon, 17 Feb 2020 18:19:51 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 114782400FB for ; Tue, 18 Feb 2020 00:19:47 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 48M0Lq3cgHz9rxN for ; Tue, 18 Feb 2020 00:19:47 +0100 (CET) Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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.