aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-01-08 23:13:47 -0500
committerChong Yidong2011-01-08 23:13:47 -0500
commit900503ae7959dc465c3897f3deafd55e09a93ee3 (patch)
tree70e363d80d2aa6c2c02877120476d9926f4a74cf
parent21a76236f6530c2c01385956f0984f34e017f5c5 (diff)
downloademacs-900503ae7959dc465c3897f3deafd55e09a93ee3.tar.gz
emacs-900503ae7959dc465c3897f3deafd55e09a93ee3.zip
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.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/info.el11
-rw-r--r--lisp/progmodes/compile.el10
-rw-r--r--lisp/tool-bar.el25
-rw-r--r--lisp/vc/vc-dir.el53
5 files changed, 65 insertions, 47 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7823c36e378..1a1f9205793 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12011-01-09 Chong Yidong <cyd@stupidchicken.com>
2
3 * tool-bar.el (tool-bar-setup): Remove Help button. Remove label
4 from Search and add a label to Undo.
5
6 * vc/vc-dir.el (vc-dir-tool-bar-map): Rearrange, removing
7 inappropriate buttons and adding :vert-only tags.
8
9 * progmodes/compile.el (compilation-mode-tool-bar-map): Adjust to
10 removal of Help tool-bar button. Remove Undo button for space.
11
12 * info.el (info-tool-bar-map): Add :vert-only tags.
13
12011-01-08 Tassilo Horn <tassilo@member.fsf.org> 142011-01-08 Tassilo Horn <tassilo@member.fsf.org>
2 15
3 * doc-view.el (doc-view-mode-p): Check for png or imagemagick 16 * doc-view.el (doc-view-mode-p): Check for png or imagemagick
diff --git a/lisp/info.el b/lisp/info.el
index ad92914a54d..7391dfad39e 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3777,13 +3777,16 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
3777 (tool-bar-local-item-from-menu 'Info-up "up-node" map Info-mode-map 3777 (tool-bar-local-item-from-menu 'Info-up "up-node" map Info-mode-map
3778 :vert-only t) 3778 :vert-only t)
3779 (define-key-after map [separator-2] menu-bar-separator) 3779 (define-key-after map [separator-2] menu-bar-separator)
3780 (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map) 3780 (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map
3781 :vert-only t)
3781 (tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map) 3782 (tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map)
3782 (define-key-after map [separator-3] menu-bar-separator) 3783 (define-key-after map [separator-3] menu-bar-separator)
3783 (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map 3784 (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map
3784 :label "Index Search") 3785 :label "Index")
3785 (tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map) 3786 (tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map
3786 (tool-bar-local-item-from-menu 'Info-exit "exit" map Info-mode-map) 3787 :vert-only t)
3788 (tool-bar-local-item-from-menu 'Info-exit "exit" map Info-mode-map
3789 :vert-only t)
3787 map)) 3790 map))
3788 3791
3789(defvar Info-menu-last-node nil) 3792(defvar Info-menu-last-node nil)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 710b5d0858b..f86dd7e1bec 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1569,9 +1569,11 @@ Returns the compilation buffer created."
1569(defvar compilation-mode-tool-bar-map 1569(defvar compilation-mode-tool-bar-map
1570 ;; When bootstrapping, tool-bar-map is not properly initialized yet, 1570 ;; When bootstrapping, tool-bar-map is not properly initialized yet,
1571 ;; so don't do anything. 1571 ;; so don't do anything.
1572 (when (keymapp (butlast tool-bar-map)) 1572 (when (keymapp tool-bar-map)
1573 (let ((map (butlast (copy-keymap tool-bar-map))) 1573 (let ((map (copy-keymap tool-bar-map)))
1574 (help (last tool-bar-map))) ;; Keep Help last in tool bar 1574 (define-key map [undo] nil)
1575 (define-key map [separator-2] nil)
1576 (define-key-after map [separator-compile] menu-bar-separator)
1575 (tool-bar-local-item 1577 (tool-bar-local-item
1576 "left-arrow" 'previous-error-no-select 'previous-error-no-select map 1578 "left-arrow" 'previous-error-no-select 'previous-error-no-select map
1577 :rtl "right-arrow" 1579 :rtl "right-arrow"
@@ -1588,7 +1590,7 @@ Returns the compilation buffer created."
1588 (tool-bar-local-item 1590 (tool-bar-local-item
1589 "refresh" 'recompile 'recompile map 1591 "refresh" 'recompile 'recompile map
1590 :help "Restart compilation") 1592 :help "Restart compilation")
1591 (append map help)))) 1593 map)))
1592 1594
1593(put 'compilation-mode 'mode-class 'special) 1595(put 'compilation-mode 'mode-class 'special)
1594 1596
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index fa16381bf29..51d13fe3920 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -254,7 +254,7 @@ holds a keymap."
254 (tool-bar-add-item-from-menu 'save-buffer "save" nil 254 (tool-bar-add-item-from-menu 'save-buffer "save" nil
255 :label "Save") 255 :label "Save")
256 (define-key-after (default-value 'tool-bar-map) [separator-1] menu-bar-separator) 256 (define-key-after (default-value 'tool-bar-map) [separator-1] menu-bar-separator)
257 (tool-bar-add-item-from-menu 'undo "undo" nil :vert-only t) 257 (tool-bar-add-item-from-menu 'undo "undo" nil)
258 (define-key-after (default-value 'tool-bar-map) [separator-2] menu-bar-separator) 258 (define-key-after (default-value 'tool-bar-map) [separator-2] menu-bar-separator)
259 (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut]) 259 (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut])
260 "cut" nil :vert-only t) 260 "cut" nil :vert-only t)
@@ -263,25 +263,22 @@ holds a keymap."
263 (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste]) 263 (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste])
264 "paste" nil :vert-only t) 264 "paste" nil :vert-only t)
265 (define-key-after (default-value 'tool-bar-map) [separator-3] menu-bar-separator) 265 (define-key-after (default-value 'tool-bar-map) [separator-3] menu-bar-separator)
266 (tool-bar-add-item-from-menu 'nonincremental-search-forward "search" 266 (tool-bar-add-item-from-menu 'isearch-forward "search"
267 nil :label "Search") 267 nil :label "Search" :vert-only t)
268 ;;(tool-bar-add-item-from-menu 'ispell-buffer "spell") 268 ;;(tool-bar-add-item-from-menu 'ispell-buffer "spell")
269 269
270 ;; There's no icon appropriate for News and we need a command rather 270 ;; There's no icon appropriate for News and we need a command rather
271 ;; than a lambda for Read Mail. 271 ;; than a lambda for Read Mail.
272 ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose") 272 ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
273 273
274 274 ;; Help button on a tool bar is rather non-standard...
275 ;; tool-bar-add-item-from-menu itself operates on 275 ;; (let ((tool-bar-map (default-value 'tool-bar-map)))
276 ;; (default-value 'tool-bar-map), but when we don't use that function, 276 ;; (tool-bar-add-item "help" (lambda ()
277 ;; we must explicitly operate on the default value. 277 ;; (interactive)
278 278 ;; (popup-menu menu-bar-help-menu))
279 (let ((tool-bar-map (default-value 'tool-bar-map))) 279 ;; 'help
280 (tool-bar-add-item "help" (lambda () 280 ;; :help "Pop up the Help menu"))
281 (interactive) 281)
282 (popup-menu menu-bar-help-menu))
283 'help
284 :help "Pop up the Help menu")))
285 282
286(if (featurep 'move-toolbar) 283(if (featurep 'move-toolbar)
287 (defcustom tool-bar-position 'top 284 (defcustom tool-bar-position 'top
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index cd40468199f..0335614a6ac 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -196,7 +196,7 @@ See `run-hooks'."
196 '(menu-item "Show Incoming Log" vc-log-incoming 196 '(menu-item "Show Incoming Log" vc-log-incoming
197 :help "Show a log of changes that will be received with a pull operation")) 197 :help "Show a log of changes that will be received with a pull operation"))
198 (define-key map [log] 198 (define-key map [log]
199 '(menu-item "Show history" vc-print-log 199 '(menu-item "Show History" vc-print-log
200 :help "List the change log of the current file set in a window")) 200 :help "List the change log of the current file set in a window"))
201 (define-key map [rlog] 201 (define-key map [rlog]
202 '(menu-item "Show Top of the Tree History " vc-print-root-log 202 '(menu-item "Show Top of the Tree History " vc-print-root-log
@@ -307,33 +307,36 @@ If BODY uses EVENT, it should be a variable,
307 307
308(defvar vc-dir-tool-bar-map 308(defvar vc-dir-tool-bar-map
309 (let ((map (make-sparse-keymap))) 309 (let ((map (make-sparse-keymap)))
310 (tool-bar-local-item-from-menu 'vc-dir-find-file "open" 310 (tool-bar-local-item-from-menu 'find-file "new" map nil
311 map vc-dir-mode-map) 311 :label "New File" :vert-only t)
312 (tool-bar-local-item "bookmark_add" 312 (tool-bar-local-item-from-menu 'menu-find-file-existing "open" map nil
313 'vc-dir-toggle-mark 'vc-dir-toggle-mark map 313 :label "Open" :vert-only t)
314 :help "Toggle mark on current item" 314 (tool-bar-local-item-from-menu 'dired "diropen" map nil
315 :label "Toggle Mark") 315 :vert-only t)
316 (tool-bar-local-item-from-menu 'vc-dir-previous-line "left-arrow" 316 (tool-bar-local-item-from-menu 'quit-window "close" map vc-dir-mode-map
317 map vc-dir-mode-map 317 :vert-only t)
318 :rtl "right-arrow") 318 (tool-bar-local-item-from-menu 'vc-next-action "saveas" map
319 (tool-bar-local-item-from-menu 'vc-dir-next-line "right-arrow" 319 vc-dir-mode-map :label "Commit")
320 map vc-dir-mode-map
321 :rtl "left-arrow")
322 (tool-bar-local-item-from-menu 'vc-print-log "info" 320 (tool-bar-local-item-from-menu 'vc-print-log "info"
323 map vc-dir-mode-map) 321 map vc-dir-mode-map
324 (tool-bar-local-item-from-menu 'revert-buffer "refresh" 322 :label "Log")
325 map vc-dir-mode-map) 323 (define-key-after map [separator-1] menu-bar-separator)
326 (tool-bar-local-item-from-menu 'nonincremental-search-forward
327 "search" map nil
328 :label "Search")
329 (tool-bar-local-item-from-menu 'vc-dir-query-replace-regexp
330 "search-replace" map vc-dir-mode-map
331 :label "Replace")
332 (tool-bar-local-item-from-menu 'vc-dir-kill-dir-status-process "cancel" 324 (tool-bar-local-item-from-menu 'vc-dir-kill-dir-status-process "cancel"
333 map vc-dir-mode-map 325 map vc-dir-mode-map
334 :label "Cancel") 326 :label "Stop" :vert-only t)
335 (tool-bar-local-item-from-menu 'quit-window "exit" 327 (tool-bar-local-item-from-menu 'revert-buffer "refresh"
336 map vc-dir-mode-map) 328 map vc-dir-mode-map :vert-only t)
329 (define-key-after map [separator-2] menu-bar-separator)
330 (tool-bar-local-item-from-menu (lookup-key menu-bar-edit-menu [cut])
331 "cut" map nil :vert-only t)
332 (tool-bar-local-item-from-menu (lookup-key menu-bar-edit-menu [copy])
333 "copy" map nil :vert-only t)
334 (tool-bar-local-item-from-menu (lookup-key menu-bar-edit-menu [paste])
335 "paste" map nil :vert-only t)
336 (define-key-after map [separator-3] menu-bar-separator)
337 (tool-bar-local-item-from-menu 'isearch-forward
338 "search" map nil
339 :label "Search" :vert-only t)
337 map)) 340 map))
338 341
339(defun vc-dir-node-directory (node) 342(defun vc-dir-node-directory (node)