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: which-function => DEFUN? Date: Mon, 10 May 2010 13:34:29 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273512890 20313 80.91.229.12 (10 May 2010 17:34:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 10 May 2010 17:34:50 +0000 (UTC) Cc: Juanma Barranquero , Emacs-Devel devel To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 10 19:34:49 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1OBWsQ-0007wr-Q4 for ged-emacs-devel@m.gmane.org; Mon, 10 May 2010 19:34:47 +0200 Original-Received: from localhost ([127.0.0.1]:40361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBWsQ-0002wo-6D for ged-emacs-devel@m.gmane.org; Mon, 10 May 2010 13:34:46 -0400 Original-Received: from [140.186.70.92] (port=42660 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBWsG-0002vj-2U for emacs-devel@gnu.org; Mon, 10 May 2010 13:34:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBWsA-00005e-SU for emacs-devel@gnu.org; Mon, 10 May 2010 13:34:35 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:16714 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBWsA-00005a-Pv for emacs-devel@gnu.org; Mon, 10 May 2010 13:34:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAGbg50tLd+Zs/2dsb2JhbACeInK9R4JZgjsEjDI X-IronPort-AV: E=Sophos;i="4.52,363,1270440000"; d="scan'208";a="63835931" Original-Received: from 75-119-230-108.dsl.teksavvy.com (HELO pastel.home) ([75.119.230.108]) by ironport2-out.pppoe.ca with ESMTP; 10 May 2010 13:34:29 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 95FFB80B1; Mon, 10 May 2010 13:34:29 -0400 (EDT) In-Reply-To: (Lennart Borgman's message of "Mon, 10 May 2010 18:05:21 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:124671 Archived-At: >> The rule for where to place a save-match-data is: >>=20 >> =A0around the code run between "looking-at" and >> =A0"match-string-no-properties". >>=20 >> In this case (as in 99% of the cases) this code is empty, so the >> save-match-data can be dropped. >>=20 >>> (add-hook 'which-func-functions 'which-func-identify-DEFUN nil t) >>=20 >> If your save-match-data were needed, which-func-functions should say >> so explicitly. > Yes, but what is the rule for WHEN to use save-match-data. I just > looked in the elisp manual and could not find anything. The "where": around the code run between "looking-at" and "match-string-no-properties". also tells you "when": just look at the code around which to place save-match-data and if it's clear that the save-match-data is not needed (as in your case), then don't bother putting it there. Stefan