From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18133: Suppressing asynchronous command output Date: Tue, 27 Dec 2016 11:28:37 +0200 Message-ID: <83eg0twwje.fsf@gnu.org> 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> <87fula1dbk.fsf@mail.linkov.net> <83r34tx53w.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1482831015 311 195.159.176.226 (27 Dec 2016 09:30:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Dec 2016 09:30:15 +0000 (UTC) Cc: 18133@debbugs.gnu.org, juri@linkov.net To: Reuben Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 27 10:30:10 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 1cLo5C-0007kb-4A for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Dec 2016 10:30:10 +0100 Original-Received: from localhost ([::1]:53356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLo5G-00058j-L0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Dec 2016 04:30:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLo5A-00057U-Jc for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 04:30:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLo55-0005aX-2W for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 04:30:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40889) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLo54-0005a0-QV for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 04:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cLo54-0000Mc-Ed for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 04:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Dec 2016 09:30:02 +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.14828309451302 (code B ref 18133); Tue, 27 Dec 2016 09:30:02 +0000 Original-Received: (at 18133) by debbugs.gnu.org; 27 Dec 2016 09:29:05 +0000 Original-Received: from localhost ([127.0.0.1]:56288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLo44-0000Kb-RU for submit@debbugs.gnu.org; Tue, 27 Dec 2016 04:29:05 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLo42-0000KP-VP for 18133@debbugs.gnu.org; Tue, 27 Dec 2016 04:28:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLo3t-0004ux-OU for 18133@debbugs.gnu.org; Tue, 27 Dec 2016 04:28:53 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLo3t-0004ut-LO; Tue, 27 Dec 2016 04:28:49 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2215 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cLo3s-0002Ad-Ma; Tue, 27 Dec 2016 04:28:49 -0500 In-reply-to: (message from Reuben Thomas on Tue, 27 Dec 2016 09:01:32 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:127488 Archived-At: > From: Reuben Thomas > Date: Tue, 27 Dec 2016 09:01:32 +0000 > Cc: Juri Linkov , martin rudalics , 18133@debbugs.gnu.org > > > +(defun comint-make-newly-written-buffer-visible (string process) > > + "Make the output buffer visible when output is added to an empty buffer. > > +Useful in `comint-preoutput-filter-functions'." > > + (let ((buffer (process-buffer process))) > > + (when (and (= 0 (buffer-size buffer)) > > + (string-match-p "\\*Async Shell Command\\*" > > + (buffer-name buffer))) > > + (display-buffer (process-buffer process)))) > > + string) > > Why are we hard-coding a certain buffer name in a function that is > supposed to be more general, judging by its name and doc string? > > ​I found it hard-coded several times in other places, so I hard-coded it here. What do you suggest? I don't see it hard-coded in any context such as this. I think the regexp against which buffer names are matched in comint-make-newly-written-buffer-visible should be customizable, with "*Async Shell Command*" being (in) the default value. And another question: where's the user option to turn this feature on or off (including the default being off)? Thanks.