GNU bug report logs -
#13576
24.2.92; [PATCH] a bug in imenu--truncate-items
Previous Next
Reported by: Leo Liu <sdl.web <at> gmail.com>
Date: Mon, 28 Jan 2013 15:16:01 UTC
Severity: normal
Tags: patch
Found in version 24.2.92
Done: Leo Liu <sdl.web <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 13576 <at> debbugs.gnu.org (full text, mbox):
On 2013-01-29 10:25 +0800, Stefan Monnier wrote:
> Looks right, please install it in trunk,
I'll install something along these lines which also truncate the
car of a sub-alist.
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 80dacf93..1d721659 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -555,16 +555,14 @@ (defun imenu--split-submenus (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.
This bug report was last modified 12 years and 117 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.