(imenu--create-keymap-2): Remove.
(imenu--create-keymap-1): Simplify, remove third argument.
(imenu--generic-function): Use dolist.
(imenu-find-default): New function.
(imenu--completion-buffer): Use it.
(imenu--mouse-menu): Use popup-menu.
(imenu--menubar-select): Return t rather than calling imenu.
(imenu--generic-function): Avoid mapcar.
(imenu--replace-spaces): Function removed.
(imenu--completion-buffer): Use subst-char-in-string.
(imenu-add-to-menubar): Use keymap inheritance.
(defgroup imenu): Add :link.
(imenu-use-markers, imenu-auto-rescan-maxout, imenu-generic-expression)
(imenu--make-index-alist, imenu-default-goto-function): Doc fixes.
(imenu-max-item-length, imenu-sort-function)
(imenu-scanning-message): Custom tweak.
(imenu-progress-message): Use real backquote syntax.
(imenu--in-alist): Unused function deleted.
(imenu--flatten-index-alist): Likewise.
(imenu-case-fold-search): Add autoload cookie.
(imenu--completion-buffer): Offer function at point as default.
(imenu--subalist-p): Don't use caadr.
(imenu): Don't use caddr.
(imenu-add-menubar-index): New function.
Truncate imenu items.
Make use of markers or integers an option.
(imenu-use-markers, imenu-max-item-length): New variables.
(imenu-max-items): Doc fix.
(imenu-example--name-and-position): Handle imenu-use-markers.
(imenu-default-create-index-function): Likewise.
(imenu--generic-function): Likewise.
(imenu--truncate-items): New function.
(imenu--make-index-alist): Call imenu--truncate-items.
(imenu--generic-function): Fixed probably a typo: named appeared
twice in an item. Put function after name and beg in a special
item because a normal item has name and beg (for orthogonality).
(imenu-add-to-menubar): First test to see if the mode supports imenu.
(imenu--menubar-select): Use the defined variable imenu-rescan-item.
(imenu-default-goto-function): New subroutine, broken out of `imenu'.
(imenu-default-goto-function): New variable.
(imenu): Made it use the above function, via that variable.
Keep subalists at top level too.
Name the split-off submenus from the first item in them.
(imenu--generic-function): Avoid adding nil as elt of the result.
(imenu--split-menu): Handle imenu-sort-function here.
(imenu--mouse-menu, imenu-update-menubar): Not here.
(imenu--mouse-menu): Rewrite second half--handle nested menus reliably.
(imenu--create-keymap-2): Include ITEM in the leaf menu-item.