aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGerd Moellmann2000-09-26 09:35:27 +0000
committerGerd Moellmann2000-09-26 09:35:27 +0000
commitcd3b81be39042964eca4f36f334ab28168f1588e (patch)
treec4515dea009a21311cb05256228e65c67893d63e /lisp
parent62c273d715d10c413b6c3f66425031f2e52b0d51 (diff)
downloademacs-cd3b81be39042964eca4f36f334ab28168f1588e.tar.gz
emacs-cd3b81be39042964eca4f36f334ab28168f1588e.zip
(tool-bar-help): New function.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/toolbar/tool-bar.el22
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 @@
12000-09-26 Gerd Moellmann <gerd@gnu.org>
2
3 * toolbar/tool-bar.el (tool-bar-help): New function.
4
12000-09-25 Gerd Moellmann <gerd@gnu.org> 52000-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)