summaryrefslogtreecommitdiff
path: root/lisp/progmodes/compile.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-05-08 23:42:39 -0700
committerGlenn Morris <rgm@gnu.org>2014-05-08 23:42:39 -0700
commitbb1f4b8f9a0539e57f5fb31c8168950c92aa4492 (patch)
tree0317deae2893b9c12a60178111ffaf85dad9f90f /lisp/progmodes/compile.el
parentc055a50b4a1a0785e4008f80e8724ee16d5cf3cf (diff)
downloademacs-bb1f4b8f9a0539e57f5fb31c8168950c92aa4492.tar.gz
* compile.el (recompile): Handle C-u M-x recompile from non-compilation buffer
Fixes: debbugs:17444
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r--lisp/progmodes/compile.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f6a94e8bf8c..30f30dfe83f 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1430,7 +1430,7 @@ If optional second arg COMINT is t the buffer will be in Comint mode with
`compilation-shell-minor-mode'.
Interactively, prompts for the command if the variable
-`compilation-read-command' is non-nil; otherwise uses`compile-command'.
+`compilation-read-command' is non-nil; otherwise uses `compile-command'.
With prefix arg, always prompts.
Additionally, with universal prefix arg, compilation buffer will be in
comint mode, i.e. interactive.
@@ -1469,12 +1469,13 @@ If the optional argument `edit-command' is non-nil, the command can be edited."
(interactive "P")
(save-some-buffers (not compilation-ask-about-save)
compilation-save-buffers-predicate)
- (let ((default-directory (or compilation-directory default-directory)))
+ (let ((default-directory (or compilation-directory default-directory))
+ (command (eval compile-command)))
(when edit-command
- (setcar compilation-arguments
- (compilation-read-command (car compilation-arguments))))
- (apply 'compilation-start (or compilation-arguments
- `(,(eval compile-command))))))
+ (setq command (compilation-read-command (or (car compilation-arguments)
+ command)))
+ (if compilation-arguments (setcar compilation-arguments command)))
+ (apply 'compilation-start (or compilation-arguments (list command)))))
(defcustom compilation-scroll-output nil
"Non-nil to scroll the *compilation* buffer window as output appears.