aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2005-06-06 12:27:44 +0000
committerJuri Linkov2005-06-06 12:27:44 +0000
commitabed526746f69a5524df703f362d12f348b236ad (patch)
treee10b0b75f16f403a65d4bcf4d3d5b219b506b9b4
parentc4f7f786e93880d2e659bbb8f2ddb83192c921e4 (diff)
downloademacs-abed526746f69a5524df703f362d12f348b236ad.tar.gz
emacs-abed526746f69a5524df703f362d12f348b236ad.zip
(compilation-start): Move `erase-buffer' up
before selecting the desired mode to not spend time fontifying old contents.
-rw-r--r--lisp/progmodes/compile.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index a27a5282b42..e0c8ded307a 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -935,6 +935,7 @@ 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 (erase-buffer)
938 ;; Select the desired mode. 939 ;; Select the desired mode.
939 (if (not (eq mode t)) 940 (if (not (eq mode t))
940 (funcall mode) 941 (funcall mode)
@@ -944,11 +945,11 @@ Returns the compilation buffer created."
944 (if highlight-regexp 945 (if highlight-regexp
945 (set (make-local-variable 'compilation-highlight-regexp) 946 (set (make-local-variable 'compilation-highlight-regexp)
946 highlight-regexp)) 947 highlight-regexp))
947 (erase-buffer)
948 ;; Output a mode setter, for saving and later reloading this buffer. 948 ;; Output a mode setter, for saving and later reloading this buffer.
949 (insert "-*- mode: " name-of-mode 949 (insert "-*- mode: " name-of-mode
950 "; default-directory: " (prin1-to-string default-directory) 950 "; default-directory: " (prin1-to-string default-directory)
951 " -*-\n" command "\n") (setq thisdir default-directory)) 951 " -*-\n" command "\n")
952 (setq thisdir default-directory))
952 (set-buffer-modified-p nil)) 953 (set-buffer-modified-p nil))
953 ;; If we're already in the compilation buffer, go to the end 954 ;; If we're already in the compilation buffer, go to the end
954 ;; of the buffer, so point will track the compilation output. 955 ;; of the buffer, so point will track the compilation output.