From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: find-file-noselect needs save-match-data Date: Tue, 05 Jun 2007 07:52:05 +0200 Message-ID: <4664FA05.9000609@gmx.at> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1181022750 13544 80.91.229.12 (5 Jun 2007 05:52:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Jun 2007 05:52:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Herbert Euler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 05 07:52:29 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 1HvRxv-0005Bk-8k for ged-emacs-devel@m.gmane.org; Tue, 05 Jun 2007 07:52:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvRxt-0004I1-9u for ged-emacs-devel@m.gmane.org; Tue, 05 Jun 2007 01:52:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HvRxq-0004Hm-BX for emacs-devel@gnu.org; Tue, 05 Jun 2007 01:52:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HvRxo-0004Ha-OW for emacs-devel@gnu.org; Tue, 05 Jun 2007 01:52:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvRxo-0004HX-Hy for emacs-devel@gnu.org; Tue, 05 Jun 2007 01:52:16 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HvRxm-0004jA-TI for emacs-devel@gnu.org; Tue, 05 Jun 2007 01:52:15 -0400 Original-Received: (qmail invoked by alias); 05 Jun 2007 05:52:09 -0000 Original-Received: from N767P031.adsl.highway.telekom.at (EHLO [62.47.39.223]) [62.47.39.223] by mail.gmx.net (mp048) with SMTP; 05 Jun 2007 07:52:09 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19sijUSPIxsKoDgipO9dZ2J0NleWNu3jk1/th5K2V 25uy6PjjBQ0zPu User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: 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:72262 Archived-At: > I just got a possibly wrong idea today morning. The error happens in > the case that some command, which changes the match data, is added > into a hook. When the hook is executed, the match data is also > changed. Now, if we could assume that _hooks shall not change the > match data_, we can save and restore the match data automatically when > we run hooks. I am not sure about this assumption, though. `save-match-data' is not cheap. I suppose it's not advisable to automatically wrap every hook into it. > Adding `save-match-data' to functions one by one works, but it is > difficult to check all of the functions, and it is not the overall > solution. I think that `find-file-noselect' and `file-truename' should not change match-data regardless of whether they run in a hook or not (though a number of hooks should probably not run `find-file-noselect' in the first place).