From: Karl Heuer Date: Mon, 1 Jun 1998 03:09:43 +0000 (+0000) Subject: (which-func-ff-hook): If imenu gets error, X-Git-Tag: emacs-20.3~769 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2576f5d2700e3e18e684fc4f6e3d52c5d20d4f17;p=emacs.git (which-func-ff-hook): If imenu gets error, clear which-func-mode. --- diff --git a/lisp/which-func.el b/lisp/which-func.el index cf0e2e571dc..121ccf5a6b7 100644 --- a/lisp/which-func.el +++ b/lisp/which-func.el @@ -136,12 +136,15 @@ It creates the Imenu index for the buffer, if necessary." (setq which-func-mode which-func-mode-global) (setq which-func-mode nil)) - (if (and which-func-mode - (not (member major-mode which-func-non-auto-modes)) - (or (< buffer-saved-size which-func-maxout) - (= which-func-maxout 0))) - (setq imenu--index-alist - (save-excursion (funcall imenu-create-index-function))))) + (condition-case nil + (if (and which-func-mode + (not (member major-mode which-func-non-auto-modes)) + (or (< buffer-saved-size which-func-maxout) + (= which-func-maxout 0))) + (setq imenu--index-alist + (save-excursion (funcall imenu-create-index-function)))) + (error + (setq which-func-mode nil)))) (defun which-func-update () ;; Update the string containing the current function.