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: Thu, 14 Jun 2007 12:19:17 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181837969 4305 80.91.229.12 (14 Jun 2007 16:19:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2007 16:19:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Herbert Euler" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 14 18:19:27 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 1Hys2g-00067s-SA for ged-emacs-devel@m.gmane.org; Thu, 14 Jun 2007 18:19:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hys2g-0002hK-B8 for ged-emacs-devel@m.gmane.org; Thu, 14 Jun 2007 12:19:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hys2b-0002fr-Vr for emacs-devel@gnu.org; Thu, 14 Jun 2007 12:19:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hys2Z-0002dq-GY for emacs-devel@gnu.org; Thu, 14 Jun 2007 12:19:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hys2Z-0002dT-97 for emacs-devel@gnu.org; Thu, 14 Jun 2007 12:19:19 -0400 Original-Received: from tomts25.bellnexxia.net ([209.226.175.188] helo=tomts25-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hys2Y-0001xf-Qr for emacs-devel@gnu.org; Thu, 14 Jun 2007 12:19:19 -0400 Original-Received: from pastel.home ([70.55.143.156]) by tomts25-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070614161917.XMRY25739.tomts25-srv.bellnexxia.net@pastel.home> for ; Thu, 14 Jun 2007 12:19:17 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 676777F83; Thu, 14 Jun 2007 12:19:16 -0400 (EDT) In-Reply-To: (Herbert Euler's message of "Mon\, 04 Jun 2007 23\:17\:19 +0800") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: Solaris 8 (1) 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:72866 Archived-At: >>>>> "Herbert" == Herbert Euler writes: > If `find-file-noselect' is without `save-match-data', there will be a > bug when `type-break-mode' is turned on. To reproduce the bug, start > emacs with the -Q option and execute the following expressions: > (type-break-mode 1) > (setq s "This is a sentence") > (string-match "sen" s) > (substring s (match-beginning 0) (match-end 0)) How do you execute it? I tried M-x type-break-mode RET and then M-: (progn (setq s "This is a sentence") (string-match "sen" s) (substring s (match-beginning 0) (match-end 0))) RET and it worked just fine. I guess what you did is to use a separate M-: (or C-x C-e or M-C-x) for each line. Then the result is completely expected: there's a lot of code executed between each interactive command, so of course the match data can't be assumed to be preserved. Stefan