935 |
(substitute-env-vars (match-string 1 command)) |
(substitute-env-vars (match-string 1 command)) |
936 |
"~") |
"~") |
937 |
default-directory)) |
default-directory)) |
938 |
|
;; Select the desired mode. |
939 |
|
(if (not (eq mode t)) |
940 |
|
(funcall mode) |
941 |
|
(setq buffer-read-only nil) |
942 |
|
(with-no-warnings (comint-mode)) |
943 |
|
(compilation-shell-minor-mode)) |
944 |
|
(if highlight-regexp |
945 |
|
(set (make-local-variable 'compilation-highlight-regexp) |
946 |
|
highlight-regexp)) |
947 |
(erase-buffer) |
(erase-buffer) |
948 |
;; output a mode setter, for saving and later reloading this buffer |
;; Output a mode setter, for saving and later reloading this buffer. |
949 |
(insert "-*- mode: " name-of-mode |
(insert "-*- mode: " name-of-mode |
950 |
"; default-directory: " (prin1-to-string default-directory) |
"; default-directory: " (prin1-to-string default-directory) |
951 |
" -*-\n" command "\n") |
" -*-\n" command "\n") (setq thisdir default-directory)) |
|
(setq thisdir default-directory)) |
|
952 |
(set-buffer-modified-p nil)) |
(set-buffer-modified-p nil)) |
953 |
;; If we're already in the compilation buffer, go to the end |
;; If we're already in the compilation buffer, go to the end |
954 |
;; of the buffer, so point will track the compilation output. |
;; of the buffer, so point will track the compilation output. |
971 |
;; don't override users' setting of $EMACS. |
;; don't override users' setting of $EMACS. |
972 |
(unless (getenv "EMACS") '("EMACS=t")) |
(unless (getenv "EMACS") '("EMACS=t")) |
973 |
(copy-sequence process-environment)))) |
(copy-sequence process-environment)))) |
|
(if (not (eq mode t)) |
|
|
(funcall mode) |
|
|
(setq buffer-read-only nil) |
|
|
(with-no-warnings (comint-mode)) |
|
|
(compilation-shell-minor-mode)) |
|
|
(if highlight-regexp |
|
|
(set (make-local-variable 'compilation-highlight-regexp) |
|
|
highlight-regexp)) |
|
974 |
(set (make-local-variable 'compilation-arguments) |
(set (make-local-variable 'compilation-arguments) |
975 |
(list command mode name-function highlight-regexp)) |
(list command mode name-function highlight-regexp)) |
976 |
(set (make-local-variable 'revert-buffer-function) |
(set (make-local-variable 'revert-buffer-function) |