diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2008-02-25 10:52:57 +0000 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2008-02-25 10:52:57 +0000 |
commit | 38cd9f1734136fd33fc5bb050fe8085377850c4d (patch) | |
tree | e3e223178eba59d01c8cb334a3c91a15337c9a34 /lisp/progmodes/grep.el | |
parent | c45e48d29aa9ed478c698dcc441e41f2f62eda6d (diff) | |
download | emacs-38cd9f1734136fd33fc5bb050fe8085377850c4d.tar.gz |
(grep-mode-tool-bar-map): New variable.
(grep-mode): Use grep-mode-tool-bar-map.
Diffstat (limited to 'lisp/progmodes/grep.el')
-rw-r--r-- | lisp/progmodes/grep.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 0c7cb358f4a..ef147aa79e0 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -220,6 +220,26 @@ See `compilation-error-screen-columns'" "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 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." (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) |