diff options
| author | Gerd Moellmann | 2000-09-26 09:35:27 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-09-26 09:35:27 +0000 |
| commit | cd3b81be39042964eca4f36f334ab28168f1588e (patch) | |
| tree | c4515dea009a21311cb05256228e65c67893d63e /lisp | |
| parent | 62c273d715d10c413b6c3f66425031f2e52b0d51 (diff) | |
| download | emacs-cd3b81be39042964eca4f36f334ab28168f1588e.tar.gz emacs-cd3b81be39042964eca4f36f334ab28168f1588e.zip | |
(tool-bar-help): New function.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/toolbar/tool-bar.el | 22 |
2 files changed, 20 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 024ec655a6b..296a36e45b3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2000-09-26 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * toolbar/tool-bar.el (tool-bar-help): New function. | ||
| 4 | |||
| 1 | 2000-09-25 Gerd Moellmann <gerd@gnu.org> | 5 | 2000-09-25 Gerd Moellmann <gerd@gnu.org> |
| 2 | 6 | ||
| 3 | * bytecomp.el (byte-compile-defvar-or-defconst): Only cons onto | 7 | * bytecomp.el (byte-compile-defvar-or-defconst): Only cons onto |
diff --git a/lisp/toolbar/tool-bar.el b/lisp/toolbar/tool-bar.el index ff5028a164d..9bb60e20829 100644 --- a/lisp/toolbar/tool-bar.el +++ b/lisp/toolbar/tool-bar.el | |||
| @@ -151,12 +151,22 @@ PROPS is a list of additional properties to add to the binding." | |||
| 151 | (tool-bar-add-item-from-menu 'print-buffer "print") | 151 | (tool-bar-add-item-from-menu 'print-buffer "print") |
| 152 | (tool-bar-add-item "preferences" 'customize 'customize nil | 152 | (tool-bar-add-item "preferences" 'customize 'customize nil |
| 153 | :help "Edit preferences (customize)") | 153 | :help "Edit preferences (customize)") |
| 154 | (tool-bar-add-item "help" | 154 | |
| 155 | (lambda () | 155 | (defun tool-bar-help () |
| 156 | (interactive) | 156 | "Pop up the help menu from the tool-bar." |
| 157 | (let ((p (mouse-position))) | 157 | (interactive) |
| 158 | (x-popup-menu (list (list (cadr p) (cddr p)) (car p)) | 158 | (let* ((p (mouse-position)) |
| 159 | menu-bar-help-menu))) | 159 | (menu menu-bar-help-menu) |
| 160 | (selection (x-popup-menu (list (list (cadr p) (cddr p)) (car p)) | ||
| 161 | menu)) | ||
| 162 | binding) | ||
| 163 | (while selection | ||
| 164 | (setq binding (lookup-key (or binding menu) (vector (car selection))) | ||
| 165 | selection (cdr selection))) | ||
| 166 | (when binding | ||
| 167 | (call-interactively binding)))) | ||
| 168 | |||
| 169 | (tool-bar-add-item "help" 'tool-bar-help | ||
| 160 | 'help nil :help "Pop up the Help menu") | 170 | 'help nil :help "Pop up the Help menu") |
| 161 | 171 | ||
| 162 | (provide 'tool-bar) | 172 | (provide 'tool-bar) |