]> git.eshelyaron.com Git - emacs.git/commitdiff
* compile.el (recompile): Handle C-u M-x recompile from non-compilation buffer
authorGlenn Morris <rgm@gnu.org>
Fri, 9 May 2014 06:42:39 +0000 (23:42 -0700)
committerGlenn Morris <rgm@gnu.org>
Fri, 9 May 2014 06:42:39 +0000 (23:42 -0700)
Fixes: debbugs:17444
lisp/ChangeLog
lisp/progmodes/compile.el

index 8f3a245e2ada34a0a914e5f7a4a9ed999c758ddb..c1b13e7cebb8dee58f160d6ffa9687ac049cae0f 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        * dired.el (dired-check-switches, dired-switches-recursive-p):
index f6a94e8bf8cc50ee51d79d45e7755002f3acc2e5..30f30dfe83fa1787ac3552c08e50e0207d54d581 100644 (file)
@@ -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.