changeset 112169:882d6cbb91a2

Tweaks to tool-bar for default, VC-dir, Compile, and Info. * tool-bar.el (tool-bar-setup): Remove Help button. Remove label from Search and add a label to Undo. * vc/vc-dir.el (vc-dir-tool-bar-map): Rearrange, removing inappropriate buttons and adding :vert-only tags. * progmodes/compile.el (compilation-mode-tool-bar-map): Adjust to removal of Help tool-bar button. Remove Undo button for space. * info.el (info-tool-bar-map): Add :vert-only tags.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 08 Jan 2011 23:13:47 -0500
parents 744d9787c683
children 2b3091d14255
files lisp/ChangeLog lisp/info.el lisp/progmodes/compile.el lisp/tool-bar.el lisp/vc/vc-dir.el
diffstat 5 files changed, 65 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Jan 08 22:29:49 2011 -0500
+++ b/lisp/ChangeLog	Sat Jan 08 23:13:47 2011 -0500
@@ -1,3 +1,16 @@
+2011-01-09  Chong Yidong  <cyd@stupidchicken.com>
+
+	* tool-bar.el (tool-bar-setup): Remove Help button.  Remove label
+	from Search and add a label to Undo.
+
+	* vc/vc-dir.el (vc-dir-tool-bar-map): Rearrange, removing
+	inappropriate buttons and adding :vert-only tags.
+
+	* progmodes/compile.el (compilation-mode-tool-bar-map): Adjust to
+	removal of Help tool-bar button.  Remove Undo button for space.
+
+	* info.el (info-tool-bar-map): Add :vert-only tags.
+
 2011-01-08  Tassilo Horn  <tassilo@member.fsf.org>
 
 	* doc-view.el (doc-view-mode-p): Check for png or imagemagick
--- a/lisp/info.el	Sat Jan 08 22:29:49 2011 -0500
+++ b/lisp/info.el	Sat Jan 08 23:13:47 2011 -0500
@@ -3777,13 +3777,16 @@
     (tool-bar-local-item-from-menu 'Info-up "up-node" map Info-mode-map
 				   :vert-only t)
     (define-key-after map [separator-2] menu-bar-separator)
-    (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map)
+    (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map
+				   :vert-only t)
     (tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map)
     (define-key-after map [separator-3] menu-bar-separator)
     (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map
-				   :label "Index Search")
-    (tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map)
-    (tool-bar-local-item-from-menu 'Info-exit "exit" map Info-mode-map)
+				   :label "Index")
+    (tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map
+				   :vert-only t)
+    (tool-bar-local-item-from-menu 'Info-exit "exit" map Info-mode-map
+				   :vert-only t)
     map))
 
 (defvar Info-menu-last-node nil)
