aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman2005-05-29 08:32:57 +0000
committerRichard M. Stallman2005-05-29 08:32:57 +0000
commit6d2957c46015fc0ad06448fc8b41195911ec5581 (patch)
treeafae18762b9d4d8c5a9204035b3e54ead237aa31 /lisp
parent7d2026d5184a6297ed6e6ea012a19a2bd482929c (diff)
downloademacs-6d2957c46015fc0ad06448fc8b41195911ec5581.tar.gz
emacs-6d2957c46015fc0ad06448fc8b41195911ec5581.zip
(compilation-start): Set the mode before inserting the initial text.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/compile.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index ad43228a100..0cb87a5b17a 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -935,12 +935,20 @@ Returns the compilation buffer created."
935 (substitute-env-vars (match-string 1 command)) 935 (substitute-env-vars (match-string 1 command))
936 "~") 936 "~")
937 default-directory)) 937 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))
938 (erase-buffer) 947 (erase-buffer)
939 ;; output a mode setter, for saving and later reloading this buffer 948 ;; Output a mode setter, for saving and later reloading this buffer.
940 (insert "-*- mode: " name-of-mode 949 (insert "-*- mode: " name-of-mode
941 "; default-directory: " (prin1-to-string default-directory) 950 "; default-directory: " (prin1-to-string default-directory)
942 " -*-\n" command "\n") 951 " -*-\n" command "\n") (setq thisdir default-directory))
943 (setq thisdir default-directory))
944 (set-buffer-modified-p nil)) 952 (set-buffer-modified-p nil))
945 ;; If we're already in the compilation buffer, go to the end 953 ;; If we're already in the compilation buffer, go to the end
946 ;; of the buffer, so point will track the compilation output. 954 ;; of the buffer, so point will track the compilation output.
@@ -963,14 +971,6 @@ Returns the compilation buffer created."
963 ;; don't override users' setting of $EMACS. 971 ;; don't override users' setting of $EMACS.
964 (unless (getenv "EMACS") '("EMACS=t")) 972 (unless (getenv "EMACS") '("EMACS=t"))
965 (copy-sequence process-environment)))) 973 (copy-sequence process-environment))))
966 (if (not (eq mode t))
967 (funcall mode)
968 (setq buffer-read-only nil)
969 (with-no-warnings (comint-mode))
970 (compilation-shell-minor-mode))
971 (if highlight-regexp
972 (set (make-local-variable 'compilation-highlight-regexp)
973 highlight-regexp))
974 (set (make-local-variable 'compilation-arguments) 974 (set (make-local-variable 'compilation-arguments)
975 (list command mode name-function highlight-regexp)) 975 (list command mode name-function highlight-regexp))
976 (set (make-local-variable 'revert-buffer-function) 976 (set (make-local-variable 'revert-buffer-function)