diff options
| author | Leo Liu | 2013-01-31 01:57:54 +0800 |
|---|---|---|
| committer | Leo Liu | 2013-01-31 01:57:54 +0800 |
| commit | dd331297c1c7bc37ebd865a4196a4f41e9555f83 (patch) | |
| tree | 470aaba19d5d68f3c92f629a53fc14d119721c0a | |
| parent | 741d511359a7862a6f7c65da9e2952a1cc8cd92b (diff) | |
| download | emacs-dd331297c1c7bc37ebd865a4196a4f41e9555f83.tar.gz emacs-dd331297c1c7bc37ebd865a4196a4f41e9555f83.zip | |
* lisp/imenu.el (imenu--truncate-items): Fix subalist checking.
Fixes: debbugs:13576
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/imenu.el | 18 |
2 files changed, 13 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e46e66651ca..31580a50b02 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-01-30 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * imenu.el (imenu--truncate-items): Fix subalist checking. | ||
| 4 | (Bug#13576) | ||
| 5 | |||
| 1 | 2013-01-30 Glenn Morris <rgm@gnu.org> | 6 | 2013-01-30 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * mouse.el (mouse-drag-line): Avoid pushing same event onto | 8 | * mouse.el (mouse-drag-line): Avoid pushing same event onto |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 435d97fcdb4..80fc441c896 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -555,16 +555,14 @@ NOT share structure with ALIST." | |||
| 555 | 555 | ||
| 556 | (defun imenu--truncate-items (menulist) | 556 | (defun imenu--truncate-items (menulist) |
| 557 | "Truncate all strings in MENULIST to `imenu-max-item-length'." | 557 | "Truncate all strings in MENULIST to `imenu-max-item-length'." |
| 558 | (mapcar (lambda (item) | 558 | (mapc (lambda (item) |
| 559 | (cond | 559 | ;; truncate if necessary |
| 560 | ((consp (cdr item)) | 560 | (when (and (numberp imenu-max-item-length) |
| 561 | (imenu--truncate-items (cdr item))) | 561 | (> (length (car item)) imenu-max-item-length)) |
| 562 | ;; truncate if necessary | 562 | (setcar item (substring (car item) 0 imenu-max-item-length))) |
| 563 | ((and (numberp imenu-max-item-length) | 563 | (when (imenu--subalist-p item) |
| 564 | (> (length (car item)) imenu-max-item-length)) | 564 | (imenu--truncate-items (cdr item)))) |
| 565 | (setcar item (substring (car item) 0 imenu-max-item-length))))) | 565 | menulist)) |
| 566 | menulist)) | ||
| 567 | |||
| 568 | 566 | ||
| 569 | (defun imenu--make-index-alist (&optional noerror) | 567 | (defun imenu--make-index-alist (&optional noerror) |
| 570 | "Create an index alist for the definitions in the current buffer. | 568 | "Create an index alist for the definitions in the current buffer. |