* Emacs treatment of match-data during change hooks
@ 2013-04-29 14:36 Barry OReilly
2013-05-04 1:44 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: Barry OReilly @ 2013-04-29 14:36 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 785 bytes --]
Investigating bug 14281[1], I found this passage in the Elisp
manual[2]:
The functions you use in these [change] hooks should save and
restore the match data if they do anything that uses regular
expressions; otherwise, they will interfere in bizarre ways with
the editing operations that call them.
I suppose that caveat would pin the bug on one of the third party
packages I use. However, why couldn't Emacs save off the match-data
itself and restore it after the after-change-functions? Is there any
legit situation where a change hook would want to change the
match-data in effect after the change hook returns?
[1] https://lists.gnu.org/archive/html/bug-gnu-emacs/2013-04/msg00703.html
[2]
http://www.gnu.org/software/emacs/manual/html_node/elisp/Change-Hooks.html
[-- Attachment #2: Type: text/html, Size: 1023 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Emacs treatment of match-data during change hooks
2013-04-29 14:36 Emacs treatment of match-data during change hooks Barry OReilly
@ 2013-05-04 1:44 ` Stefan Monnier
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2013-05-04 1:44 UTC (permalink / raw)
To: Barry OReilly; +Cc: emacs-devel
> I suppose that caveat would pin the bug on one of the third party
> packages I use. However, why couldn't Emacs save off the match-data
> itself and restore it after the after-change-functions? Is there any
> legit situation where a change hook would want to change the
> match-data in effect after the change hook returns?
There are many cases where an after-change-function won't use regular
expressions at all.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-04 1:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-29 14:36 Emacs treatment of match-data during change hooks Barry OReilly
2013-05-04 1:44 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).