[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: find-file-noselect needs save-match-data
From: |
Stefan Monnier |
Subject: |
Re: find-file-noselect needs save-match-data |
Date: |
Wed, 06 Jun 2007 08:17:39 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) |
> ... like when you put a function calling `find-file-noselect' or
> `file-truename' on a sensitive hook. You may have to look at the code
> of each function on the entire call tree to detect whether one of them
> might change match-data. Since hardly anyone ever does that we'll have
> to live with spurious, very hard-to-detect bugs clobbering match-data.
> From the caller's point of view it's also hard to conceive why, for
> example, the simpler `file-chase-links' does save match-data while the
> more complicated `file-truename' doesn't.
I'd say it's just an unexpected feature of file-chase-links that it saves
match-data. It shouldn't need to.
> Both throw away match-data immediately. If match-data is expensive why
> build it in the first place when it's not needed? Why not make a thing
> like `fast-string-match' available in Lisp?
It's not the match data that's expensive. It's the save-match-data.
The match-data is built cheaply during the call to string-match in the form
of a C data structure. It's only when `match-data' is called that it ends
up building a Lisp lisp (sometimes with markers to boot).
Stefan
- Re: find-file-noselect needs save-match-data, (continued)
Re: find-file-noselect needs save-match-data, Stefan Monnier, 2007/06/05
Re: find-file-noselect needs save-match-data, Stefan Monnier, 2007/06/06
Re: find-file-noselect needs save-match-data, Richard Stallman, 2007/06/06
Re: find-file-noselect needs save-match-data, martin rudalics, 2007/06/06
Re: find-file-noselect needs save-match-data,
Stefan Monnier <=
Re: find-file-noselect needs save-match-data, Lennart Borgman (gmail), 2007/06/06
Re: find-file-noselect needs save-match-data, martin rudalics, 2007/06/06
Re: find-file-noselect needs save-match-data, Richard Stallman, 2007/06/06
Re: find-file-noselect needs save-match-data, Stefan Monnier, 2007/06/06
Re: find-file-noselect needs save-match-data, Richard Stallman, 2007/06/08
Re: find-file-noselect needs save-match-data, Kim F. Storm, 2007/06/08
Re: find-file-noselect needs save-match-data, martin rudalics, 2007/06/08
Re: find-file-noselect needs save-match-data, Kim F. Storm, 2007/06/08
Re: find-file-noselect needs save-match-data, Richard Stallman, 2007/06/09
Re: find-file-noselect needs save-match-data, Herbert Euler, 2007/06/09