[Top][All Lists]

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

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

From: Herbert Euler
Subject: Re: find-file-noselect needs save-match-data
Date: Sun, 10 Jun 2007 08:11:47 +0800

Since most applications do not use the match data in practice, I think
if an application use the match data, it should require it explicitly.
I.e., please take a look at the following:

   ;; Normal applications (no use of match data).
   (if (string-match "foo" bar)
       ;; True branch.
     ;; False branch.)

   ;; Applications that use match-data.
   (if (string-match "foo" bar)
       (with-match-data (match-data)
         ;; True branch.)
     ;; No need to use `with-match-data' here, since there is no
     ;; match data.
     ;; False branch.)

And of course functions like `string-match' do not set match data
by default, as if `inhibit-match-data' is turned on by default.

Guanpeng Xu

Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

reply via email to

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