1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

* lisp/imenu.el (imenu--truncate-items): Fix subalist checking.

Fixes: debbugs:13576
This commit is contained in:
Leo Liu 2013-01-31 01:57:54 +08:00
parent 741d511359
commit dd331297c1
2 changed files with 13 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2013-01-30 Leo Liu <sdl.web@gmail.com>
* imenu.el (imenu--truncate-items): Fix subalist checking.
(Bug#13576)
2013-01-30 Glenn Morris <rgm@gnu.org>
* mouse.el (mouse-drag-line): Avoid pushing same event onto

View File

@ -555,16 +555,14 @@ NOT share structure with ALIST."
(defun imenu--truncate-items (menulist)
"Truncate all strings in MENULIST to `imenu-max-item-length'."
(mapcar (lambda (item)
(cond
((consp (cdr item))
(imenu--truncate-items (cdr item)))
;; truncate if necessary
((and (numberp imenu-max-item-length)
(> (length (car item)) imenu-max-item-length))
(setcar item (substring (car item) 0 imenu-max-item-length)))))
menulist))
(mapc (lambda (item)
;; truncate if necessary
(when (and (numberp imenu-max-item-length)
(> (length (car item)) imenu-max-item-length))
(setcar item (substring (car item) 0 imenu-max-item-length)))
(when (imenu--subalist-p item)
(imenu--truncate-items (cdr item))))
menulist))
(defun imenu--make-index-alist (&optional noerror)
"Create an index alist for the definitions in the current buffer.