[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17444: 24.3; cannot C-u M-x recompile (interactively) from outside *

From: Glenn Morris
Subject: bug#17444: 24.3; cannot C-u M-x recompile (interactively) from outside *compilation* buffer.
Date: Fri, 09 May 2014 02:46:21 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Version: 24.3.91

"B. L." wrote:

> Running C-u M-x recompile outside of the *compilation* buffer produces
> error:
> call-interactively: Wrong type argument: consp, nil

AFAICS, it doesn't make any sense to use `C-u M-x recompile' outside of a
compilation buffer, because it's the same as running `M-x compile'.
But I applied the following:

--- a/lisp/progmodes/compile.el 2014-02-10 01:34:22 +0000
+++ b/lisp/progmodes/compile.el 2014-05-09 06:42:39 +0000
@@ -1469,12 +1469,13 @@
   (interactive "P")
   (save-some-buffers (not compilation-ask-about-save)
-  (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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]