changeset 49186:ce4ad428dcab

(compilation-revert-buffer): If buffer has a file, revert it in the normal way.
author Richard M. Stallman <rms@gnu.org>
date Mon, 13 Jan 2003 08:02:47 +0000
parents d2cbeb3c7b3d
children c9f452e277ea
files lisp/progmodes/compile.el
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Mon Jan 13 08:01:54 2003 +0000
+++ b/lisp/progmodes/compile.el	Mon Jan 13 08:02:47 2003 +0000
@@ -1245,8 +1245,11 @@
   (run-hooks 'compilation-mode-hook))
 
 (defun compilation-revert-buffer (ignore-auto noconfirm)
-  (if (or noconfirm (yes-or-no-p (format "Restart compilation? ")))
-      (apply 'compile-internal compilation-arguments)))
+  (if buffer-file-name
+      (let (revert-buffer-function)
+	(revert-buffer ignore-auto noconfirm preserve-modes))
+    (if (or noconfirm (yes-or-no-p (format "Restart compilation? ")))
+	(apply 'compile-internal compilation-arguments))))
 
 (defun compilation-setup ()
   "Prepare the buffer for the compilation parsing commands to work."