emacs-devel
[Top][All Lists]
Advanced

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

Re: find-file-noselect needs save-match-data


From: martin rudalics
Subject: Re: find-file-noselect needs save-match-data
Date: Tue, 05 Jun 2007 07:52:05 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> I just got a possibly wrong idea today morning.  The error happens in
> the case that some command, which changes the match data, is added
> into a hook.  When the hook is executed, the match data is also
> changed.  Now, if we could assume that _hooks shall not change the
> match data_, we can save and restore the match data automatically when
> we run hooks.  I am not sure about this assumption, though.

`save-match-data' is not cheap.  I suppose it's not advisable to
automatically wrap every hook into it.

> Adding `save-match-data' to functions one by one works, but it is
> difficult to check all of the functions, and it is not the overall
> solution.

I think that `find-file-noselect' and `file-truename' should not change
match-data regardless of whether they run in a hook or not (though a
number of hooks should probably not run `find-file-noselect' in the
first place).





reply via email to

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