From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: find-file-noselect needs save-match-data Date: Mon, 04 Jun 2007 23:17:19 +0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1180970260 10170 80.91.229.12 (4 Jun 2007 15:17:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Jun 2007 15:17:40 +0000 (UTC) Cc: herberteuler@hotmail.com To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 04 17:17:38 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 1HvEJL-0007Dx-MS for ged-emacs-devel@m.gmane.org; Mon, 04 Jun 2007 17:17:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvEJL-0006UR-3u for ged-emacs-devel@m.gmane.org; Mon, 04 Jun 2007 11:17:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HvEJH-0006UM-SE for emacs-devel@gnu.org; Mon, 04 Jun 2007 11:17:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HvEJD-0006UA-9j for emacs-devel@gnu.org; Mon, 04 Jun 2007 11:17:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvEJD-0006U7-4M for emacs-devel@gnu.org; Mon, 04 Jun 2007 11:17:27 -0400 Original-Received: from bay0-omc2-s5.bay0.hotmail.com ([65.54.246.141]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HvEJC-0005kl-Nv for emacs-devel@gnu.org; Mon, 04 Jun 2007 11:17:26 -0400 Original-Received: from hotmail.com ([65.55.154.104]) by bay0-omc2-s5.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Mon, 4 Jun 2007 08:17:25 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 4 Jun 2007 08:17:25 -0700 Original-Received: from 65.55.154.123 by by143fd.bay143.hotmail.msn.com with HTTP; Mon, 04 Jun 2007 15:17:19 GMT X-Originating-IP: [222.130.207.178] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com X-OriginalArrivalTime: 04 Jun 2007 15:17:25.0476 (UTC) FILETIME=[74F69240:01C7A6BB] X-detected-kernel: Windows 2000 SP4, XP SP1+ 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:72208 Archived-At: 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)) The following patch helps understanding where is wrong: *** files.el.~1.666.2.82.~ 2007-06-04 23:06:41.000000000 -0400 --- files.el 2007-06-04 23:07:29.000000000 -0400 *************** *** 1422,1427 **** --- 1422,1428 ---- and visit all the matching files. When wildcards are actually used and expanded, return a list of buffers that are visiting the various files." + (save-match-data (setq filename (abbreviate-file-name (expand-file-name filename))) *************** *** 1593,1599 **** (setq buf (create-file-buffer filename)) ;; find-file-noselect-1 may use a different buffer. (find-file-noselect-1 buf filename nowarn ! rawfile truename number)))))) (defun find-file-noselect-1 (buf filename nowarn rawfile truename number) (let (error) --- 1594,1600 ---- (setq buf (create-file-buffer filename)) ;; find-file-noselect-1 may use a different buffer. (find-file-noselect-1 buf filename nowarn ! rawfile truename number))))))) (defun find-file-noselect-1 (buf filename nowarn rawfile truename number) (let (error) To make the patch short, many lines that should be re-indented are left as they were. Regards, Guanpeng Xu _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/