]> git.eshelyaron.com Git - emacs.git/commitdiff
(tool-bar-setup): Put Help and Preferences items in the default tool-bar-map.
authorRichard M. Stallman <rms@gnu.org>
Mon, 1 May 2006 20:15:56 +0000 (20:15 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 1 May 2006 20:15:56 +0000 (20:15 +0000)
lisp/tool-bar.el

index 0a1d706a6945be65ec8ad8bb45be73c918d000ba..37d60441648c392ffdf364a43fa178d067aff44b 100644 (file)
@@ -267,14 +267,20 @@ holds a keymap."
   ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
 
   (tool-bar-add-item-from-menu 'print-buffer "print")
-  (tool-bar-add-item "preferences" 'customize 'customize
-                    :help "Edit preferences (customize)")
-
-  (tool-bar-add-item "help" (lambda ()
-                             (interactive)
-                             (popup-menu menu-bar-help-menu))
-                    'help
-                    :help "Pop up the Help menu")
+
+  ;; tool-bar-add-item-from-menu itself operates on
+  ;; (default-value 'tool-bar-map), but when we don't use that function,
+  ;; we must explicitly operate on the default value.
+
+  (let ((tool-bar-map (default-value 'tool-bar-map)))
+    (tool-bar-add-item "preferences" 'customize 'customize
+                      :help "Edit preferences (customize)")
+
+    (tool-bar-add-item "help" (lambda ()
+                               (interactive)
+                               (popup-menu menu-bar-help-menu))
+                      'help
+                      :help "Pop up the Help menu"))
   )
 
 (provide 'tool-bar)