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: David Kastrup
Subject: Re: find-file-noselect needs save-match-data
Date: Wed, 20 Jun 2007 00:42:42 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     > If `save-match-data' was never changed, then there was no point at
>     > which a change could have broken anything, thus no issue.
>
>     I already gave an explicit Elisp example where save-match-data around
>     a passage not accessing the match data leads to different results from
>     not using save-match-data.
>
> Using markers helps avoid strange results when the code inside the
> construct edits the buffer.  I think that is a good reason for this
> feature.

It is neither documented in the Elisp manual nor in the DOC string and
is not the functionality the function is intended to provide.  It is
also inconsistent with save_search_regs in search.c which means that
the documentation in

(info "(elisp) Filter functions")

       In earlier Emacs versions, every filter function that did regular
    expression searching or matching had to explicitly save and restore the
    match data.  Now Emacs does this automatically for filter functions;
    they never need to do it explicitly.  *Note Match Data::.

is factually incorrect since the effect is different from
save-match-data.

Also, in
(info "(elisp) Saving Match Data")
we have

       Emacs automatically saves and restores the match data when it runs
    process filter functions (*note Filter Functions::) and process
    sentinels (*note Sentinels::).

Again, no mention of the different behavior of save-match-data and the
filter functions and sentinels.

And in
(info "(elisp) Sentinels")


       In earlier Emacs versions, every sentinel that did regular expression
    searching or matching had to explicitly save and restore the match data.
    Now Emacs does this automatically for sentinels; they never need to do
    it explicitly.  *Note Match Data::.

Again, no mention that save-match-data would use markers and track
insertions while sentinels don't.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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