diff options
| author | Jan Djärv | 2008-02-25 10:52:09 +0000 |
|---|---|---|
| committer | Jan Djärv | 2008-02-25 10:52:09 +0000 |
| commit | c45e48d29aa9ed478c698dcc441e41f2f62eda6d (patch) | |
| tree | e6b77fec9d5aa7e05b3ffe7da2482c766fbae2f6 | |
| parent | c96a0d6455f0a92331020b13348f39d2843783a7 (diff) | |
| download | emacs-c45e48d29aa9ed478c698dcc441e41f2f62eda6d.tar.gz emacs-c45e48d29aa9ed478c698dcc441e41f2f62eda6d.zip | |
(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 @@ | |||
| 73 | ;;; Code: | 73 | ;;; Code: |
| 74 | 74 | ||
| 75 | (eval-when-compile (require 'cl)) | 75 | (eval-when-compile (require 'cl)) |
| 76 | (require 'tool-bar) | ||
| 76 | 77 | ||
| 77 | (defvar font-lock-extra-managed-props) | 78 | (defvar font-lock-extra-managed-props) |
| 78 | (defvar font-lock-keywords) | 79 | (defvar font-lock-keywords) |
| @@ -1377,6 +1378,26 @@ Returns the compilation buffer created." | |||
| 1377 | "Keymap for compilation log buffers. | 1378 | "Keymap for compilation log buffers. |
| 1378 | `compilation-minor-mode-map' is a parent of this.") | 1379 | `compilation-minor-mode-map' is a parent of this.") |
| 1379 | 1380 | ||
| 1381 | (defvar compilation-mode-tool-bar-map | ||
| 1382 | (if (display-graphic-p) | ||
| 1383 | (let ((map (butlast (copy-keymap tool-bar-map))) | ||
| 1384 | (help (last tool-bar-map))) ;; Keep Help last in tool bar | ||
| 1385 | (tool-bar-local-item | ||
| 1386 | "right-arrow" 'next-error-no-select 'next-error-no-select map | ||
| 1387 | :rtl "left-arrow" | ||
| 1388 | :help "Goto next error") | ||
| 1389 | (tool-bar-local-item | ||
| 1390 | "left-arrow" 'previous-error-no-select 'previous-error-no-select map | ||
| 1391 | :rtl "right-arrow" | ||
| 1392 | :help "Goto previous error") | ||
| 1393 | (tool-bar-local-item | ||
| 1394 | "cancel" 'kill-compilation 'kill-compilation map | ||
| 1395 | :help "Stop compilation") | ||
| 1396 | (tool-bar-local-item | ||
| 1397 | "refresh" 'recompile 'recompile map | ||
| 1398 | :help "Restart compilation") | ||
| 1399 | (append map help)))) | ||
| 1400 | |||
| 1380 | (put 'compilation-mode 'mode-class 'special) | 1401 | (put 'compilation-mode 'mode-class 'special) |
| 1381 | 1402 | ||
| 1382 | ;;;###autoload | 1403 | ;;;###autoload |
| @@ -1392,6 +1413,7 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see). | |||
| 1392 | (interactive) | 1413 | (interactive) |
| 1393 | (kill-all-local-variables) | 1414 | (kill-all-local-variables) |
| 1394 | (use-local-map compilation-mode-map) | 1415 | (use-local-map compilation-mode-map) |
| 1416 | (set (make-local-variable 'tool-bar-map) compilation-mode-tool-bar-map) | ||
| 1395 | (setq major-mode 'compilation-mode | 1417 | (setq major-mode 'compilation-mode |
| 1396 | mode-name (or name-of-mode "Compilation")) | 1418 | mode-name (or name-of-mode "Compilation")) |
| 1397 | (set (make-local-variable 'page-delimiter) | 1419 | (set (make-local-variable 'page-delimiter) |