From abed526746f69a5524df703f362d12f348b236ad Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 6 Jun 2005 12:27:44 +0000 Subject: [PATCH] (compilation-start): Move `erase-buffer' up before selecting the desired mode to not spend time fontifying old contents. --- lisp/progmodes/compile.el | 5 +++-- 1 file 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." (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 @@ Returns the compilation buffer created." (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. -- 2.39.5