* lisp/imenu.el (imenu-update-menubar): No longer accept a list of length 1 as
being sufficient evidence for a nested list structure. Instead, additionally
check whether or not certain elements are atoms.
(setq index-alist (imenu--split-submenus index-alist))
(let* ((menu (imenu--split-menu index-alist
(buffer-name)))
- (menu1 (imenu--create-keymap (car menu)
- (cdr (if (< 1 (length (cdr menu)))
- menu
- (car (cdr menu))))
- 'imenu--menubar-select)))
+ (menu1 (imenu--create-keymap
+ (car menu)
+ (cdr (if (or (< 1 (length (cdr menu)))
+ ;; Have we a non-nested single entry?
+ (atom (cdadr menu))
+ (atom (cadadr menu)))
+ menu
+ (car (cdr menu))))
+ 'imenu--menubar-select)))
(setcdr imenu--menubar-keymap (cdr menu1)))))))
(defun imenu--menubar-select (item)