diff options
| author | Richard M. Stallman | 1994-06-29 16:28:50 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-06-29 16:28:50 +0000 |
| commit | 88153c473ed8a29eed6c21c7bbcafbcafe620f97 (patch) | |
| tree | 03cf78583125e0f7b2d3e5bf025f44c6158afb3f | |
| parent | cbb35d7d1cdf59c4d3feedfbaba44cb61563ceff (diff) | |
| download | emacs-88153c473ed8a29eed6c21c7bbcafbcafe620f97.tar.gz emacs-88153c473ed8a29eed6c21c7bbcafbcafe620f97.zip | |
(easy-menu-change): New function.
| -rw-r--r-- | lisp/emacs-lisp/easymenu.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index e853ade3ffb..e2eda651c8f 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el | |||
| @@ -104,6 +104,20 @@ is a list of menu items, as above." | |||
| 104 | (setq menu-items (cdr menu-items))) | 104 | (setq menu-items (cdr menu-items))) |
| 105 | menu)) | 105 | menu)) |
| 106 | 106 | ||
| 107 | (defun easy-menu-change (path name items) | ||
| 108 | "Change menu found at PATH as item NAME to contain ITEMS. | ||
| 109 | PATH is a list of strings for locating the menu containing NAME in the | ||
| 110 | menu bar. ITEMS is a list of menu items, as in `easy-menu-define'. | ||
| 111 | These items entirely replace the previous items in that map. | ||
| 112 | |||
| 113 | Call this from `activate-menubar-hook' to implement dynamic menus." | ||
| 114 | (let ((map (key-binding (apply 'vector | ||
| 115 | 'menu-bar | ||
| 116 | (mapcar 'intern (append path (list name))))))) | ||
| 117 | (if (keymapp map) | ||
| 118 | (setcdr map (cdr (easy-menu-create-keymaps name items))) | ||
| 119 | (error "Malformed menu in `easy-menu-change'")))) | ||
| 120 | |||
| 107 | (defmacro easy-menu-remove (menu)) | 121 | (defmacro easy-menu-remove (menu)) |
| 108 | 122 | ||
| 109 | (defmacro easy-menu-add (menu &optional map)) | 123 | (defmacro easy-menu-add (menu &optional map)) |