From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: (require 'cus-load) clobbers match-data Date: Tue, 16 Feb 2010 12:25:36 -0800 (PST) Message-ID: <37521.130.55.118.19.1266351936.squirrel@webmail.lanl.gov> References: Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1266352014 28354 80.91.229.12 (16 Feb 2010 20:26:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Feb 2010 20:26:54 +0000 (UTC) Cc: Geoff Gole , emacs-devel@gnu.org To: "Glenn Morris" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 16 21:26:51 2010 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.69) (envelope-from ) id 1NhU0Q-0001PC-LK for ged-emacs-devel@m.gmane.org; Tue, 16 Feb 2010 21:26:50 +0100 Original-Received: from localhost ([127.0.0.1]:35065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhU0Q-0004Qc-36 for ged-emacs-devel@m.gmane.org; Tue, 16 Feb 2010 15:26:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NhTzM-0003Ac-Cx for emacs-devel@gnu.org; Tue, 16 Feb 2010 15:25:44 -0500 Original-Received: from [140.186.70.92] (port=53393 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhTzL-00039c-DQ for emacs-devel@gnu.org; Tue, 16 Feb 2010 15:25:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NhTzK-0005o6-Qh for emacs-devel@gnu.org; Tue, 16 Feb 2010 15:25:43 -0500 Original-Received: from proofpoint1.lanl.gov ([204.121.3.25]:49228) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NhTzH-0005nf-Pe; Tue, 16 Feb 2010 15:25:40 -0500 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by proofpoint1.lanl.gov (8.14.3/8.14.3) with ESMTP id o1GKPbw0021581; Tue, 16 Feb 2010 13:25:37 -0700 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 77E1C24106B; Tue, 16 Feb 2010 13:25:37 -0700 (MST) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay1.lanl.gov Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 4C2E524107E; Tue, 16 Feb 2010 13:25:37 -0700 (MST) Original-Received: by webmail1.lanl.gov (Postfix, from userid 48) id 48F6C1DE01E9; Tue, 16 Feb 2010 13:25:36 -0700 (MST) Original-Received: from 130.55.118.19 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Tue, 16 Feb 2010 12:25:36 -0800 (PST) In-Reply-To: User-Agent: SquirrelMail/1.4.8-5.7.lanl7 X-Priority: 3 (Normal) Importance: Normal X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2010-02-16_08:2010-02-06, 2010-02-16, 2010-02-16 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:121151 Archived-At: > In general, there should be no expectation that any operation in Emacs > will preserve the match-data (unless it explicitly says so). > >> Maybe require should save and restore the match data itself? > > This would be completely unnecessary in the vast majority of cases. > Since a require can run arbitrary code, there should be no expectation > that it preserves match-data. This may not have been the original point, but loading a library can be the result of calling an autoloaded function, even one that advertises that it preserves the match data. In that case it makes sense for `load' (or something else in that sequence) to save it; loading a file is (typically) already expensive compared to `save-match-data'. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.