From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Reuben Thomas Newsgroups: gmane.emacs.bugs Subject: bug#18133: Suppressing asynchronous command output Date: Fri, 23 Dec 2016 21:07:37 +0000 Message-ID: References: <83zijp180n.fsf@gnu.org> <83eg100vy5.fsf@gnu.org> <585C132B.1030709@gmx.at> <585C347D.9050309@gmx.at> <585D740B.40303@gmx.at> <585D8120.1090300@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113e46fe9552bc054459c642 X-Trace: blaine.gmane.org 1482527298 16916 195.159.176.226 (23 Dec 2016 21:08:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Dec 2016 21:08:18 +0000 (UTC) Cc: 18133@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 23 22:08:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKX4S-00039S-SU for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 22:08:09 +0100 Original-Received: from localhost ([::1]:40904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKX4X-0007bA-78 for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 16:08:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKX4Q-0007au-35 for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 16:08:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKX4M-00011l-31 for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 16:08:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37629) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cKX4M-00011g-0J for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 16:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cKX4L-0003aN-OH for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 16:08:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Reuben Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2016 21:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18133 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18133-submit@debbugs.gnu.org id=B18133.148252726513756 (code B ref 18133); Fri, 23 Dec 2016 21:08:01 +0000 Original-Received: (at 18133) by debbugs.gnu.org; 23 Dec 2016 21:07:45 +0000 Original-Received: from localhost ([127.0.0.1]:53028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKX45-0003Zo-7l for submit@debbugs.gnu.org; Fri, 23 Dec 2016 16:07:45 -0500 Original-Received: from mail-qt0-f175.google.com ([209.85.216.175]:34799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKX43-0003Za-FT for 18133@debbugs.gnu.org; Fri, 23 Dec 2016 16:07:43 -0500 Original-Received: by mail-qt0-f175.google.com with SMTP id d45so47973370qta.1 for <18133@debbugs.gnu.org>; Fri, 23 Dec 2016 13:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uO7swVzVcdNTMvhJA9rowFZK/MLCMUYQm3PLzgBDYBQ=; b=TcachSiKEwwpDC5bazhUD6YX/GbTYTRDFnNJSyZ3ftcnkBy1ssZTkCFRV8r94f3krB cFz1mfk2nZbm2gWDzgYdAPLeM6N0jSwiKc3ZMLe8nAvXS1uQPQUFM5LYzSsYxda/gmGE qqaO1e75j2gM5QCIFhA8yz9/Ri3nUjAicoPUY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uO7swVzVcdNTMvhJA9rowFZK/MLCMUYQm3PLzgBDYBQ=; b=RL4PF8kZAwWyQjrG38oQZ4rbtPujegSVYcxuCw0JDVH43KpZpPz1RPfTloe6HNBlzp oyyK1lk3PJwKhUpDztwXbmEp4CM2fam1MdIOxxbR508bHUSU5KjDBwCxrpqOEkLuyz5m dZh8NOpc/teoJT/B82dOUNFlip5tfcJ7dJBcuHClGWs9srqdBWMMzN/o+nd0YuGJA5nR OdqRpDQjzp/2ISFGRoV+KBzKkovNmgVdTReA90X1xNdtwxbV+4PnMRRwaHMpmfjr0vZe +PcZDupvXJdymkcMyIyLUJq8FDXaNE+b8iLa9BCT0A+kYY3Y6OhovA+zluZlTgiEUzQH wD9w== X-Gm-Message-State: AIkVDXLyJ/yfP9cYVIzugllL6sUoKM3X884jerP2ekeqqnKN1Vi+TGvi5plvQhMkWb7Zml7h2vUZwbAvDT1IHFCP X-Received: by 10.237.33.173 with SMTP id l42mr16122148qtc.271.1482527257991; Fri, 23 Dec 2016 13:07:37 -0800 (PST) Original-Received: by 10.140.88.51 with HTTP; Fri, 23 Dec 2016 13:07:37 -0800 (PST) In-Reply-To: <585D8120.1090300@gmx.at> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:127381 Archived-At: --001a113e46fe9552bc054459c642 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 23 December 2016 at 19:55, martin rudalics wrote: > =E2=80=8B=E2=80=8B > > Isn't this much more than changing the way =E2=80=98display-buffer=E2=80= =99 behaves? > IIUC, you want the buffer to pop up whenever some output arrives, the > user should be allowed to delete the window, and when new output arrives > the buffer should pop up again. Correct? Here is the implementation I currently use (from Juri Linkov, message #8, second block of code): (advice-add 'comint-output-filter :after "Stop Async Shell Command output from appearing until there is output." (lambda (process string) (when (and (string-match-p "\\*Async Shell Command\\*" (buffer-name (process-buffer process)))) (display-buffer (process-buffer process))))) I think this does what you say: whenever some output arrives, the buffer pops up. It does not involve changing the behaviour of display-buffer. All my patch does is move the advice into a function suitable for comint-output-filter-functions. But I'm still confused by how you > want to add something to =E2=80=98display-buffer-alist=E2=80=99 and at th= e same time to > not change the behavior of =E2=80=98display-buffer=E2=80=99 ;-) =E2=80=8B I suggested adding an option to display-buffer-alist's defcustom specification, something like: :options (((regexp "\\*Async Shell Command\\*") (function display-buffer-no-window))) By default, this is not selected, so it does not change the default behaviour. I currently simply add an item to display-buffer-alist: (add-to-list 'display-buffer-alist '("\\*Async Shell Command\\*" display-buffer-no-window)) --=20 http://rrt.sc3d.org --001a113e46fe9552bc054459c642 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On = 23 December 2016 at 19:55, martin rudalics <rudalics@gmx.at> w= rote:
=E2=80=8B=E2=80=8B

Isn't this much more than changing the way =E2=80=98display-buffer=E2= =80=99 behaves?
IIUC, you want the buffer to pop up whenever some output arrives, the
user should be allowed to delete the window, and when new output arrives the buffer should pop up again.=C2=A0 Correct?

<= div>
Here is the impl= ementation I currently use (from Juri Linkov, message #8, second block of c= ode):
(advice-add 'comint-output-filter :after
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Sto= p Async Shell Command output from appearing until there is output."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= lambda (process string)
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (and (string-match-p "\\*Async S= hell Command\\*"
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(buffer-name (proces= s-buffer process))))
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (display-buffer (process-buffer process= )))))

I think this does what you say: whenever some output arrives, the buffe= r pops up. It does not involve changing the behaviour of display-buffer.

All = my patch does is move the advice into a function suitable for comint-output= -filter-functions.

But I'm still confused by how you
want to add something to =E2=80=98display-buffer-alist=E2=80=99 and at the = same time to
not change the behavior of =E2=80=98display-buffer=E2=80=99 ;-)
=E2=80=8B
I suggested adding an option to display-buffer-alist's defcus= tom specification, something like:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 :options (((regexp "\\*Async Shell Command= \\*") (function display-buffer-no-window)))

By default, this is not = selected, so it does not change the default behaviour.

I currently simply= add an item to display-buffer-alist:
<= br>
(add-to-list 'display-buffer-alist '("\\*As= ync Shell Command\\*"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0display-buffer-no-window))

--
--001a113e46fe9552bc054459c642--