bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14281: 24.3; replace-match leaves point at wrong place


From: Stefan Monnier
Subject: bug#14281: 24.3; replace-match leaves point at wrong place
Date: Fri, 10 May 2013 16:56:31 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> Maybe we could add code that saves just the (match-beginning 0) and
>> signals an error if it was not properly preserved.  This would still
>> require change-functions to save the match-data if they use it, but it
>> might catch the offenders earlier.
> I made a crack at it.

Cool.

> It was necessary to use save-match-data in a couple of around advices
> and disable undo-tree to get some basic commands to work.  I imagine
> there would be more cases to resolve.

Can you show us the offenders?

> Are the changes in the .diff what you had in mind roughly?

Pretty much, yes (tho with spaces before open parens, staying with 80
columns, and maybe not using match_limit since it seems like it can
signal errors in corner cases).  Also I wouldn't bother defining a new
kind of error: it should always correspond to a coding mistake, so not
something which you might like to catch in a condition-case.

If there are "many offenders" (as you saw) or in case (worse) there are
legitimate cases where the test signals an error, we could introduce
a debug-match-data variable so only masochists help us debug.


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]