changeset 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 aaa6f44a1b96
children a882905d8a96
files lisp/progmodes/compile.el
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
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'."