From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Tobias C. Rittweiler" Newsgroups: gmane.emacs.bugs Subject: bug#2499: 23.0.91; syntax-ppss / beginning-of-defun not saving match data Date: Tue, 03 Mar 2009 21:50:45 +0100 Message-ID: <87ljrms53u.fsf@freebits.de> References: <87myc7ga2r.fsf@freebits.de> <87tz6efqkx.fsf@freebits.de> Reply-To: "Tobias C. Rittweiler" , 2499@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1236115438 17949 80.91.229.12 (3 Mar 2009 21:23:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Mar 2009 21:23:58 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 03 22:25:15 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lec6y-0002D5-TO for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Mar 2009 22:25:13 +0100 Original-Received: from localhost ([127.0.0.1]:54121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lec5d-0002GF-LH for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Mar 2009 16:23:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lec5X-0002Ck-Pg for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2009 16:23:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lec5W-00028i-13 for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2009 16:23:43 -0500 Original-Received: from [199.232.76.173] (port=35113 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lec5V-00028N-P7 for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2009 16:23:41 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60634) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lec5V-00022s-Aj for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2009 16:23:41 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n23LNdOZ026781; Tue, 3 Mar 2009 13:23:39 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n23LA4d9022852; Tue, 3 Mar 2009 13:10:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Tobias C. Rittweiler" Original-Sender: news Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 03 Mar 2009 21:10:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2499 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123611401720603 (code B ref -1); Tue, 03 Mar 2009 21:10:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 3 Mar 2009 21:00:17 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n23L0BOa020321 for ; Tue, 3 Mar 2009 13:00:13 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lebik-0000Gk-R2 for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2009 16:00:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lebig-0000DL-OW for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2009 16:00:08 -0500 Original-Received: from [199.232.76.173] (port=53378 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lebig-0000DH-Gk for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2009 16:00:06 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:51260 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lebif-0006gS-RP for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2009 16:00:06 -0500 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1Lebid-0004xE-2y for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2009 21:00:03 +0000 Original-Received: from host145.natpool.mwn.de ([138.246.7.145]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 03 Mar 2009 21:00:03 +0000 Original-Received: from tcr by host145.natpool.mwn.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 03 Mar 2009 21:00:03 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 46 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host145.natpool.mwn.de User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:TZKX3xSDfFCWnPe1btqBN+an6mA= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 03 Mar 2009 16:23:43 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:25949 Archived-At: --=-=-= Stefan Monnier writes: > > > > (i) `beginning-of-defun' is allowed to not save match data. If so, > > > > please document it. > > > > > > 99.9% of the functions are allowed to not save match data. > > > > Oh, I didn't know that! I thought the policy was the other way > > around. (Perhaps 34.6, The Match Data, should make this policy more > > explicit. If so, and you say so, I'll prepare a patch.) > > Patch welcome. Attached. -T. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=match-data-lispref.diff Index: doc/lispref/searching.texi =================================================================== RCS file: /sources/emacs/emacs/doc/lispref/searching.texi,v retrieving revision 1.11 diff -u -r1.11 searching.texi --- doc/lispref/searching.texi 8 Jan 2009 05:29:01 -0000 1.11 +++ doc/lispref/searching.texi 3 Mar 2009 20:48:30 -0000 @@ -1204,6 +1204,12 @@ can't avoid another intervening search, you must save and restore the match data around it, to prevent it from being overwritten. + Notice that all functions are allowed to overwrite the match data +unless they're explicitly documented not to do so. A consequence is that +functions that are run implictly in the background (@pxref{Timers}, and +@ref{Idle Timers}) should likely save and restore the match data +explicitly. + @menu * Replacing Match:: Replacing a substring that was matched. * Simple Match Data:: Accessing single items of match data, --=-=-=--