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: convert-standard-filename on w32 does not preserve match-data? Date: Mon, 25 Dec 2006 18:19:57 -0500 Message-ID: References: <4589B680.3080606@student.lu.se> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1167088820 4844 80.91.229.10 (25 Dec 2006 23:20:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Dec 2006 23:20:20 +0000 (UTC) Cc: lennart.borgman.073@student.lu.se, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 26 00:20:18 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gyz79-0007H0-PU for ged-emacs-devel@m.gmane.org; Tue, 26 Dec 2006 00:20:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gyz79-0000L1-7r for ged-emacs-devel@m.gmane.org; Mon, 25 Dec 2006 18:20:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gyz6x-0000IV-P6 for emacs-devel@gnu.org; Mon, 25 Dec 2006 18:20:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gyz6x-0000Gt-11 for emacs-devel@gnu.org; Mon, 25 Dec 2006 18:20:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gyz6w-0000Gh-Ub for emacs-devel@gnu.org; Mon, 25 Dec 2006 18:20:02 -0500 Original-Received: from [83.228.183.142] (helo=alfajor.home) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gyz6v-0004Lq-TB; Mon, 25 Dec 2006 18:20:02 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id E78741CD5C; Mon, 25 Dec 2006 18:19:57 -0500 (EST) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Thu\, 21 Dec 2006 13\:07\:04 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) 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:64266 Archived-At: > No, I think instead that code that calls convert-standard-filename > shouldn't expect it to preserve the match-data. > It seems cleaner to me for a general subroutine, that does a job not > specifically related to searching or matching, to preserve the match > data, rather than making all its callers take care. Until now the way things have worked apparently is: any function that is not a "simple builtin" does not need to save the match data. Now what is a "simple builtin" is not clearly specified anywhere, but I wouldn't expect convert-standard-filename to be one. The main reason for limiting the number of functions that preserve the match data is that, on the one hand save-match-data is a relatively costly operation, and on the other, 99% of the uses of the match-data is immediately after a regex-match, with very few operations in-between (if any), so it's much more efficient performancewise and programmerwise to place the save-match-data at the few places where the use of the match data does not come immediately after the regexp-match, than to place around each and every function that's not obviously related to searching or matching (i.e. a majority of the functions). Stefan