diff options
| author | Richard M. Stallman | 1995-02-22 01:31:14 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-02-22 01:31:14 +0000 |
| commit | 4818d2106310dbeaf1aab5ca2668e3d3ca5ab3a5 (patch) | |
| tree | 45534fe6f39f00a4e242f1d9695338f488c2cae5 | |
| parent | 909149386e5118fc29eb45769ff7f63dad19f360 (diff) | |
| download | emacs-4818d2106310dbeaf1aab5ca2668e3d3ca5ab3a5.tar.gz emacs-4818d2106310dbeaf1aab5ca2668e3d3ca5ab3a5.zip | |
(imenu--cleanup): Set alist to its default just once, at the beginning.
Don't recurse on a cdr which is nil.
| -rw-r--r-- | lisp/imenu.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/imenu.el b/lisp/imenu.el index aa4dd433dbe..f35116d840c 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -488,16 +488,18 @@ or 'imenu-create-index-function") | |||
| 488 | ;; Sets the markers in imenu--index-alist | 488 | ;; Sets the markers in imenu--index-alist |
| 489 | ;; point nowhere. | 489 | ;; point nowhere. |
| 490 | ;; if alist is provided use that list. | 490 | ;; if alist is provided use that list. |
| 491 | (and imenu--index-alist | 491 | (or alist |
| 492 | (setq alist imenu--index-alist)) | ||
| 493 | (and alist | ||
| 492 | (mapcar | 494 | (mapcar |
| 493 | (function | 495 | (function |
| 494 | (lambda (item) | 496 | (lambda (item) |
| 495 | (cond | 497 | (cond |
| 496 | ((markerp (cdr item)) | 498 | ((markerp (cdr item)) |
| 497 | (set-marker (cdr item) nil)) | 499 | (set-marker (cdr item) nil)) |
| 498 | ((listp (cdr item)) | 500 | ((consp (cdr item)) |
| 499 | (imenu--cleanup (cdr item)))))) | 501 | (imenu--cleanup (cdr item)))))) |
| 500 | (if alist alist imenu--index-alist)) | 502 | alist) |
| 501 | t)) | 503 | t)) |
| 502 | 504 | ||
| 503 | (defun imenu-default-create-index-function () | 505 | (defun imenu-default-create-index-function () |