--- a/lisp/progmodes/compile.el	Sat Jan 08 22:29:49 2011 -0500
+++ b/lisp/progmodes/compile.el	Sat Jan 08 23:13:47 2011 -0500
@@ -1569,9 +1569,11 @@
 (defvar compilation-mode-tool-bar-map
   ;; When bootstrapping, tool-bar-map is not properly initialized yet,
   ;; so don't do anything.
-  (when (keymapp (butlast tool-bar-map))
-    (let ((map (butlast (copy-keymap tool-bar-map)))
-	  (help (last tool-bar-map))) ;; Keep Help last in tool bar
+  (when (keymapp tool-bar-map)
+    (let ((map (copy-keymap tool-bar-map)))
+      (define-key map [undo] nil)
+      (define-key map [separator-2] nil)
+      (define-key-after map [separator-compile] menu-bar-separator)
       (tool-bar-local-item
        "left-arrow" 'previous-error-no-select 'previous-error-no-select map
        :rtl "right-arrow"
@@ -1588,7 +1590,7 @@
       (tool-bar-local-item
        "refresh" 'recompile 'recompile map
        :help "Restart compilation")
-      (append map help))))
+      map)))
 
 (put 'compilation-mode 'mode-class 'special)
 
--- a/lisp/tool-bar.el	Sat Jan 08 22:29:49 2011 -0500
+++ b/lisp/tool-bar.el	Sat Jan 08 23:13:47 2011 -0500
@@ -254,7 +254,7 @@
   (tool-bar-add-item-from-menu 'save-buffer "save" nil
 			       :label "Save")
   (define-key-after (default-value 'tool-bar-map) [separator-1] menu-bar-separator)
-  (tool-bar-add-item-from-menu 'undo "undo" nil :vert-only t)
+  (tool-bar-add-item-from-menu 'undo "undo" nil)
   (define-key-after (default-value 'tool-bar-map) [separator-2] menu-bar-separator)
   (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut])
 			       "cut" nil :vert-only t)
@@ -263,25 +263,22 @@
   (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste])
 			       "paste" nil :vert-only t)
   (define-key-after (default-value 'tool-bar-map) [separator-3] menu-bar-separator)
-  (tool-bar-add-item-from-menu 'nonincremental-search-forward "search"
-			       nil :label "Search")
+  (tool-bar-add-item-from-menu 'isearch-forward "search"
+			       nil :label "Search" :vert-only t)
   ;;(tool-bar-add-item-from-menu 'ispell-buffer "spell")
 
   ;; There's no icon appropriate for News and we need a command rather
   ;; than a lambda for Read Mail.
   ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
 
-
-  ;; 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 "help" (lambda ()
-				(interactive)
-				(popup-menu menu-bar-help-menu))
-		       'help
-		       :help "Pop up the Help menu")))
+  ;; Help button on a tool bar is rather non-standard...
+  ;; (let ((tool-bar-map (default-value 'tool-bar-map)))
+  ;;   (tool-bar-add-item "help" (lambda ()
+  ;; 				(interactive)
+  ;; 				(popup-menu menu-bar-help-menu))
+  ;; 		       'help
+  ;; 		       :help "Pop up the Help menu"))
+)
 
 (if (featurep 'move-toolbar)
     (defcustom tool-bar-position 'top
--- a/lisp/vc/vc-dir.el	Sat Jan 08 22:29:49 2011 -0500
+++ b/lisp/vc/vc-dir.el	Sat Jan 08 23:13:47 2011 -0500
@@ -196,7 +196,7 @@
       '(menu-item "Show Incoming Log" vc-log-incoming
 		  :help "Show a log of changes that will be received with a pull operation"))
     (define-key map [log]
-      '(menu-item "Show history" vc-print-log
+      '(menu-item "Show History" vc-print-log
 		  :help "List the change log of the current file set in a window"))
     (define-key map [rlog]
       '(menu-item "Show Top of the Tree History " vc-print-root-log
@@ -307,33 +307,36 @@
 
 (defvar vc-dir-tool-bar-map
   (let ((map (make-sparse-keymap)))
-    (tool-bar-local-item-from-menu 'vc-dir-find-file "open"
-				   map vc-dir-mode-map)
-    (tool-bar-local-item "bookmark_add"
-			 'vc-dir-toggle-mark 'vc-dir-toggle-mark map
-			 :help "Toggle mark on current item"
-			 :label "Toggle Mark")
-    (tool-bar-local-item-from-menu 'vc-dir-previous-line "left-arrow"
-				   map vc-dir-mode-map
-				   :rtl "right-arrow")
-    (tool-bar-local-item-from-menu 'vc-dir-next-line "right-arrow"
-				   map vc-dir-mode-map
-				   :rtl "left-arrow")
+    (tool-bar-local-item-from-menu 'find-file "new" map nil
+				   :label "New File" :vert-only t)
+    (tool-bar-local-item-from-menu 'menu-find-file-existing "open" map nil
+				   :label "Open" :vert-only t)
+    (tool-bar-local-item-from-menu 'dired "diropen" map nil
+				   :vert-only t)
+    (tool-bar-local-item-from-menu 'quit-window "close" map vc-dir-mode-map
+				   :vert-only t)
+    (tool-bar-local-item-from-menu 'vc-next-action "saveas" map
+				   vc-dir-mode-map :label "Commit")
     (tool-bar-local-item-from-menu 'vc-print-log "info"
-				   map vc-dir-mode-map)
-    (tool-bar-local-item-from-menu 'revert-buffer "refresh"
-				   map vc-dir-mode-map)
-    (tool-bar-local-item-from-menu 'nonincremental-search-forward
-				   "search" map nil
-				   :label "Search")
-    (tool-bar-local-item-from-menu 'vc-dir-query-replace-regexp
-				   "search-replace" map vc-dir-mode-map
-				   :label "Replace")
+    				   map vc-dir-mode-map
+				   :label "Log")
+    (define-key-after map [separator-1] menu-bar-separator)
     (tool-bar-local-item-from-menu 'vc-dir-kill-dir-status-process "cancel"
 				   map vc-dir-mode-map
-				   :label "Cancel")
-    (tool-bar-local-item-from-menu 'quit-window "exit"
-				   map vc-dir-mode-map)
+				   :label "Stop" :vert-only t)
+    (tool-bar-local-item-from-menu 'revert-buffer "refresh"
+				   map vc-dir-mode-map :vert-only t)
+    (define-key-after map [separator-2] menu-bar-separator)
+    (tool-bar-local-item-from-menu (lookup-key menu-bar-edit-menu [cut])
+				   "cut" map nil :vert-only t)
+    (tool-bar-local-item-from-menu (lookup-key menu-bar-edit-menu [copy])
+				   "copy" map nil :vert-only t)
+    (tool-bar-local-item-from-menu (lookup-key menu-bar-edit-menu [paste])
+				   "paste" map nil :vert-only t)
+    (define-key-after map [separator-3] menu-bar-separator)
+    (tool-bar-local-item-from-menu 'isearch-forward
+    				   "search" map nil
+				   :label "Search" :vert-only t)
     map))
 
 (defun vc-dir-node-directory (node)