* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
@ 2012-08-27 14:56 Christopher Schmidt
2012-09-01 10:58 ` Christopher Schmidt
0 siblings, 1 reply; 10+ messages in thread
From: Christopher Schmidt @ 2012-08-27 14:56 UTC (permalink / raw)
To: 12288
[-- Attachment #1: Type: text/plain, Size: 204 bytes --]
Severity: wishlist
I find it annoying that compilation-start always asks before killing
the previous (running) compilation process. I think
process-query-on-exit-flag should be taken into account here.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: compilation-start.diff --]
[-- Type: text/x-diff, Size: 940 bytes --]
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2012-08-27 09:05:55 +0000
+++ lisp/ChangeLog 2012-08-27 14:48:56 +0000
@@ -1,3 +1,9 @@
+2012-08-27 Christopher Schmidt <christopher@ch.ristopher.com>
+
+ * progmodes/compile.el (compilation-start): Query for killing
+ existing compilation process only if query-on-exit-flag is non-nil
+ (Bug#).
+
2012-08-27 Drew Adams <drew.adams@oracle.com>
* dired.el (dired-pop-to-buffer): Make window start at beginning
=== modified file 'lisp/progmodes/compile.el'
--- lisp/progmodes/compile.el 2012-08-26 13:42:18 +0000
+++ lisp/progmodes/compile.el 2012-08-27 14:47:23 +0000
@@ -1537,6 +1537,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)))
[-- Attachment #3: Type: text/plain, Size: 21 bytes --]
Christopher
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
2012-08-27 14:56 bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil Christopher Schmidt
@ 2012-09-01 10:58 ` Christopher Schmidt
2012-09-01 12:32 ` Stefan Monnier
2012-09-01 15:11 ` Martin Blais
0 siblings, 2 replies; 10+ messages in thread
From: Christopher Schmidt @ 2012-09-01 10:58 UTC (permalink / raw)
To: 12288; +Cc: Martin Blais
Christopher Schmidt <christopher@ch.ristopher.com> writes:
> I find it annoying that compilation-start always asks before killing
> the previous (running) compilation process. I think
> process-query-on-exit-flag should be taken into account here.
Revno 109813 introduces variable compilation-always-kill which, if
non-nil, unconditionally removes the query for killing the compilation
process.
This variable does not help me as occasionally I want to be asked
whether I would like to kill the compilation process.
Can both compilation-always-kill and query-on-exit-flag be taken into
account?
Christopher
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
2012-09-01 10:58 ` Christopher Schmidt
@ 2012-09-01 12:32 ` Stefan Monnier
2012-09-01 12:45 ` Christopher Schmidt
2012-09-01 15:11 ` Martin Blais
1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2012-09-01 12:32 UTC (permalink / raw)
To: 12288; +Cc: Martin Blais
> This variable does not help me as occasionally I want to be asked
> whether I would like to kill the compilation process.
Would setting the variable buffer-locally solve that problem?
Stefan
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
2012-09-01 12:32 ` Stefan Monnier
@ 2012-09-01 12:45 ` Christopher Schmidt
0 siblings, 0 replies; 10+ messages in thread
From: Christopher Schmidt @ 2012-09-01 12:45 UTC (permalink / raw)
To: 12288-done
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> This variable does not help me as occasionally I want to be asked
>> whether I would like to kill the compilation process.
>
> Would setting the variable buffer-locally solve that problem?
It does.
Christopher
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
2012-09-01 10:58 ` Christopher Schmidt
2012-09-01 12:32 ` Stefan Monnier
@ 2012-09-01 15:11 ` Martin Blais
2012-09-01 15:29 ` Christopher Schmidt
1 sibling, 1 reply; 10+ messages in thread
From: Martin Blais @ 2012-09-01 15:11 UTC (permalink / raw)
To: christopher, 12288
I'm not sure I understand. Let's recap a bit:
a. in 'compilation-start-hook, there's a hint that you can force the
process-query-on-exit-flag on the compile process; that would presumably
allow you to kill the buffer without a query, but not on a subsequent call to
compile. (BTW I just tried the suggested hook as is and it doesn't work for
me, but that's another issue).
b. compilation-always-kill can now be set to 't to suppress the query on another
invocation to compile. Note that the new variable does not change the current
behaviour, the default value is to ask. This should not affect what happens
when you try to kill the buffer on a running process.
So I don't understand the question. Which of the events are you referring to?
(a) or (b)?
And if (b), given that the variable does not change the behaviour, what do you
mean?
On Sat, Sep 1, 2012, at 06:58, Christopher Schmidt wrote:
> Christopher Schmidt <christopher@ch.ristopher.com> writes:
> > I find it annoying that compilation-start always asks before killing
> > the previous (running) compilation process. I think
> > process-query-on-exit-flag should be taken into account here.
>
> Revno 109813 introduces variable compilation-always-kill which, if
> non-nil, unconditionally removes the query for killing the compilation
> process.
>
> This variable does not help me as occasionally I want to be asked
> whether I would like to kill the compilation process.
>
> Can both compilation-always-kill and query-on-exit-flag be taken into
> account?
>
> Christopher
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
2012-09-01 15:11 ` Martin Blais
@ 2012-09-01 15:29 ` Christopher Schmidt
2012-09-01 18:17 ` Martin Blais
0 siblings, 1 reply; 10+ messages in thread
From: Christopher Schmidt @ 2012-09-01 15:29 UTC (permalink / raw)
To: Martin Blais; +Cc: 12288
Martin Blais <blais@furius.ca> writes:
> I'm not sure I understand. Let's recap a bit:
>
> a. in 'compilation-start-hook, there's a hint that you can force the
> process-query-on-exit-flag on the compile process; that would
> presumably allow you to kill the buffer without a query, but not on a
^^^^^^^^^^^^
> subsequent call to compile. (BTW I just tried the suggested hook as is
^^^^^^^^^^^^^^^^^^^^^^^^^^
> and it doesn't work for me, but that's another issue).
This is exactly what I don't want.
Those processes that have a nil query-on-exit-flag should be killed by
compilation-start without a yes-or-no query. A buffer-local non-nil
value for compilation-always-kill allows me to achieve that.
I still think a check for query-on-exit-flag in compilation-start is a
good idea. Non-nil query-on-exit-flag and non-nil buffer-local
compilation-always-kill feels redundant, doesn't it?
Christopher
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
2012-09-01 15:29 ` Christopher Schmidt
@ 2012-09-01 18:17 ` Martin Blais
2012-09-02 1:21 ` Christopher Schmidt
0 siblings, 1 reply; 10+ messages in thread
From: Martin Blais @ 2012-09-01 18:17 UTC (permalink / raw)
To: Christopher Schmidt; +Cc: 12288
On Sat, Sep 1, 2012, at 11:29, Christopher Schmidt wrote:
> Martin Blais <blais@furius.ca> writes:
> > I'm not sure I understand. Let's recap a bit:
> >
> > a. in 'compilation-start-hook, there's a hint that you can force the
> > process-query-on-exit-flag on the compile process; that would
> > presumably allow you to kill the buffer without a query, but not on a
> ^^^^^^^^^^^^
> > subsequent call to compile. (BTW I just tried the suggested hook as is
> ^^^^^^^^^^^^^^^^^^^^^^^^^^
> > and it doesn't work for me, but that's another issue).
>
> This is exactly what I don't want.
>
> Those processes that have a nil query-on-exit-flag should be killed by
> compilation-start without a yes-or-no query. A buffer-local non-nil
> value for compilation-always-kill allows me to achieve that.
>
> I still think a check for query-on-exit-flag in compilation-start is a
> good idea. Non-nil query-on-exit-flag and non-nil buffer-local
> compilation-always-kill feels redundant, doesn't it?
Maybe what we should do is this (just an idea, not sure if it'll make sense to
you):
1. Make the compile code check the process-query-on-exit-flag instead of the
compilation-always-kill variable. This would simplify matters, in that
there's a single flag that decides whether to kill the running process, and
it's the same flag that's already being used for when you kill a buffer. One
thing.
2. Provide a way to set the default value of process-query-on-exit-flag on
compile subprocesses easier than the hook/comment. Suppressing the ask on
recompile is a very common desire BTW--some people have packages to do just
that--and IMO being able to customize this via a dedicated variable is
valuable.
What do you think?
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
2012-09-01 18:17 ` Martin Blais
@ 2012-09-02 1:21 ` Christopher Schmidt
2012-09-05 1:50 ` Martin Blais
0 siblings, 1 reply; 10+ messages in thread
From: Christopher Schmidt @ 2012-09-02 1:21 UTC (permalink / raw)
To: Martin Blais; +Cc: 12288
Martin Blais <blais@furius.ca> writes:
> On Sat, Sep 1, 2012, at 11:29, Christopher Schmidt wrote:
>> Those processes that have a nil query-on-exit-flag should be killed
>> by compilation-start without a yes-or-no query. A buffer-local
>> non-nil value for compilation-always-kill allows me to achieve that.
>>
>> I still think a check for query-on-exit-flag in compilation-start is
>> a good idea. Non-nil query-on-exit-flag and non-nil buffer-local
>> compilation-always-kill feels redundant, doesn't it?
>
> Maybe what we should do is this (just an idea, not sure if it'll make
> sense to you):
>
> 1. Make the compile code check the process-query-on-exit-flag instead
> of the compilation-always-kill variable. This would simplify matters,
> in that there's a single flag that decides whether to kill the running
> process, and it's the same flag that's already being used for when you
> kill a buffer. One thing.
>
> 2. Provide a way to set the default value of
> process-query-on-exit-flag on compile subprocesses easier than the
> hook/comment. Suppressing the ask on recompile is a very common desire
> BTW--some people have packages to do just that--and IMO being able to
> customize this via a dedicated variable is valuable.
>
> What do you think?
This is IMO a lot more intuitive than having a variable that
unconditionally removes the prompt. I'd go for it.
Christopher
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
2012-09-02 1:21 ` Christopher Schmidt
@ 2012-09-05 1:50 ` Martin Blais
2012-09-18 4:19 ` Stefan Monnier
0 siblings, 1 reply; 10+ messages in thread
From: Martin Blais @ 2012-09-05 1:50 UTC (permalink / raw)
To: Stefan Monnier; +Cc: christopher, 12288
Salut Stef,
Here is a new patch for compile.el that has the change as described by
Christopher. "compilation-always-kill" is consulted to initialize the
process-query-on-exit-flag when creating a new process, and the
process flag is examined when deciding to query to kill the running
process or not.
=== modified file 'lisp/progmodes/compile.el'
*** lisp/progmodes/compile.el 2012-08-30 08:22:24 +0000
--- lisp/progmodes/compile.el 2012-09-04 18:38:00 +0000
***************
*** 1544,1550 ****
(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)))
--- 1544,1550 ----
(let ((comp-proc (get-buffer-process (current-buffer))))
(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)))
***************
*** 1663,1668 ****
--- 1663,1675 ----
;; 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
On Sat, Sep 1, 2012, at 21:21, Christopher Schmidt wrote:
> Martin Blais <blais@furius.ca> writes:
> > On Sat, Sep 1, 2012, at 11:29, Christopher Schmidt wrote:
> >> Those processes that have a nil query-on-exit-flag should be killed
> >> by compilation-start without a yes-or-no query. A buffer-local
> >> non-nil value for compilation-always-kill allows me to achieve that.
> >>
> >> I still think a check for query-on-exit-flag in compilation-start is
> >> a good idea. Non-nil query-on-exit-flag and non-nil buffer-local
> >> compilation-always-kill feels redundant, doesn't it?
> >
> > Maybe what we should do is this (just an idea, not sure if it'll make
> > sense to you):
> >
> > 1. Make the compile code check the process-query-on-exit-flag instead
> > of the compilation-always-kill variable. This would simplify matters,
> > in that there's a single flag that decides whether to kill the running
> > process, and it's the same flag that's already being used for when you
> > kill a buffer. One thing.
> >
> > 2. Provide a way to set the default value of
> > process-query-on-exit-flag on compile subprocesses easier than the
> > hook/comment. Suppressing the ask on recompile is a very common desire
> > BTW--some people have packages to do just that--and IMO being able to
> > customize this via a dedicated variable is valuable.
> >
> > What do you think?
>
> This is IMO a lot more intuitive than having a variable that
> unconditionally removes the prompt. I'd go for it.
>
> Christopher
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil
2012-09-05 1:50 ` Martin Blais
@ 2012-09-18 4:19 ` Stefan Monnier
0 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2012-09-18 4:19 UTC (permalink / raw)
To: Martin Blais; +Cc: 12288-done
> Here is a new patch for compile.el that has the change as described by
> Christopher. "compilation-always-kill" is consulted to initialize the
> process-query-on-exit-flag when creating a new process, and the
> process flag is examined when deciding to query to kill the running
> process or not.
Thanks Martin, installed,
Setfan
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-09-18 4:19 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 14:56 bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil Christopher Schmidt
2012-09-01 10:58 ` Christopher Schmidt
2012-09-01 12:32 ` Stefan Monnier
2012-09-01 12:45 ` Christopher Schmidt
2012-09-01 15:11 ` Martin Blais
2012-09-01 15:29 ` Christopher Schmidt
2012-09-01 18:17 ` Martin Blais
2012-09-02 1:21 ` Christopher Schmidt
2012-09-05 1:50 ` Martin Blais
2012-09-18 4:19 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.