From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#18133: Suppressing asynchronous command output Date: Sat, 31 Dec 2016 00:56:06 +0200 Organization: LINKOV.NET Message-ID: <87mvfdowg5.fsf@mail.linkov.net> References: <83eg100vy5.fsf@gnu.org> <585C132B.1030709@gmx.at> <585C347D.9050309@gmx.at> <585D740B.40303@gmx.at> <585D8120.1090300@gmx.at> <87fula1dbk.fsf@mail.linkov.net> <83r34tx53w.fsf@gnu.org> <83eg0twwje.fsf@gnu.org> <83r34sujou.fsf@gnu.org> <8737h6z63w.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1483139061 19775 195.159.176.226 (30 Dec 2016 23:04:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2016 23:04:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) Cc: 18133@debbugs.gnu.org To: Reuben Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 31 00:04:15 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 1cN6DX-0003a1-M5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 31 Dec 2016 00:04:07 +0100 Original-Received: from localhost ([::1]:41781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN6Dc-0005db-NF for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Dec 2016 18:04:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN6DX-0005dV-7k for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2016 18:04:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cN6DS-0005hi-As for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2016 18:04:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45295) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cN6DS-0005hT-7g for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2016 18:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cN6DS-0006ic-0Z for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2016 18:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Dec 2016 23:04: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.148313899825775 (code B ref 18133); Fri, 30 Dec 2016 23:04:01 +0000 Original-Received: (at 18133) by debbugs.gnu.org; 30 Dec 2016 23:03:18 +0000 Original-Received: from localhost ([127.0.0.1]:60694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cN6Ck-0006hf-5A for submit@debbugs.gnu.org; Fri, 30 Dec 2016 18:03:18 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:40079 helo=homiemail-a12.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cN6Ci-0006hW-BI for 18133@debbugs.gnu.org; Fri, 30 Dec 2016 18:03:17 -0500 Original-Received: from homiemail-a12.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTP id 33958262069; Fri, 30 Dec 2016 15:03:15 -0800 (PST) Original-Received: from localhost.linkov.net (m83-178-3-130.cust.tele2.ee [83.178.3.130]) (Authenticated sender: jurta@jurta.org) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTPA id EDD08262065; Fri, 30 Dec 2016 15:03:13 -0800 (PST) In-Reply-To: (Reuben Thomas's message of "Fri, 30 Dec 2016 18:28:46 +0000") 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:127605 Archived-At: > "The way recommended by Martin" involves a new minor mode, > async-shell-lazy-pop-up-mode, which I tried to avoid; Eli didn't seem t= o > support its addition, either. No, not a new minor mode, I meant https://debbugs.gnu.org/18133#47 i.e. in =E2=80=98shell-command=E2=80=99 instead of (display-buffer buffer '(nil (allow-no-window . t))) we could use (display-buffer buffer '(display-buffer-no-window (allow-no-window . t))) when this feature is enabled by the new customizable variable =E2=80=98async-shell-command-display-buffer=E2=80=99. > I'm not sure what the variable async-shell-command-display-buffer is > supposed to contain. (It does not seem to be the name of the buffer to = be > matched.) We can't hard-code the name of the buffer because =E2=80=98shell-command=E2= =80=99 uses the arg =E2=80=98output-buffer=E2=80=99, and only if it's nil then b= y default "*Async Shell Command*". So =E2=80=98async-shell-command-display-buffer=E2= =80=99 shouldn't define the name of the buffer. Instead, it could be boolean to enable this feature (or a choice of options for more future related features like in =E2=80=98async-shell-command-buffer=E2=80= =99). > I am unclear what goes in the ellipsis after "when" in the sample code > above; it seems to imply a test for whether the buffer should be displa= yed, > but I already handled that in my patch with the preoutput-filter functi= on. In the ellipsis goes the code that you already wrote for the filter: (set-process-filter proc `(lambda (process string) (when (and (=3D 0 (buffer-size (process-buffer process))) (eq (buffer-name (process-buffer process)) ,(or output-buffer "*Async Shell Command*"))) (display-buffer (process-buffer process))))) i.e. it will handle exactly the same buffer that was provided as an arg =E2=80=98output-buffer=E2=80=99 to =E2=80=98async-shell-command=E2=80=99.