diff options
| -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)) |