[Top][All Lists]

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

Re: save-match-data woes

From: Juanma Barranquero
Subject: Re: save-match-data woes
Date: Mon, 25 Feb 2002 09:10:03 +0100

On Fri, 22 Feb 2002 11:43:03 -0500, "Stefan Monnier" 
<monnier+gnu/address@hidden> wrote:

> I think this is a wrong approach.  The match-data need only be saved
> in a few particular circumstances and I'd rather handle those cases
> in a special way.

Well, I'm not so sure about the "few particular circumstances". I think
is bad for a function to arbitrarily change the match data and not
saving it and not even documenting that it does modify it. That's bound
to cause trouble somewhere far away, where perhaps the trouble won't be
so easily connected with match data. I have no hard data, but my gut
feeling is that you will end saving/restoring match-data in many places
just to protect you against the relatively few functions that do not do
that now. What if one of your elisp modules is safely using a function
in another module and its maintainer just modifies slightly the
implementation, using now pp-to-string where he didn't before? Probably
you weren't saving match data because you didn't see the reason... and I
fail to see *why* you should have any reason now. It is not you who
changed anything.

> For ielm, the problem is that the user might invoke any random command
> between two inputs, so fixing M-p and M-n is not enough.

You're right. In the case of ielm.el, your fix is much better than mine.

(Unrelated:) On the matter of ielm, is there any objection to my patch
of a few days back that makes ielm-prompt customizable and read-only?


reply via email to

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