# HG changeset patch # User Juri Linkov # Date 1118060864 0 # Node ID 3949ec3f5f5acc4a2f097583548480e71365927b # Parent 095901aead412bc1dbec33400f382653d8809226 (compilation-start): Move `erase-buffer' up before selecting the desired mode to not spend time fontifying old contents. diff -r 095901aead41 -r 3949ec3f5f5a lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Mon Jun 06 12:27:26 2005 +0000 +++ b/lisp/progmodes/compile.el Mon Jun 06 12:27:44 2005 +0000 @@ -935,6 +935,7 @@ (substitute-env-vars (match-string 1 command)) "~") default-directory)) + (erase-buffer) ;; Select the desired mode. (if (not (eq mode t)) (funcall mode) @@ -944,11 +945,11 @@ (if highlight-regexp (set (make-local-variable 'compilation-highlight-regexp) highlight-regexp)) - (erase-buffer) ;; Output a mode setter, for saving and later reloading this buffer. (insert "-*- mode: " name-of-mode "; default-directory: " (prin1-to-string default-directory) - " -*-\n" command "\n") (setq thisdir default-directory)) + " -*-\n" command "\n") + (setq thisdir default-directory)) (set-buffer-modified-p nil)) ;; If we're already in the compilation buffer, go to the end ;; of the buffer, so point will track the compilation output.