diff options
| author | Richard M. Stallman | 1999-01-15 03:21:44 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-01-15 03:21:44 +0000 |
| commit | bec64ef6b86b331a7c074681508da95779006c44 (patch) | |
| tree | e9b347f524c2ad17b65b6ddaa1cc906f8725d8ee | |
| parent | 820cd5291fa53b68dfa6f9f203f8884283c92a36 (diff) | |
| download | emacs-bec64ef6b86b331a7c074681508da95779006c44.tar.gz emacs-bec64ef6b86b331a7c074681508da95779006c44.zip | |
(easy-menu-get-map): Fix bugs in prev change.
| -rw-r--r-- | lisp/emacs-lisp/easymenu.el | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 04c4a94e5d6..a8a50db923e 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el | |||
| @@ -479,14 +479,17 @@ NAME should be a string, the name of the element to be removed." | |||
| 479 | ;; Return a sparse keymap in which to add or remove an item. | 479 | ;; Return a sparse keymap in which to add or remove an item. |
| 480 | ;; MAP and PATH are as defined in `easy-menu-add-item'. | 480 | ;; MAP and PATH are as defined in `easy-menu-add-item'. |
| 481 | (if (null map) | 481 | (if (null map) |
| 482 | (setq map (or (lookup-key (current-local-map) | 482 | (let ((local (lookup-key (current-local-map) |
| 483 | (vconcat '(menu-bar) (mapcar 'intern path))) | 483 | (vconcat '(menu-bar) (mapcar 'intern path)))) |
| 484 | (lookup-key global-map | 484 | (global (lookup-key global-map |
| 485 | (vconcat '(menu-bar) (mapcar 'intern path))) | 485 | (vconcat '(menu-bar) (mapcar 'intern path))))) |
| 486 | (let ((new (make-sparse-keymap))) | 486 | (if (and local (not (integerp local))) |
| 487 | (define-key (current-local-map) | 487 | (setq map local) |
| 488 | (vconcat '(menu-bar) (mapcar 'intern path)) new) | 488 | (if (and global (not (integerp global))) |
| 489 | new))) | 489 | (setq map global) |
| 490 | (setq map (make-sparse-keymap)) | ||
| 491 | (define-key (current-local-map) | ||
| 492 | (vconcat '(menu-bar) (mapcar 'intern path)) map)))) | ||
| 490 | (if (and (symbolp map) (not (keymapp map))) | 493 | (if (and (symbolp map) (not (keymapp map))) |
| 491 | (setq map (symbol-value map))) | 494 | (setq map (symbol-value map))) |
| 492 | (if path (setq map (lookup-key map (vconcat (mapcar 'intern path)))))) | 495 | (if path (setq map (lookup-key map (vconcat (mapcar 'intern path)))))) |