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: Tue, 27 Dec 2016 09:01:32 +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> <87fula1dbk.fsf@mail.linkov.net> <83r34tx53w.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c075f4649dde10544a0194b X-Trace: blaine.gmane.org 1482829341 18655 195.159.176.226 (27 Dec 2016 09:02:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Dec 2016 09:02:21 +0000 (UTC) Cc: 18133@debbugs.gnu.org, Juri Linkov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 27 10:02:14 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 1cLne4-0003X8-PH for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Dec 2016 10:02:09 +0100 Original-Received: from localhost ([::1]:53300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLne9-0002oY-8m for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Dec 2016 04:02:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLne1-0002oC-UN for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 04:02:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLndy-0004b4-RQ for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 04:02:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLndy-0004ay-OY for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 04:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cLndy-0008BL-Er for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 04:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Reuben Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Dec 2016 09:02: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.148282930131422 (code B ref 18133); Tue, 27 Dec 2016 09:02:02 +0000 Original-Received: (at 18133) by debbugs.gnu.org; 27 Dec 2016 09:01:41 +0000 Original-Received: from localhost ([127.0.0.1]:56284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLndd-0008Ak-He for submit@debbugs.gnu.org; Tue, 27 Dec 2016 04:01:41 -0500 Original-Received: from mail-qk0-f178.google.com ([209.85.220.178]:34588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLnda-0008AV-Pc for 18133@debbugs.gnu.org; Tue, 27 Dec 2016 04:01:39 -0500 Original-Received: by mail-qk0-f178.google.com with SMTP id h201so74969319qke.1 for <18133@debbugs.gnu.org>; Tue, 27 Dec 2016 01:01:38 -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=Yv30ug+OtGszOrsTDu+hcyC+SgMA9907AZfDE/ei7MM=; b=lPhR7Xx3v0/z/ym4tKBZlFxHzWp1wALAzxxJUXT3mWK6VkR5se4EluBqJua02473Ye 2MQYguDG5UPzlz7C5CYgRzsiOQDPciPG9fnJfeAF0qgDzxl3/Un9jeGTUGeebq5+alPb BuUo6efehzA4hSXSNKO3WGrkUd2tSSNGsUExQ= 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=Yv30ug+OtGszOrsTDu+hcyC+SgMA9907AZfDE/ei7MM=; b=TpStJeP24kPA3MMvg+CcEegaw1xpkAltWKpmEwxgnLCbj8q/HsYrYvt25YQ2LBApa3 mBxRFZDndV91c2dMtpdo4jZyOZh7dRZaE5l43ce/eXp+uvwMlq8ctkl1R/x2rzNHes7h XOcG43DMIue4qwTD9WtkzQBbKvUF4xMdBf3Kv7HCsNaFwR+/seG1SFvQIR7Rb0w31UiP 60xlnnHmkKPqrECLInTOieMUp9di/5+2Xy9ey4K6UErAPybFAdM/d0jvy3xLRxitWL1J 6mSCZOgtaNJ8c5tJWJ+QDTPtvxo9jvp4lSXnwE+Tb1KTgJqDrsY3gutwWNjCM44czxbO 5PyA== X-Gm-Message-State: AIkVDXJaPFs/8WzfhuAa5IreaDC/MAnOrrpLasfMdZGmw5fQ1zy0xB9jh0mrtKLciANDILzfg/nWDvSMVZ7J28ry X-Received: by 10.55.135.69 with SMTP id j66mr30037367qkd.31.1482829293264; Tue, 27 Dec 2016 01:01:33 -0800 (PST) Original-Received: by 10.140.88.51 with HTTP; Tue, 27 Dec 2016 01:01:32 -0800 (PST) In-Reply-To: <83r34tx53w.fsf@gnu.org> 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:127487 Archived-At: --94eb2c075f4649dde10544a0194b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 27 December 2016 at 06:23, Eli Zaretskii wrote: > > From: Reuben Thomas > > Date: Tue, 27 Dec 2016 01:20:42 +0000 > > Cc: martin rudalics , 18133@debbugs.gnu.org, Eli > Zaretskii > > > > +(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 (=3D 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? > =E2=80=8BI found it hard-coded several times in other places, so I hard-cod= ed it here. What do you suggest? --=20 http://rrt.sc3d.org --94eb2c075f4649dde10544a0194b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On = 27 December 2016 at 06:23, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Reuben Thomas <rrt@sc3d.org>
> Date: Tue, 27 Dec 2016 01:20:42 +0000
> Cc: martin rudalics <rudalics@gm= x.at>, 18133@debbugs.gnu.or= g, Eli Zaretskii <eliz@gnu.org&g= t;
>
> +(defun comint-make-newly-written-buffer-visible (string process)=
> +=C2=A0 "Make the output buffer visible when output is added to a= n empty buffer.
> +Useful in `comint-preoutput-filter-functions'."
> +=C2=A0 (let ((buffer (process-buffer process)))
> +=C2=A0 =C2=A0 (when (and (=3D 0 (buffer-size buffer))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(string-match-= p "\\*Async 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(buffer-name buffer)))
> +=C2=A0 =C2=A0 =C2=A0 (display-buffer (process-buffer process))))
> +=C2=A0 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?

=E2=80=8BI found it hard-coded several times in other places, so I hard-= coded it here. What do you suggest?

--
--94eb2c075f4649dde10544a0194b--