# HG changeset patch # User Jan Dj¸«£rv # Date 1203936744 0 # Node ID ab425a596ec9f77713d4ba3660ad90170c00187a # Parent c50ae6f34d03d02c2bb70f5fe9e4f80258db17a7 (grep-mode-tool-bar-map): New variable. (grep-mode): Use grep-mode-tool-bar-map. diff -r c50ae6f34d03 -r ab425a596ec9 lisp/progmodes/grep.el --- a/lisp/progmodes/grep.el Mon Feb 25 10:52:09 2008 +0000 +++ b/lisp/progmodes/grep.el Mon Feb 25 10:52:24 2008 +0000 @@ -220,6 +220,26 @@ "Keymap for grep buffers. `compilation-minor-mode-map' is a cdr of this.") +(defvar grep-mode-tool-bar-map + (if (display-graphic-p) + (let ((map (butlast (copy-keymap tool-bar-map))) + (help (last tool-bar-map))) ;; Keep Help last in tool bar + (tool-bar-local-item + "right-arrow" 'next-error-no-select 'next-error-no-select map + :rtl "left-arrow" + :help "Goto next match") + (tool-bar-local-item + "left-arrow" 'previous-error-no-select 'previous-error-no-select map + :rtl "right-arrow" + :help "Goto previous match") + (tool-bar-local-item + "cancel" 'kill-compilation 'kill-compilation map + :help "Stop grep") + (tool-bar-local-item + "refresh" 'recompile 'recompile map + :help "Restart grep") + (append map help)))) + (defalias 'kill-grep 'kill-compilation) ;;;; TODO --- refine this!! @@ -586,6 +606,7 @@ (define-compilation-mode grep-mode "Grep" "Sets `grep-last-buffer' and `compilation-window-height'." (setq grep-last-buffer (current-buffer)) + (set (make-local-variable 'tool-bar-map) grep-mode-tool-bar-map) (set (make-local-variable 'compilation-error-face) grep-hit-face) (set (make-local-variable 'compilation-error-regexp-alist)