]> git.eshelyaron.com Git - emacs.git/commitdiff
(compilation-revert-buffer): If buffer has a file, revert it in the normal way.
authorRichard M. Stallman <rms@gnu.org>
Mon, 13 Jan 2003 08:02:47 +0000 (08:02 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 13 Jan 2003 08:02:47 +0000 (08:02 +0000)
lisp/progmodes/compile.el

index f202663a0e45fb854c8f0d3806c480eda205d191..a51ceff74d3f2de422b122045db212de82d4b170 100644 (file)
@@ -1245,8 +1245,11 @@ Runs `compilation-mode-hook' with `run-hooks' (which see)."
   (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."