(imenu-add-to-menubar): Use an ordinary menu bar submenu.
Add imenu-add-to-menubar to menu-bar-update-hook to update the submenu.
(imenu--make-index-alist): Add noerror argument.
(imenu--menubar-select): New function.
(imenu--create-keymap-1, imenu--create-keymap-2): New arg COMMANDS.
(imenu): Allow a string as arg.
(imenu-generic-c++-expression, imenu-generic-c-expression)
(imenu-generic-ada-expression, imenu-generic-texinfo-expression)
(imenu-generic-latex-expression): Vars deleted; now handled by the
major modes themselves.
(imenu--scanning-method-alist): Var deleted.
(imenu-default-create-index-function): Don't use that alist.
(imenu-auto-rescan): New variable.
(imenu-auto-rescan-maxout): New variable.
(imenu-generic-expression): Doc changes.
(imenu-generic-lisp-expression): New variable.
(imenu-generic-c-expression): New variable.
(imenu-example--generic-c++-expression): Changed the name to
imenu-generic-c++-expression.
(imenu-example--generic-texinfo-expression): Changed the name to
imenu-generic-texinfo-expression.
(imenu-example--generic-latex-expression): Changed the name to
imenu-generic-latex-expression.
(imenu--scanning-method-alist): New variable.
(imenu--split-menu): Changed it to make the title "Index menu"
instead of "Function menus".
(imenu--make-index-alist): Changed to handle auto rescan.
(imenu--create-keymap-2): New function to create a keymap.
(imenu--create-keymap-1): New function.
(imenu--in-alist): New function.
(imenu-default-create-index-function): Changed to handle
imenu--scanning-method-alist).
(imenu--generic-extract-name): Removed.
(imenu--generic-function): Rewritten to handle submenus.
(imenu--mouse-menu): Changed to handle keymaps.
(imenu-example--generic-c++-expression): New variable.
(imenu-example--generic-texinfo-expression): New variable.
(imenu-example--generic-latex-expression): New variable.
(imenu-example--create-c++-index): Deleted.
(imenu-example--function-name-regexp-c++): Deleted.
(imenu--generic-function): New function.
(imenu--generic-extract-name): New function.
(imenu-default-create-index-function): Added the generic function calls for
the provided examples.
(imenu--cleanup): New function.
(imenu-example--name-and-position): Now uses markers.
(imenu-add-to-menubar): New function to add an entry
to the menubar for the buffer's current local keymap.