emacs-devel
[Top][All Lists]
Advanced

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

Re: compilation-ask-about-kill


From: Juri Linkov
Subject: Re: compilation-ask-about-kill
Date: Mon, 11 Jan 2010 23:57:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (x86_64-pc-linux-gnu)

> It would be nice to allow recompilation with a single key stroke even
> if the previous compilation hangs. With the following patch the user
> can skip
>
>  `A ... process is running; kill it?'
>
> if he set `compilation-ask-about-kill' to nil.

Instead of adding a new defcustom, it would be better to use the
existing feature created for this purpose.

As the docstring of `compilation-start-hook' suggests using
the following code when you do not want a question about killing
the compilation:

  (add-hook 'compilation-start-hook
            (lambda (process)
              (set-process-query-on-exit-flag process nil)))

I think a query in `compilation-start' should respect this user setting,
because when the user decides that the running process should be killed
without quering, then it has no difference whether the process is killed
by killing the process buffer with `C-x k'/`C-x C-c', or with running
a new compilation:

=== modified file 'lisp/progmodes/compile.el'
--- lisp/progmodes/compile.el   2010-01-09 21:14:50 +0000
+++ lisp/progmodes/compile.el   2010-01-11 21:56:48 +0000
@@ -1197,6 +1197,7 @@
       (let ((comp-proc (get-buffer-process (current-buffer))))
        (if comp-proc
            (if (or (not (eq (process-status comp-proc) 'run))
+                   (not (process-query-on-exit-flag comp-proc))
                    (yes-or-no-p
                     (format "A %s process is running; kill it? "
                             name-of-mode)))

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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