Commit 4818d210 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(imenu--cleanup): Set alist to its default just once, at the beginning.

Don't recurse on a cdr which is nil.
parent 90914938
...@@ -488,16 +488,18 @@ or 'imenu-create-index-function") ...@@ -488,16 +488,18 @@ or 'imenu-create-index-function")
;; Sets the markers in imenu--index-alist ;; Sets the markers in imenu--index-alist
;; point nowhere. ;; point nowhere.
;; if alist is provided use that list. ;; if alist is provided use that list.
(and imenu--index-alist (or alist
(setq alist imenu--index-alist))
(and alist
(mapcar (mapcar
(function (function
(lambda (item) (lambda (item)
(cond (cond
((markerp (cdr item)) ((markerp (cdr item))
(set-marker (cdr item) nil)) (set-marker (cdr item) nil))
((listp (cdr item)) ((consp (cdr item))
(imenu--cleanup (cdr item)))))) (imenu--cleanup (cdr item))))))
(if alist alist imenu--index-alist)) alist)
t)) t))
(defun imenu-default-create-index-function () (defun imenu-default-create-index-function ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment