]> git.eshelyaron.com Git - emacs.git/commitdiff
(which-func-ff-hook): If imenu gets error,
authorKarl Heuer <kwzh@gnu.org>
Mon, 1 Jun 1998 03:09:43 +0000 (03:09 +0000)
committerKarl Heuer <kwzh@gnu.org>
Mon, 1 Jun 1998 03:09:43 +0000 (03:09 +0000)
clear which-func-mode.

lisp/which-func.el

index cf0e2e571dc0b06b6297d7621ad01111e65068b0..121ccf5a6b7d760e0eda5df682e9bda58b5d1052 100644 (file)
@@ -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.