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: Wed, 28 Dec 2016 20:58:40 +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> <83eg0twwje.fsf@gnu.org> <83r34sujou.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114f5c2ed319720544be3ba7 X-Trace: blaine.gmane.org 1482958762 22378 195.159.176.226 (28 Dec 2016 20:59:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Dec 2016 20:59:22 +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 Wed Dec 28 21:59:16 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 1cMLJU-0003rg-FY for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Dec 2016 21:59:08 +0100 Original-Received: from localhost ([::1]:60892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMLJY-0001So-Rs for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Dec 2016 15:59:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMLJR-0001Sg-DO for bug-gnu-emacs@gnu.org; Wed, 28 Dec 2016 15:59:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMLJO-00041f-9z for bug-gnu-emacs@gnu.org; Wed, 28 Dec 2016 15:59:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42920) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cMLJO-00041b-5b for bug-gnu-emacs@gnu.org; Wed, 28 Dec 2016 15:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cMLJN-0003c5-Qc for bug-gnu-emacs@gnu.org; Wed, 28 Dec 2016 15:59: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: Wed, 28 Dec 2016 20:59: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.148295873513876 (code B ref 18133); Wed, 28 Dec 2016 20:59:01 +0000 Original-Received: (at 18133) by debbugs.gnu.org; 28 Dec 2016 20:58:55 +0000 Original-Received: from localhost ([127.0.0.1]:58319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMLJE-0003bh-7f for submit@debbugs.gnu.org; Wed, 28 Dec 2016 15:58:54 -0500 Original-Received: from mail-qk0-f182.google.com ([209.85.220.182]:36701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMLJ9-0003bP-CC for 18133@debbugs.gnu.org; Wed, 28 Dec 2016 15:58:50 -0500 Original-Received: by mail-qk0-f182.google.com with SMTP id n21so250495941qka.3 for <18133@debbugs.gnu.org>; Wed, 28 Dec 2016 12:58:47 -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=lw8l3vJbsargctdmbtdYnfhem9reyCgeZ6Xw/fR7MLA=; b=O1NHIxEff2UIuDA6lAIEnQp8B4v5atp8z4sfd1PCfD2tMsP5D0fATW0mB5rB08Iw4Q bRDR6cJTpdrIVJ1YW53IgZlGlcT/NV3KS7nuQcJjnnZaju470U6z7859FFTx1bZEX2LX Mc39CrG8Wr+I9Xli6y+vW0G5SwpDT0ihZZlHo= 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=lw8l3vJbsargctdmbtdYnfhem9reyCgeZ6Xw/fR7MLA=; b=irm59KYAyNXOzvchYy+vTmbS1p6fvFFblCHjUZarZSDAC5ZVAPE4WaVgDr7p6xBUNc BGoNGgtcdZLw3IxDeQ+qfuoHkFP6/HoHuZe06dlQrTk33o3KuNOKNErm4R/DzNs/IGaI dGFG1q6vVYDisMNpUB+MzFpGPEuo3IpMeKxNZYYOW6j3ZZDCWwrAlfrJDh/D/1WPzQKK /MiOZ8Q7Jwhh1FPZw1aPYmDnWJIg6uRevmCwBuNbDHFxOfNSyJN3Iv3hs+vlwBuSSfJR GMmotI1Pa7vzRwvvyHaymXkuAJ5ccmNSrHLfzYB83Pv2GU0MvEvklDU+ZIoXy/GwSCcs mM/Q== X-Gm-Message-State: AIkVDXLPwYkONlAcRjhtNf6JWy0PgiNq9n6xBb0eUPnNHdHfD2pdu7UM7E6N8JAaewg5Cumrnimdk0xhnZODozPK X-Received: by 10.55.115.71 with SMTP id o68mr40825835qkc.270.1482958721706; Wed, 28 Dec 2016 12:58:41 -0800 (PST) Original-Received: by 10.140.88.51 with HTTP; Wed, 28 Dec 2016 12:58:40 -0800 (PST) In-Reply-To: <83r34sujou.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:127530 Archived-At: --001a114f5c2ed319720544be3ba7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 28 December 2016 at 16:01, Eli Zaretskii wrote: > > From: Reuben Thomas > > Date: Tue, 27 Dec 2016 22:21:11 +0000 > > Cc: Juri Linkov , martin rudalics , > 18133@debbugs.gnu.org > > > > > 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 h= ard-coded > it here. What do you suggest? > > > > I don't see it hard-coded in any context such as this. > > > > =E2=80=8BI'm not quite sure what you mean by "in any context such as th= is". I > see the string repeated in source code, > > and never assigned to a variable name. This seems OK, since strings and > symbols are pretty much > > interchangeable when of this sort (e.g. not internationalised).=E2=80= =8B > > It appears: > > . in ibuf-ext.el, as one of several strings users can select > . in tramp-adb.el as a buffer where the shell output should go > . in tramp.el, likewise > . in simple.el, likewise > . in comments in some other files > > By contrast, you were hard-coding it in a function that should provide > optional behavior for buffers that are not necessarily related to > shell output. In that context, I think the user should be able to > instruct Emacs about the buffers which should exhibit this behavior. > =E2=80=8BAs I said, the name is editable in M-x customize-variable.=E2=80= =8B > And another question: where's the user option to turn this feature on > > or off (including the default being off)? > > > > =E2=80=8BM-x=E2=80=8B customize-variable RET display-buffer-alist RET > > > > You can tick/untick the option for "*Async Shell Command*", and, when i= t > is ticked, the regexp can be edited. > > But if I select that, what I get is that the buffer will not be > displayed at all, right? What will trigger its display when it > becomes non-empty? Sorry if I'm missing something obvious. > =E2=80=8B=E2=80=8BThe buffer will be displayed by comint-make-newly-written= -buffer-visible, which I've added to the default value of comint-preoutput-filter-functions. At present the buffer name is hard coded there, so this will only work for "*Async Shell Command*". So, to allow the user to be able to change the name, I suppose another user option would need to be introduced. However, that is beyond the scope of this bug, which is simply to change the behaviour for asynchronous uses of shell-command. --=20 http://rrt.sc3d.org --001a114f5c2ed319720544be3ba7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On = 28 December 2016 at 16:01, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Reuben Thomas <rrt@sc3d.org>
> Date: Tue, 27 Dec 2016 22:21:11 +0000
> Cc: Juri Linkov <juri@linkov.net>, martin rudalics <rudalics@gmx.at>, 18= 133@debbugs.gnu.org
>
>=C2=A0 > Why are we hard-coding a certain bu= ffer name in a function that is
>=C2=A0 > supposed to be more general, judging by its name and doc st= ring?
>=C2=A0 >
>=C2=A0 > =E2=80=8BI found it hard-coded several times in other place= s, so I hard-coded it here. What do you suggest?
>
>=C2=A0 I don't see it hard-coded in any context such as this.
>
> =E2=80=8BI'm not quite sure what you mean by "in any context = such as this". I see the string repeated in source code,
> and never assigned to a variable name. This seems OK, since strings an= d symbols are pretty much
> interchangeable when of this sort (e.g. not internationalised).=E2=80= =8B

It appears:

=C2=A0 . in ibuf-ext.el, as one of several strings users can select
=C2=A0 . in tramp-adb.el as a buffer where the shell output should go
=C2=A0 . in tramp.el, likewise
=C2=A0 . in simple.el, likewise
=C2=A0 . in comments in some other files

By contrast, you were hard-coding it in a function that should provide
optional behavior for buffers that are not necessarily related to
shell output.=C2=A0 In that context, I think the user should be able to
instruct Emacs about the buffers which should exhibit this behavior.

=E2=80=8BAs I said, the name is editable in M-x customize-variabl= e.=E2=80=8B

>=C2=A0 And another question: where's the user option to = turn this feature on
>=C2=A0 or off (including the default being off)?
>
> =E2=80=8BM-x=E2=80=8B customize-variable RET display-buffer-alist RET<= br> >
> You can tick/untick the option for "*Async Shell Command*", = and, when it is ticked, the regexp can be edited.

But if I select that, what I get is that the buffer will not be
displayed at all, right?=C2=A0 What will trigger its display when it
becomes non-empty?=C2=A0 Sorry if I'm missing something obvious.

=E2=80=8B=E2=80=8BThe buffer will be displayed by comint-make-newly-writ= ten-buffer-visible, which I've added to the default value of comint-pre= output-filter-functions. At present the buffer name is hard coded there, so= this will only work for "*Async Shell Command*".

So, to allow the user to be able to chan= ge the name, I suppose another user option would need to be introduced.

However, that is beyond the = scope of this bug, which is simply to change the behaviour for asynchronous= uses of shell-command.

--
--001a114f5c2ed319720544be3ba7--