GNU bug report logs - #8260
which-function fails to find current function name

Previous Next

Package: emacs;

Reported by: Ralph Schleicher <rs <at> ralph-schleicher.de>

Date: Tue, 15 Mar 2011 20:14:01 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ralph Schleicher <rs <at> ralph-schleicher.de>
To: 8260 <at> debbugs.gnu.org
Subject: bug#8260: which-function fails to find current function name
Date: Tue, 15 Mar 2011 21:11:21 +0100
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  <rs <at> ralph-schleicher.de>

	* 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




This bug report was last modified 14 years and 73 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.