* lisp/progmodes/compile.el (compilation-always-kill): New var.
authorMartin Blais <blais@furius.ca>
Wed, 29 Aug 2012 18:15:12 +0000 (14:15 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 29 Aug 2012 18:15:12 +0000 (14:15 -0400)
(compilation-start): Use it.

etc/NEWS
lisp/ChangeLog
lisp/progmodes/compile.el

index 1da3931..e17846c 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -207,6 +207,8 @@ It copies the region-rectangle as the last rectangle kill.
 \f
 * Changes in Specialized Modes and Packages in Emacs 24.3
 
+** Compilation has a new `compilation-always-kill' configuration variable.
+
 ** Term changes
 
 The variables `term-default-fg-color' and `term-default-bg-color' are
index 64ccde6..0fd323a 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-29  Martin Blais  <blais@furius.ca>  (tiny change)
+
+       * progmodes/compile.el (compilation-always-kill): New var.
+       (compilation-start): Use it.
+
 2012-08-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * simple.el (read-only-mode): Move from files.el for bootstrapping.
index eb966e8..83f31d5 100644 (file)
@@ -1503,6 +1503,13 @@ Otherwise, construct a buffer name from NAME-OF-MODE."
     (compilation-start command nil name-function highlight-regexp)))
 (make-obsolete 'compile-internal 'compilation-start "22.1")
 
+(defcustom compilation-always-kill nil
+  "If nil, ask to kill compilation. If 't, always kill an
+incomplete compilation before starting a new one."
+  :type 'boolean
+  :version "24.3"
+  :group 'compilation)
+
 ;;;###autoload
 (defun compilation-start (command &optional mode name-function highlight-regexp)
   "Run compilation command COMMAND (low level interface).
@@ -1537,6 +1544,7 @@ Returns the compilation buffer created."
       (let ((comp-proc (get-buffer-process (current-buffer))))
        (if comp-proc
            (if (or (not (eq (process-status comp-proc) 'run))
+                    compilation-always-kill
                    (yes-or-no-p
                     (format "A %s process is running; kill it? "
                             name-of-mode)))