emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110083: * lisp/progmodes/compile.el


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110083: * lisp/progmodes/compile.el (compilation-start): Use compilation-always-kill
Date: Tue, 18 Sep 2012 00:18:36 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110083
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12288
author: Martin Blais <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2012-09-18 00:18:36 -0400
message:
  * lisp/progmodes/compile.el (compilation-start): Use compilation-always-kill
  to initialize query-on-exit; then test that instead.
modified:
  lisp/ChangeLog
  lisp/progmodes/compile.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-17 17:38:09 +0000
+++ b/lisp/ChangeLog    2012-09-18 04:18:36 +0000
@@ -1,3 +1,8 @@
+2012-09-18  Martin Blais  <address@hidden>  (tiny change)
+
+       * progmodes/compile.el (compilation-start): Use compilation-always-kill
+       to initialize query-on-exit; then test that instead (bug#12288).
+
 2012-09-17  Stefan Merten  <address@hidden>
 
        * rst.el: Add support for `testcover'.
@@ -1702,7 +1707,7 @@
        :local as the address.
        (list-processes): Doc fix.
 
-2012-08-04  Michal Nazarewicz  <address@hidden>  (tiny change)
+2012-08-04  Michal Nazarewicz  <address@hidden>
 
        * lisp/mpc.el: Support password in host argument.
        (mpc--proc-connect): Parse and use new password element.

=== modified file 'lisp/progmodes/compile.el'
--- a/lisp/progmodes/compile.el 2012-09-16 04:31:02 +0000
+++ b/lisp/progmodes/compile.el 2012-09-18 04:18:36 +0000
@@ -1556,20 +1556,20 @@
              (get-buffer-create
                (compilation-buffer-name name-of-mode mode name-function)))
       (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)))
-               (condition-case ()
-                   (progn
-                     (interrupt-process comp-proc)
-                     (sit-for 1)
-                     (delete-process comp-proc))
-                 (error nil))
-             (error "Cannot have two processes in `%s' at once"
-                    (buffer-name)))))
+      (if comp-proc
+          (if (or (not (eq (process-status comp-proc) 'run))
+                  (eq (process-query-on-exit-flag comp-proc) nil)
+                  (yes-or-no-p
+                   (format "A %s process is running; kill it? "
+                           name-of-mode)))
+              (condition-case ()
+                  (progn
+                    (interrupt-process comp-proc)
+                    (sit-for 1)
+                    (delete-process comp-proc))
+                (error nil))
+            (error "Cannot have two processes in `%s' at once"
+                   (buffer-name)))))
       ;; first transfer directory from where M-x compile was called
       (setq default-directory thisdir)
       ;; Make compilation buffer read-only.  The filter can still write it.
@@ -1624,7 +1624,7 @@
       (let ((process-environment
             (append
              compilation-environment
-             (if (if (boundp 'system-uses-terminfo) ; `if' for compiler warning
+             (if (if (boundp 'system-uses-terminfo);`If' for compiler warning.
                      system-uses-terminfo)
                  (list "TERM=dumb" "TERMCAP="
                        (format "COLUMNS=%d" (window-width)))
@@ -1674,13 +1674,20 @@
                           nil `("-c" ,command))))
                     (start-file-process-shell-command (downcase mode-name)
                                                       outbuf command))))
-             ;; Make the buffer's mode line show process state.
-             (setq mode-line-process
-                   '(:propertize ":%s" face compilation-mode-line-run))
-             (set-process-sentinel proc 'compilation-sentinel)
-             (unless (eq mode t)
-               ;; Keep the comint filter, since it's needed for proper handling
-               ;; of the prompts.
+              ;; Make the buffer's mode line show process state.
+              (setq mode-line-process
+                    '(:propertize ":%s" face compilation-mode-line-run))
+
+              ;; Set the process as killable without query by default.
+              ;; This allows us to start a new compilation without
+              ;; getting prompted.
+              (when compilation-always-kill
+                (set-process-query-on-exit-flag proc nil))
+
+              (set-process-sentinel proc 'compilation-sentinel)
+              (unless (eq mode t)
+                ;; Keep the comint filter, since it's needed for proper
+               ;; handling of the prompts.
                (set-process-filter proc 'compilation-filter))
              ;; Use (point-max) here so that output comes in
              ;; after the initial text,


reply via email to

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