diff options
| author | Jan Djärv <jan.h.d@swipnet.se> | 2008-02-25 10:52:09 +0000 |
|---|---|---|
| committer | Jan Djärv <jan.h.d@swipnet.se> | 2008-02-25 10:52:09 +0000 |
| commit | c45e48d29aa9ed478c698dcc441e41f2f62eda6d (patch) | |
| tree | e6b77fec9d5aa7e05b3ffe7da2482c766fbae2f6 | |
| parent | c96a0d6455f0a92331020b13348f39d2843783a7 (diff) | |
| download | emacs-c45e48d29aa9ed478c698dcc441e41f2f62eda6d.tar.gz | |
(tool-bar): Rquire tool-bar.
(compilation-mode-tool-bar-map): New variable.
(compilation-mode): Use compilation-mode-tool-bar-map.
| -rw-r--r-- | lisp/progmodes/compile.el | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 537d3cd0e0f..746d650c95b 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -73,6 +73,7 @@ ;;; Code: (eval-when-compile (require 'cl)) +(require 'tool-bar) (defvar font-lock-extra-managed-props) (defvar font-lock-keywords) @@ -1377,6 +1378,26 @@ Returns the compilation buffer created." "Keymap for compilation log buffers. `compilation-minor-mode-map' is a parent of this.") +(defvar compilation-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 error") + (tool-bar-local-item + "left-arrow" 'previous-error-no-select 'previous-error-no-select map + :rtl "right-arrow" + :help "Goto previous error") + (tool-bar-local-item + "cancel" 'kill-compilation 'kill-compilation map + :help "Stop compilation") + (tool-bar-local-item + "refresh" 'recompile 'recompile map + :help "Restart compilation") + (append map help)))) + (put 'compilation-mode 'mode-class 'special) ;;;###autoload @@ -1392,6 +1413,7 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see). (interactive) (kill-all-local-variables) (use-local-map compilation-mode-map) + (set (make-local-variable 'tool-bar-map) compilation-mode-tool-bar-map) (setq major-mode 'compilation-mode mode-name (or name-of-mode "Compilation")) (set (make-local-variable 'page-delimiter) |
