comparison lisp/imenu.el @ 20051:68621d697ee2

(imenu-add-to-menubar): If not using imenu-default-create-index-function, don't require its variables.
author Karl Heuer <kwzh@gnu.org>
date Wed, 15 Oct 1997 23:00:25 +0000
parents 720d1f98ae42
children c42156dab61b
comparison
equal deleted inserted replaced
20050:8762dec6d161 20051:68621d697ee2
900 (defun imenu-add-to-menubar (name) 900 (defun imenu-add-to-menubar (name)
901 "Adds an `imenu' entry to the menu bar for the current buffer. 901 "Adds an `imenu' entry to the menu bar for the current buffer.
902 NAME is a string used to name the menu bar item. 902 NAME is a string used to name the menu bar item.
903 See the command `imenu' for more information." 903 See the command `imenu' for more information."
904 (interactive "sImenu menu item name: ") 904 (interactive "sImenu menu item name: ")
905 (if (or (and (fboundp imenu-prev-index-position-function) 905 (if (or (not (eq imenu-create-index-function
906 'imenu-default-create-index-function))
907 (and (fboundp imenu-prev-index-position-function)
906 (fboundp imenu-extract-index-name-function)) 908 (fboundp imenu-extract-index-name-function))
907 (and imenu-generic-expression)) 909 (and imenu-generic-expression))
908 (let ((newmap (make-sparse-keymap)) 910 (let ((newmap (make-sparse-keymap))
909 (menu-bar (lookup-key (current-local-map) [menu-bar]))) 911 (menu-bar (lookup-key (current-local-map) [menu-bar])))
910 (define-key newmap [menu-bar] 912 (define-key newmap [menu-bar]