From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Blais Newsgroups: gmane.emacs.bugs Subject: bug#12288: 24.2.50; compilation-start: Query for killing existing compilation process only if query-on-exit-flag is non-nil Date: Tue, 04 Sep 2012 21:50:58 -0400 Message-ID: <1346809858.17060.140661123723789.284FF9D1@webmail.messagingengine.com> References: <87ehms759q@ch.ristopher.com> <874nnit3f9@ch.ristopher.com> <1346512261.21458.140661122378029.2F7185E7@webmail.messagingengine.com> <87y5kt92yp@ch.ristopher.com> <1346523470.14751.140661122426041.16CA21FC@webmail.messagingengine.com> <87wr0d2p99@ch.ristopher.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1346809925 2547 80.91.229.3 (5 Sep 2012 01:52:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2012 01:52:05 +0000 (UTC) Cc: christopher@ch.ristopher.com, 12288@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 05 03:52:07 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T94mk-00056b-EE for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Sep 2012 03:52:06 +0200 Original-Received: from localhost ([::1]:53356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T94mh-0007OP-Ar for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Sep 2012 21:52:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T94me-0007OF-5C for bug-gnu-emacs@gnu.org; Tue, 04 Sep 2012 21:52:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T94mc-0002Sp-TP for bug-gnu-emacs@gnu.org; Tue, 04 Sep 2012 21:52:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T94mc-0002Sj-PW for bug-gnu-emacs@gnu.org; Tue, 04 Sep 2012 21:51:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T94mg-0007S1-20 for bug-gnu-emacs@gnu.org; Tue, 04 Sep 2012 21:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Martin Blais Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Sep 2012 01:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12288 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, Christopher Schmidt Original-Received: via spool by submit@debbugs.gnu.org id=B.134680987328585 (code B ref -1); Wed, 05 Sep 2012 01:52:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Sep 2012 01:51:13 +0000 Original-Received: from localhost ([127.0.0.1]:39155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T94lt-0007R0-8K for submit@debbugs.gnu.org; Tue, 04 Sep 2012 21:51:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47361) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T94lo-0007Qo-91 for submit@debbugs.gnu.org; Tue, 04 Sep 2012 21:51:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T94lj-00027u-GC for submit@debbugs.gnu.org; Tue, 04 Sep 2012 21:51:04 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:34697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T94lj-00027q-Cv for submit@debbugs.gnu.org; Tue, 04 Sep 2012 21:51:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T94li-0007N7-75 for bug-gnu-emacs@gnu.org; Tue, 04 Sep 2012 21:51:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T94lg-00026O-UM for bug-gnu-emacs@gnu.org; Tue, 04 Sep 2012 21:51:02 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T94lg-00026K-MN for bug-gnu-emacs@gnu.org; Tue, 04 Sep 2012 21:51:00 -0400 Original-Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 91FA420A41; Tue, 4 Sep 2012 21:50:58 -0400 (EDT) Original-Received: from betaweb1.nyi.mail.srv.osa ([10.202.2.10]) by compute4.internal (MEProxy); Tue, 04 Sep 2012 21:50:58 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:cc:mime-version :content-transfer-encoding:content-type:subject:date:in-reply-to :references; s=smtpout; bh=uTVt9xczXAvnOlqyh7ECBaiy4hk=; b=dy84y VCNuG4v7VcN8EaQ9yhlyn3tRsk2GMqPe1whxs+X8WrGBVZ11R40xe1H99qCvgH3x 85Za70wuPTBJ/B/Y8u6uTxJseDHfFuojhkurxP83BYediCdtxZfhbYQrorX//0b5 YnLQ5vw0ovr5KZdApA7qExtYI3QyPQ34PKqaIE= Original-Received: by betaweb1.nyi.mail.srv.osa (Postfix, from userid 99) id 4F17A62B46E; Tue, 4 Sep 2012 21:50:58 -0400 (EDT) X-Sasl-Enc: P31zxpjoicHi2dgVYFud2mG2lAnMOq4mWo/+57dW0pT2 1346809858 X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <87wr0d2p99@ch.ristopher.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63752 Archived-At: 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 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