diff lisp/which-func.el @ 22308:87366acfb1e9

(which-func-ff-hook): If imenu gets error, clear which-func-mode.
author Karl Heuer <kwzh@gnu.org>
date Mon, 01 Jun 1998 03:09:43 +0000
parents 29c2db002dd5
children 114211878bf9
line wrap: on
line diff
--- a/lisp/which-func.el	Mon Jun 01 03:08:53 1998 +0000
+++ b/lisp/which-func.el	Mon Jun 01 03:09:43 1998 +0000
@@ -136,12 +136,15 @@
       (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.