Commit bb1f4b8f authored by Glenn Morris's avatar Glenn Morris
Browse files

* compile.el (recompile): Handle C-u M-x recompile from non-compilation buffer

Fixes: debbugs:17444
parent c055a50b
2014-05-09 Glenn Morris <rgm@gnu.org>
* progmodes/compile.el (recompile):
Handle C-u M-x recompile from a non-compilation buffer. (Bug#17444)
2014-05-08 Juri Linkov <juri@jurta.org> 2014-05-08 Juri Linkov <juri@jurta.org>
* dired.el (dired-check-switches, dired-switches-recursive-p): * dired.el (dired-check-switches, dired-switches-recursive-p):
......
...@@ -1430,7 +1430,7 @@ If optional second arg COMINT is t the buffer will be in Comint mode with ...@@ -1430,7 +1430,7 @@ If optional second arg COMINT is t the buffer will be in Comint mode with
`compilation-shell-minor-mode'. `compilation-shell-minor-mode'.
Interactively, prompts for the command if the variable 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. With prefix arg, always prompts.
Additionally, with universal prefix arg, compilation buffer will be in Additionally, with universal prefix arg, compilation buffer will be in
comint mode, i.e. interactive. comint mode, i.e. interactive.
...@@ -1469,12 +1469,13 @@ If the optional argument `edit-command' is non-nil, the command can be edited." ...@@ -1469,12 +1469,13 @@ If the optional argument `edit-command' is non-nil, the command can be edited."
(interactive "P") (interactive "P")
(save-some-buffers (not compilation-ask-about-save) (save-some-buffers (not compilation-ask-about-save)
compilation-save-buffers-predicate) 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 (when edit-command
(setcar compilation-arguments (setq command (compilation-read-command (or (car compilation-arguments)
(compilation-read-command (car compilation-arguments)))) command)))
(apply 'compilation-start (or compilation-arguments (if compilation-arguments (setcar compilation-arguments command)))
`(,(eval compile-command)))))) (apply 'compilation-start (or compilation-arguments (list command)))))
(defcustom compilation-scroll-output nil (defcustom compilation-scroll-output nil
"Non-nil to scroll the *compilation* buffer window as output appears. "Non-nil to scroll the *compilation* buffer window as output appears.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment