diff lisp/progmodes/compile.el @ 41037:5dd37d315c33

(recompile): Use compilation-arguments if set, so as to be able to M-x recompile the exact command which created a compilation-mode buffer.
author Richard M. Stallman <rms@gnu.org>
date Wed, 14 Nov 2001 04:23:45 +0000
parents 95bf86aa6120
children ab6cfeb406ab
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Wed Nov 14 03:49:57 2001 +0000
+++ b/lisp/progmodes/compile.el	Wed Nov 14 04:23:45 2001 +0000
@@ -580,10 +580,13 @@
 
 ;; run compile with the default command line
 (defun recompile ()
-  "Re-compile the program including the current buffer."
+  "Re-compile the program including the current buffer.
+If this is run in a compilation-mode buffer, re-use the arguments from the
+original use.  Otherwise, it recompiles using `compile-command'."
   (interactive)
   (save-some-buffers (not compilation-ask-about-save) nil)
-  (compile-internal (eval compile-command) "No more errors"))
+  (apply 'compile-internal (or compilation-arguments
+			      `(,(eval compile-command) "No more errors"))))
 
 (defun grep-process-setup ()
   "Set up `compilation-exit-message-function' for `grep'."