# HG changeset patch # User Richard M. Stallman # Date 1005711825 0 # Node ID 5dd37d315c3340945ec644fb84ae3ab7ae6e2faa # Parent aaa6f44a1b96c29fd64a9fa919722ee33ce03837 (recompile): Use compilation-arguments if set, so as to be able to M-x recompile the exact command which created a compilation-mode buffer. diff -r aaa6f44a1b96 -r 5dd37d315c33 lisp/progmodes/compile.el --- 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'."