From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: find-file-noselect needs save-match-data Date: Wed, 13 Jun 2007 13:31:49 -0400 Message-ID: References: <46643852.6070709@gmx.at> <46665AD7.7040706@gmx.at> <87k5ueq23m.fsf@kfs-lx.testafd.dk> <87myz8c10t.fsf@jurta.org> <18030.3441.204697.244518@rgrjr.dyndns.org> <87zm3515r4.fsf@jurta.org> <85k5u8x2gm.fsf@lola.goethe.zz> <87r6og6czf.fsf@catnip.gol.com> <85bqfkx0i5.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181755924 341 80.91.229.12 (13 Jun 2007 17:32:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2007 17:32:04 +0000 (UTC) Cc: miles.bader@necel.com, schwab@suse.de, emacs-devel@gnu.org, juri@jurta.org, miles@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 13 19:32:02 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 1HyWhN-0002dt-IV for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2007 19:32:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyWhN-00025S-0r for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2007 13:32:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HyWhK-00025M-HR for emacs-devel@gnu.org; Wed, 13 Jun 2007 13:31:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HyWhI-00025A-6I for emacs-devel@gnu.org; Wed, 13 Jun 2007 13:31:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyWhH-000257-VS for emacs-devel@gnu.org; Wed, 13 Jun 2007 13:31:56 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HyWhF-00069Y-LG; Wed, 13 Jun 2007 13:31:53 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 2B6B62CF231; Wed, 13 Jun 2007 13:31:53 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 6FBA53FE0; Wed, 13 Jun 2007 13:31:49 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 527DB6C812; Wed, 13 Jun 2007 13:31:49 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Wed\, 13 Jun 2007 12\:22\:45 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: Linux 2.6 (newer, 3) 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:72786 Archived-At: > Anyway, such a function should likely _return_ the corresponding > match-data (rather than setting a global variable to it), and things > like match-beginning should optionally take an argument for this > particular match-data. > That is a good idea. If there is no match, it returns nil; if there > is a match, it returns the match data. Then what's the advantage compared to using save-match-data? This whole discussion started because people want to add save-match-data everywhere and I pointed out that it's very rarely necessary, and it can be costly (where the "it" is generating the Lisp-level match data). The suggestion to have a specialized string-match operation that preserves match-data was for performance reasons, AFAICT, like fast_c_string_match. Stefan