Mercurial > emacs
comparison lisp/progmodes/grep.el @ 92204:ab425a596ec9
(grep-mode-tool-bar-map): New variable.
(grep-mode): Use grep-mode-tool-bar-map.
author | Jan Djärv <jan.h.d@swipnet.se> |
---|---|
date | Mon, 25 Feb 2008 10:52:24 +0000 |
parents | 0fa30755c209 |
children | d9373da2792d |
comparison
equal
deleted
inserted
replaced
92203:c50ae6f34d03 | 92204:ab425a596ec9 |
---|---|
217 (define-key map [menu-bar grep compilation-next-error] | 217 (define-key map [menu-bar grep compilation-next-error] |
218 '("Next Match" . next-error)) | 218 '("Next Match" . next-error)) |
219 map) | 219 map) |
220 "Keymap for grep buffers. | 220 "Keymap for grep buffers. |
221 `compilation-minor-mode-map' is a cdr of this.") | 221 `compilation-minor-mode-map' is a cdr of this.") |
222 | |
223 (defvar grep-mode-tool-bar-map | |
224 (if (display-graphic-p) | |
225 (let ((map (butlast (copy-keymap tool-bar-map))) | |
226 (help (last tool-bar-map))) ;; Keep Help last in tool bar | |
227 (tool-bar-local-item | |
228 "right-arrow" 'next-error-no-select 'next-error-no-select map | |
229 :rtl "left-arrow" | |
230 :help "Goto next match") | |
231 (tool-bar-local-item | |
232 "left-arrow" 'previous-error-no-select 'previous-error-no-select map | |
233 :rtl "right-arrow" | |
234 :help "Goto previous match") | |
235 (tool-bar-local-item | |
236 "cancel" 'kill-compilation 'kill-compilation map | |
237 :help "Stop grep") | |
238 (tool-bar-local-item | |
239 "refresh" 'recompile 'recompile map | |
240 :help "Restart grep") | |
241 (append map help)))) | |
222 | 242 |
223 (defalias 'kill-grep 'kill-compilation) | 243 (defalias 'kill-grep 'kill-compilation) |
224 | 244 |
225 ;;;; TODO --- refine this!! | 245 ;;;; TODO --- refine this!! |
226 | 246 |
584 | 604 |
585 ;;;###autoload | 605 ;;;###autoload |
586 (define-compilation-mode grep-mode "Grep" | 606 (define-compilation-mode grep-mode "Grep" |
587 "Sets `grep-last-buffer' and `compilation-window-height'." | 607 "Sets `grep-last-buffer' and `compilation-window-height'." |
588 (setq grep-last-buffer (current-buffer)) | 608 (setq grep-last-buffer (current-buffer)) |
609 (set (make-local-variable 'tool-bar-map) grep-mode-tool-bar-map) | |
589 (set (make-local-variable 'compilation-error-face) | 610 (set (make-local-variable 'compilation-error-face) |
590 grep-hit-face) | 611 grep-hit-face) |
591 (set (make-local-variable 'compilation-error-regexp-alist) | 612 (set (make-local-variable 'compilation-error-regexp-alist) |
592 grep-regexp-alist) | 613 grep-regexp-alist) |
593 (set (make-local-variable 'compilation-process-setup-function) | 614 (set (make-local-variable 'compilation-process-setup-function) |