From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#18133: Suppressing asynchronous command output Date: Wed, 30 Jul 2014 19:35:04 +0300 Organization: JURTA Message-ID: <87a97qdcuf.fsf@mail.jurta.org> References: <87iomf682d.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1406738311 27553 80.91.229.3 (30 Jul 2014 16:38:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2014 16:38:31 +0000 (UTC) Cc: 18133@debbugs.gnu.org To: Reuben Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 30 18:38:23 2014 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 1XCWtT-0005vB-9K for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Jul 2014 18:38:23 +0200 Original-Received: from localhost ([::1]:52172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCWtS-0004hu-TJ for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Jul 2014 12:38:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCWtH-0004dw-Lo for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2014 12:38:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCWtA-0005w7-5R for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2014 12:38:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCWtA-0005w2-22 for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2014 12:38:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XCWt9-0006Vb-IO for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2014 12:38:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Jul 2014 16:38:03 +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.140673823024939 (code B ref 18133); Wed, 30 Jul 2014 16:38:03 +0000 Original-Received: (at 18133) by debbugs.gnu.org; 30 Jul 2014 16:37:10 +0000 Original-Received: from localhost ([127.0.0.1]:52030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XCWsH-0006UA-0x for submit@debbugs.gnu.org; Wed, 30 Jul 2014 12:37:09 -0400 Original-Received: from alc-vshost7.dreamhost.com ([69.163.216.107]:51552 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XCWsD-0006TA-1y for 18133@debbugs.gnu.org; Wed, 30 Jul 2014 12:37:05 -0400 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id BBD513094098AD; Wed, 30 Jul 2014 09:37:03 -0700 (PDT) In-Reply-To: (Reuben Thomas's message of "Wed, 30 Jul 2014 10:48:33 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:91974 Archived-At: > Unfortunately, this code relies on features in the upcoming 24.4. I've > rewritten it to work in 24.3, and fixed a bug: > > (add-to-list 'display-buffer-alist '("\\*Async Shell Command\\*" > display-buffer-no-window > (allow-no-window . t))) > > (defadvice comint-output-filter (after delay-ashell-sync-command-output > (process string)) > "Stop Async Shell Command output from appearing until there is some > output" > (when (and (string-match-p "\\*Async Shell Command\\*" > (buffer-name (process-buffer process)))) > (display-buffer (process-buffer process)))) > > The argument to display-buffer-no-window now uses allow-no-window as it > should, and I've rewritten the call to advice-add as a defadvice. In 24.4 there is no need to add (allow-no-window . t) because `shell-command' already provides this alist in its call: (display-buffer buffer '(nil (allow-no-window . t))) > Is this suitable also to be used as the basis of a patch to Emacs? Using defadvice is undesirable for the core files, so if this feature is useful enough then a new user customizable variable could be added to optionally enable displaying the output buffer when the first output is received using code like in this defadvice.