Mercurial > emacs
comparison lisp/tool-bar.el @ 66512:759df5a9dc3e
(tool-bar-add-item-from-menu)
(tool-bar-local-item-from-menu): Fix doc strings.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Fri, 28 Oct 2005 21:03:35 +0000 |
parents | b9971215f644 |
children | 31f77129bc92 |
comparison
equal
deleted
inserted
replaced
66511:2712f28b75e0 | 66512:759df5a9dc3e |
---|---|
143 (define-key-after map (vector key) | 143 (define-key-after map (vector key) |
144 `(menu-item ,(symbol-name key) ,def :image ,image ,@props))))) | 144 `(menu-item ,(symbol-name key) ,def :image ,image ,@props))))) |
145 | 145 |
146 ;;;###autoload | 146 ;;;###autoload |
147 (defun tool-bar-add-item-from-menu (command icon &optional map &rest props) | 147 (defun tool-bar-add-item-from-menu (command icon &optional map &rest props) |
148 "Define tool bar binding for COMMAND using the given ICON in keymap MAP. | 148 "Define tool bar binding for COMMAND in keymap MAP using the given ICON. |
149 This makes a binding for COMMAND in `tool-bar-map', copying its | 149 This makes a binding for COMMAND in `tool-bar-map', copying its |
150 binding from the menu bar in MAP (which defaults to `global-map'), but | 150 binding from the menu bar in MAP (which defaults to `global-map'), but |
151 modifies the binding by adding an image specification for ICON. It | 151 modifies the binding by adding an image specification for ICON. It |
152 finds ICON just like `tool-bar-add-item'. PROPS are additional | 152 finds ICON just like `tool-bar-add-item'. PROPS are additional |
153 properties to add to the binding. | 153 properties to add to the binding. |
154 | 154 |
155 MAP must contain appropriate binding for `[menu-bar]' which holds a keymap. | 155 MAP must contain appropriate binding for `[menu-bar]' which holds a keymap. |
156 | 156 |
157 Use this function only to make bindings in the global value of `tool-bar-map'. | 157 Use this function only to make bindings in the global value of `tool-bar-map'. |
158 To define items in any other map, use `tool-bar-local-item'." | 158 To define items in any other map, use `tool-bar-local-item-from-menu'." |
159 (apply 'tool-bar-local-item-from-menu command icon | 159 (apply 'tool-bar-local-item-from-menu command icon |
160 (default-value 'tool-bar-map) map props)) | 160 (default-value 'tool-bar-map) map props)) |
161 | 161 |
162 ;;;###autoload | 162 ;;;###autoload |
163 (defun tool-bar-local-item-from-menu (command icon in-map &optional from-map &rest props) | 163 (defun tool-bar-local-item-from-menu (command icon in-map &optional from-map &rest props) |
164 "Define tool bar binding for COMMAND using the given ICON in keymap MAP. | 164 "Define local tool bar binding for COMMAND using the given ICON. |
165 This makes a binding for COMMAND in IN-MAP, copying its binding from | 165 This makes a binding for COMMAND in IN-MAP, copying its binding from |
166 the menu bar in FROM-MAP (which defaults to `global-map'), but | 166 the menu bar in FROM-MAP (which defaults to `global-map'), but |
167 modifies the binding by adding an image specification for ICON. It | 167 modifies the binding by adding an image specification for ICON. It |
168 finds ICON just like `tool-bar-add-item'. PROPS are additional | 168 finds ICON just like `tool-bar-add-item'. PROPS are additional |
169 properties to add to the binding. | 169 properties to add to the binding. |
170 | 170 |
171 MAP must contain appropriate binding for `[menu-bar]' which holds a keymap." | 171 FROM-MAP must contain appropriate binding for `[menu-bar]' which |
172 holds a keymap." | |
172 (unless from-map | 173 (unless from-map |
173 (setq from-map global-map)) | 174 (setq from-map global-map)) |
174 (let* ((menu-bar-map (lookup-key from-map [menu-bar])) | 175 (let* ((menu-bar-map (lookup-key from-map [menu-bar])) |
175 (keys (where-is-internal command menu-bar-map)) | 176 (keys (where-is-internal command menu-bar-map)) |
176 (fg (face-attribute 'tool-bar :foreground)) | 177 (fg (face-attribute 'tool-bar :foreground)) |