From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: Re: find-file-noselect needs save-match-data Date: Sat, 16 Jun 2007 11:50:56 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1181965874 4476 80.91.229.12 (16 Jun 2007 03:51:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Jun 2007 03:51:14 +0000 (UTC) Cc: juri@jurta.org, schwab@suse.de, miles@gnu.org, miles.bader@necel.com, emacs-devel@gnu.org To: monnier@iro.umontreal.ca, rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 16 05:51:12 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HzPJg-0004Vq-0N for ged-emacs-devel@m.gmane.org; Sat, 16 Jun 2007 05:51:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HzPJf-0000Oz-DK for ged-emacs-devel@m.gmane.org; Fri, 15 Jun 2007 23:51:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HzPJb-0000Oc-Op for emacs-devel@gnu.org; Fri, 15 Jun 2007 23:51:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HzPJZ-0000OI-S0 for emacs-devel@gnu.org; Fri, 15 Jun 2007 23:51:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HzPJZ-0000O9-OC for emacs-devel@gnu.org; Fri, 15 Jun 2007 23:51:05 -0400 Original-Received: from bay0-omc2-s25.bay0.hotmail.com ([65.54.246.161]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HzPJV-0005gR-Tk; Fri, 15 Jun 2007 23:51:02 -0400 Original-Received: from hotmail.com ([65.55.154.104]) by bay0-omc2-s25.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Fri, 15 Jun 2007 20:51:01 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 15 Jun 2007 20:51:00 -0700 Original-Received: from 65.55.154.123 by by143fd.bay143.hotmail.msn.com with HTTP; Sat, 16 Jun 2007 03:50:56 GMT X-Originating-IP: [221.223.221.87] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: X-OriginalArrivalTime: 16 Jun 2007 03:51:00.0887 (UTC) FILETIME=[8DFE0270:01C7AFC9] X-detected-kernel: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:73042 Archived-At: >I fail to see the simplicity. All the difficulty comes from having to >think >about when to be careful about the match-data. What we currently have is a model that each call to the matching functions such as `string-match', `looking-at' etc changes the match-data. Furthermore, almost any function calls one of these functions. So with this model thinking about preserving match-data is extravagant, since after each call to almost any function, the match-data is possibly changed. This means that you can't expect the match-data is preserved even if there is only one simple invocation to some function between the positions where the matching functions are called and where the match-data is used, unless the invocation is inside a `save-match-data' form. If, for example, we add some function such as `fast-string-match', or add some variable such as `inhibit-match-data', this actually doesn't help solve the problem. Since changing match-data is possible by calling matching functions (although achieving it is a bit difficult compared with the usage now), match-data is not guaranteed not to be changed, just as before. So with the current model, the only way to preserve match-data is to use the `save-match-data' form everywhere, which is impratical. But we can't make match-data unchanged, so there seems no solution to this problem, and just as Stefan said, this is a non-problem. Regards, Guanpeng Xu _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.com/