From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ralph Schleicher Newsgroups: gmane.emacs.bugs Subject: bug#8260: which-function fails to find current function name Date: Tue, 15 Mar 2011 21:11:21 +0100 Organization: Ralph Schleicher Message-ID: <8739mojg9i.fsf@bravo.mueller-schleicher.i> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1300221453 21712 80.91.229.12 (15 Mar 2011 20:37:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 Mar 2011 20:37:33 +0000 (UTC) To: 8260@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 15 21:37:29 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Pzazg-0000SS-JC for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Mar 2011 21:37:28 +0100 Original-Received: from localhost ([127.0.0.1]:40082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pzazf-00071Y-Tv for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Mar 2011 16:37:28 -0400 Original-Received: from [140.186.70.92] (port=40330 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzazK-0006qG-Sw for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2011 16:37:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzazJ-0005nE-N3 for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2011 16:37:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzazJ-0005n8-L8 for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2011 16:37:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Pzacz-0002AV-Uv; Tue, 15 Mar 2011 16:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ralph Schleicher Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Mar 2011 20:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13002200028277 (code B ref -1); Tue, 15 Mar 2011 20:14:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Mar 2011 20:13:22 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzacL-00029S-IJ for submit@debbugs.gnu.org; Tue, 15 Mar 2011 16:13:22 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pzaab-000262-Lx for submit@debbugs.gnu.org; Tue, 15 Mar 2011 16:11:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzaaV-00080r-GB for submit@debbugs.gnu.org; Tue, 15 Mar 2011 16:11:28 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:42850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzaaV-00080m-EE for submit@debbugs.gnu.org; Tue, 15 Mar 2011 16:11:27 -0400 Original-Received: from [140.186.70.92] (port=61000 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzaaT-0005fo-Dx for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2011 16:11:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzaaS-00080C-5x for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2011 16:11:25 -0400 Original-Received: from dd24230.kasserver.com ([85.13.143.176]:52072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzaaR-000804-Un for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2011 16:11:24 -0400 Original-Received: from bravo.mueller-schleicher.de (p57ADB606.dip.t-dialin.net [87.173.182.6]) by dd24230.kasserver.com (Postfix) with ESMTPA id 489554A80AF for ; Tue, 15 Mar 2011 21:11:22 +0100 (CET) Original-Received: by bravo.mueller-schleicher.de (Postfix, from userid 1000) id B03705C251; Tue, 15 Mar 2011 21:11:21 +0100 (CET) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Tue, 15 Mar 2011 16:13:19 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 15 Mar 2011 16:14:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45057 Archived-At: Hi, which-function fails to find the current function name if a major mode adjusts add-log-current-defun-header-regexp but does not bind add-log-current-defun-function. Thus, which-function shall call add-log-current-defun to query the current function name. Below is a patch together with a change log entry. 2011-03-11 Ralph Schleicher * progmodes/which-func.el (which-function): Call add-log-current-defun instead of evaluating add-log-current-defun-function directly. --- emacs-23.3/lisp/progmodes/which-func.el.orig 2011-01-08 12:45:14 +0100 +++ emacs-23.3/lisp/progmodes/which-func.el 2011-03-11 11:41:04 +0100 @@ -270,7 +270,7 @@ (defun which-function () "Return current function name based on point. Uses `which-func-functions', `imenu--index-alist' -or `add-log-current-defun-function'. +or `add-log-current-defun'. If no function name is found, return nil." (let ((name ;; Try the `which-func-functions' functions first. @@ -319,9 +319,8 @@ imstack (cdr imstack)))))) ;; Try using add-log support. - (when (and (null name) (boundp 'add-log-current-defun-function) - add-log-current-defun-function) - (setq name (funcall add-log-current-defun-function))) + (when (null name) + (setq name (add-log-current-defun))) ;; Filter the name if requested. (when name (if which-func-cleanup-function -- Ralph