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: Thu, 14 Jun 2007 14:37:42 +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 1181803080 4738 80.91.229.12 (14 Jun 2007 06:38:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2007 06:38:00 +0000 (UTC) Cc: rms@gnu.org, miles.bader@necel.com, schwab@suse.de, emacs-devel@gnu.org, juri@jurta.org, miles@gnu.org To: monnier@iro.umontreal.ca, dak@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 14 08:37:57 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 1Hyixv-00078w-44 for ged-emacs-devel@m.gmane.org; Thu, 14 Jun 2007 08:37:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hyixu-0000g9-CP for ged-emacs-devel@m.gmane.org; Thu, 14 Jun 2007 02:37:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hyixr-0000g4-7s for emacs-devel@gnu.org; Thu, 14 Jun 2007 02:37:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hyixp-0000fs-KJ for emacs-devel@gnu.org; Thu, 14 Jun 2007 02:37:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hyixp-0000fp-EY for emacs-devel@gnu.org; Thu, 14 Jun 2007 02:37:49 -0400 Original-Received: from bay0-omc3-s40.bay0.hotmail.com ([65.54.246.240]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hyixm-00080M-Iz; Thu, 14 Jun 2007 02:37:46 -0400 Original-Received: from hotmail.com ([65.55.154.110]) by bay0-omc3-s40.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Wed, 13 Jun 2007 23:37:45 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 13 Jun 2007 23:37:44 -0700 Original-Received: from 65.55.154.123 by by143fd.bay143.hotmail.msn.com with HTTP; Thu, 14 Jun 2007 06:37:42 GMT X-Originating-IP: [216.145.54.158] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: X-OriginalArrivalTime: 14 Jun 2007 06:37:44.0667 (UTC) FILETIME=[83E232B0:01C7AE4E] 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:72830 Archived-At: >So I don't see current usage as problematic w.r.t efficiency. >The only real problem with it is that people tend to not know/understand it >and are thus tempted to complain that most functions need to be wrapped in >save-match-data, which then leads to long discussions such as this one. >Maybe we should make the convention more prominent by adding it to the >docstring of save-match-data? This is probably true. I found this strange behavior when I studied the previous SKIP_SYNTAX_BACKWARD patch. I grep'ed to get all the places that invoke SKIP_SYNTAX_BACKWARD, and looked at them one by one. Several are in regex.c. I wrote many expressions in the *scratch* buffer and evaluated them with C-x C-e sequentially to make sure all the places in regex.c get called. When I evaluated the three expressions in the beginning of this thread, I got wrong results and started not to understand it. Starting Emacs with -Q, I found the result is correct. So I knew it's something wrong with my configuration. Finally, I knew it's in type-break, and then I knew the problem is caused by `find-file-noselect' which is put on `post-command-hook' and changes the match data. I missed something, at least the efficiency. And the operations above is truely rare: I don't think people would do that often too. If in most cases such a wrong result will not happen, it is then not a problem for common usage. Unless some mode makes the wrong cases common, it is safe to ignore it. However, this is surely a shortcoming of Emacs. Regards, Guanpeng Xu _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/