;;; which-func.el --- print current function in mode line
-;; Copyright (C) 1994, 1997, 1998, 2001, 2002, 2003, 2004, 2005, 2006
-;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1997-1998, 2001-2011 Free Software Foundation, Inc.
;; Author: Alex Rezinsky <alexr@msil.sps.mot.com>
;; (doesn't seem to be responsive any more)
(setq imenu--index-alist
(save-excursion (funcall imenu-create-index-function))))
(error
- (message "which-func-ff-hook error: %S" err)
+ (unless (equal err '(error "This buffer cannot use `imenu-default-create-index-function'"))
+ (message "which-func-ff-hook error: %S" err))
(setq which-func-mode nil))))
(defun which-func-update ()
(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.
(reverse (cons (car pair) namestack))))))))))))
;; 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
(provide 'which-func)
-;; arch-tag: fa8a55c7-bfe3-4ffc-95ab-01bf21796827
;;; which-func.el ends here