* lisp/imenu.el (imenu-add-to-menubar): `current-local-map' can be nil.

Reported by Noah Friedman.
This commit is contained in:
Stefan Monnier 2012-04-11 17:37:13 -04:00
parent 088be6fbd2
commit 6622e4169b
2 changed files with 5 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
* imenu.el (imenu-add-to-menubar): `current-local-map' can be nil.
Reported by Noah Friedman.
* subr.el (read-passwd): Use read-string.
2012-04-11 Lars Magne Ingebrigtsen <larsi@gnus.org>

View file

@ -963,7 +963,8 @@ See the command `imenu' for more information."
imenu-generic-expression
(not (eq imenu-create-index-function
'imenu-default-create-index-function)))
(unless (keymapp (lookup-key (current-local-map) [menu-bar index]))
(unless (and (current-local-map)
(keymapp (lookup-key (current-local-map) [menu-bar index])))
(let ((newmap (make-sparse-keymap)))
(set-keymap-parent newmap (current-local-map))
(setq imenu--last-menubar-index-alist nil)