aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Blais2012-09-18 00:18:36 -0400
committerStefan Monnier2012-09-18 00:18:36 -0400
commita11035b8cd0ef80bc118cc97be53373b36475da0 (patch)
treeb6d7965e4fec480464b9750f778f36b042ebeeb3
parentd3612ac370d4b1378997d1c8344b24cf34add8fe (diff)
downloademacs-a11035b8cd0ef80bc118cc97be53373b36475da0.tar.gz
emacs-a11035b8cd0ef80bc118cc97be53373b36475da0.zip
* lisp/progmodes/compile.el (compilation-start): Use compilation-always-kill
to initialize query-on-exit; then test that instead. Fixes: debbugs:12288
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/progmodes/compile.el51
2 files changed, 35 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7ceacc5291d..c1c9e5ee1c8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-09-18 Martin Blais <blais@furius.ca> (tiny change)
2
3 * progmodes/compile.el (compilation-start): Use compilation-always-kill
4 to initialize query-on-exit; then test that instead (bug#12288).
5
12012-09-17 Stefan Merten <smerten@oekonux.de> 62012-09-17 Stefan Merten <smerten@oekonux.de>
2 7
3 * rst.el: Add support for `testcover'. 8 * rst.el: Add support for `testcover'.
@@ -1702,7 +1707,7 @@
1702 :local as the address. 1707 :local as the address.
1703 (list-processes): Doc fix. 1708 (list-processes): Doc fix.
1704 1709
17052012-08-04 Michal Nazarewicz <mina86@mina86.com> (tiny change) 17102012-08-04 Michal Nazarewicz <mina86@mina86.com>
1706 1711
1707 * lisp/mpc.el: Support password in host argument. 1712 * lisp/mpc.el: Support password in host argument.
1708 (mpc--proc-connect): Parse and use new password element. 1713 (mpc--proc-connect): Parse and use new password element.
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f5dedf0cd59..95b8758ba80 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1556,20 +1556,20 @@ Returns the compilation buffer created."
1556 (get-buffer-create 1556 (get-buffer-create
1557 (compilation-buffer-name name-of-mode mode name-function))) 1557 (compilation-buffer-name name-of-mode mode name-function)))
1558 (let ((comp-proc (get-buffer-process (current-buffer)))) 1558 (let ((comp-proc (get-buffer-process (current-buffer))))
1559 (if comp-proc 1559 (if comp-proc
1560 (if (or (not (eq (process-status comp-proc) 'run)) 1560 (if (or (not (eq (process-status comp-proc) 'run))
1561 compilation-always-kill 1561 (eq (process-query-on-exit-flag comp-proc) nil)
1562 (yes-or-no-p 1562 (yes-or-no-p
1563 (format "A %s process is running; kill it? " 1563 (format "A %s process is running; kill it? "
1564 name-of-mode))) 1564 name-of-mode)))
1565 (condition-case () 1565 (condition-case ()
1566 (progn 1566 (progn
1567 (interrupt-process comp-proc) 1567 (interrupt-process comp-proc)
1568 (sit-for 1) 1568 (sit-for 1)
1569 (delete-process comp-proc)) 1569 (delete-process comp-proc))
1570 (error nil)) 1570 (error nil))
1571 (error "Cannot have two processes in `%s' at once" 1571 (error "Cannot have two processes in `%s' at once"
1572 (buffer-name))))) 1572 (buffer-name)))))
1573 ;; first transfer directory from where M-x compile was called 1573 ;; first transfer directory from where M-x compile was called
1574 (setq default-directory thisdir) 1574 (setq default-directory thisdir)
1575 ;; Make compilation buffer read-only. The filter can still write it. 1575 ;; Make compilation buffer read-only. The filter can still write it.
@@ -1624,7 +1624,7 @@ Returns the compilation buffer created."
1624 (let ((process-environment 1624 (let ((process-environment
1625 (append 1625 (append
1626 compilation-environment 1626 compilation-environment
1627 (if (if (boundp 'system-uses-terminfo) ; `if' for compiler warning 1627 (if (if (boundp 'system-uses-terminfo);`If' for compiler warning.
1628 system-uses-terminfo) 1628 system-uses-terminfo)
1629 (list "TERM=dumb" "TERMCAP=" 1629 (list "TERM=dumb" "TERMCAP="
1630 (format "COLUMNS=%d" (window-width))) 1630 (format "COLUMNS=%d" (window-width)))
@@ -1674,13 +1674,20 @@ Returns the compilation buffer created."
1674 nil `("-c" ,command)))) 1674 nil `("-c" ,command))))
1675 (start-file-process-shell-command (downcase mode-name) 1675 (start-file-process-shell-command (downcase mode-name)
1676 outbuf command)))) 1676 outbuf command))))
1677 ;; Make the buffer's mode line show process state. 1677 ;; Make the buffer's mode line show process state.
1678 (setq mode-line-process 1678 (setq mode-line-process
1679 '(:propertize ":%s" face compilation-mode-line-run)) 1679 '(:propertize ":%s" face compilation-mode-line-run))
1680 (set-process-sentinel proc 'compilation-sentinel) 1680
1681 (unless (eq mode t) 1681 ;; Set the process as killable without query by default.
1682 ;; Keep the comint filter, since it's needed for proper handling 1682 ;; This allows us to start a new compilation without
1683 ;; of the prompts. 1683 ;; getting prompted.
1684 (when compilation-always-kill
1685 (set-process-query-on-exit-flag proc nil))
1686
1687 (set-process-sentinel proc 'compilation-sentinel)
1688 (unless (eq mode t)
1689 ;; Keep the comint filter, since it's needed for proper
1690 ;; handling of the prompts.
1684 (set-process-filter proc 'compilation-filter)) 1691 (set-process-filter proc 'compilation-filter))
1685 ;; Use (point-max) here so that output comes in 1692 ;; Use (point-max) here so that output comes in
1686 ;; after the initial text, 1693 ;; after the initial text,