From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: find-file-noselect needs save-match-data Date: Fri, 15 Jun 2007 04:49:01 -0400 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1181897589 14351 80.91.229.12 (15 Jun 2007 08:53:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Jun 2007 08:53:09 +0000 (UTC) Cc: miles.bader@necel.com, schwab@suse.de, emacs-devel@gnu.org, juri@jurta.org, rudalics@gmx.at, monnier@iro.umontreal.ca, miles@gnu.org To: "Herbert Euler" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 15 10:53:06 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 1Hz7YF-0001ka-ES for ged-emacs-devel@m.gmane.org; Fri, 15 Jun 2007 10:53:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hz7YE-00019G-Or for ged-emacs-devel@m.gmane.org; Fri, 15 Jun 2007 04:53:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hz7UO-0008QP-ET for emacs-devel@gnu.org; Fri, 15 Jun 2007 04:49:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hz7UM-0008PU-Qh for emacs-devel@gnu.org; Fri, 15 Jun 2007 04:49:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hz7UM-0008PN-2q for emacs-devel@gnu.org; Fri, 15 Jun 2007 04:49:02 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hz7UL-0001l6-PF for emacs-devel@gnu.org; Fri, 15 Jun 2007 04:49:01 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1Hz7UL-0002Vb-E1; Fri, 15 Jun 2007 04:49:01 -0400 In-reply-to: (herberteuler@hotmail.com) 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:72936 Archived-At: Excuse me but just another question: as Stefan said, 99% of non-trivial functions use regexps, does it mean that these 99% non-trivial functions shall not be put on the hooks that may be run between two regexp-sensitive functions/commands unless the putter saves match-data? Or, does it mean that this type of hooks need `save-match-data'? It depends on how the hook is used. `pre-command-hook', `post-command-hook', `before-change-functions' and `after-change-functions' seem to be some of the hooks. `pre-command-hook' and `post-command-hook' are not called from many places. The principal one is the main command loop, which does not care if the match data is clobbered by the hook. Therefore, anyplace else that runs these hooks should make sure not to care either. `before-change-functions' and `after-change-functions' can be called from lots of primitives, including `insert'. It would be a horrible pain to have to worry that all these primitives might clobber the match data. Therefore, any hook functions put on these hooks must preserve the match data. That should be documented in the doc strings of those hooks and in the Lisp Ref Manual. Would someone like to do that?