From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: (require 'cus-load) clobbers match-data Date: Tue, 16 Feb 2010 15:13:40 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1266351232 25696 80.91.229.12 (16 Feb 2010 20:13:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Feb 2010 20:13:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Geoff Gole Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 16 21:13:49 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 1NhTnn-0001Rg-Ry for ged-emacs-devel@m.gmane.org; Tue, 16 Feb 2010 21:13:48 +0100 Original-Received: from localhost ([127.0.0.1]:42542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhTnn-0005wa-7z for ged-emacs-devel@m.gmane.org; Tue, 16 Feb 2010 15:13:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NhTni-0005vt-UO for emacs-devel@gnu.org; Tue, 16 Feb 2010 15:13:42 -0500 Original-Received: from [199.232.76.173] (port=35125 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhTni-0005ve-MD for emacs-devel@gnu.org; Tue, 16 Feb 2010 15:13:42 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NhTnh-0006Ai-MJ for emacs-devel@gnu.org; Tue, 16 Feb 2010 15:13:42 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:35412) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NhTnh-0006Ae-Gc for emacs-devel@gnu.org; Tue, 16 Feb 2010 15:13:41 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NhTng-0000Tn-3l; Tue, 16 Feb 2010 15:13:40 -0500 X-Spook: ammunition ISEC 2600 Magazine BLU-114/B bank e-bomb Ermes X-Ran: GY\qm~Kx>SsCbxg$:4]hHKj1;t*Mp@)f":",j=z^2Fk(<6jgwK&B/F-@YY[$)<7_'(b|*y X-Hue: magenta X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by monty-python.gnu.org: GNU/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:121150 Archived-At: Geoff Gole wrote: > While trying to puzzle out bug 5533 > , I've found that > (require 'cus-load) will stomp on match data if the file is not > already loaded: I'm not sure that 5533 can reasonably be classed as a bug. It seems a strange way to do a search-replace - what's wrong with M-x query-replace? 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. The usual answer to "why doesn't FOO preserve the match-data" is "the code calling FOO should take care to preserve the match-data if it cares about it", rather than "FOO should always preserve the match-data".