]> git.eshelyaron.com Git - emacs.git/commitdiff
(imenu--cleanup): Set alist to its default just once, at the beginning.
authorRichard M. Stallman <rms@gnu.org>
Wed, 22 Feb 1995 01:31:14 +0000 (01:31 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 22 Feb 1995 01:31:14 +0000 (01:31 +0000)
Don't recurse on a cdr which is nil.

lisp/imenu.el

index aa4dd433dbe4cb41817fe462686a77f88c92686e..f35116d840c8fce503d259402665ff5f564b96c0 100644 (file)
@@ -488,16 +488,18 @@ or 'imenu-create-index-function")
   ;; Sets the markers in imenu--index-alist 
   ;; point nowhere.
   ;; if alist is provided use that list.
-  (and imenu--index-alist
+  (or alist
+      (setq alist imenu--index-alist))
+  (and alist
        (mapcar
        (function
         (lambda (item)
           (cond
            ((markerp (cdr item))
             (set-marker (cdr item) nil))
-           ((listp (cdr item))
+           ((consp (cdr item))
             (imenu--cleanup (cdr item))))))
-       (if alist alist imenu--index-alist))
+       alist)
        t))
 
 (defun imenu-default-create-index-function ()