Mercurial > emacs
comparison lisp/emacs-lisp/easymenu.el @ 8085:c7eb887a1e78
(easy-menu-change): New function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 29 Jun 1994 16:28:50 +0000 |
parents | 877b3aeaa9b5 |
children | 39e8d792604f |
comparison
equal
deleted
inserted
replaced
8084:6746cdbec82b | 8085:c7eb887a1e78 |
---|---|
102 (if name | 102 (if name |
103 (define-key menu (vector (intern name)) (cons name command))))) | 103 (define-key menu (vector (intern name)) (cons name command))))) |
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)) |
110 | 124 |
111 (provide 'easymenu) | 125 (provide 'easymenu) |