From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eliza Velasquez Newsgroups: gmane.emacs.bugs Subject: bug#64394: [PATCH] Fix `async-shell-command-display-buffer' display Date: Sat, 01 Jul 2023 00:52:32 -0700 Message-ID: <87h6qo6pbz.fsf@eliza.sh> References: <873528cuoe.fsf@eliza.sh> <833528rt62.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13317"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64394@debbugs.gnu.org To: Eli Zaretskii , martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 01 09:53:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qFVQ0-0003ID-Vf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Jul 2023 09:53:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFVPm-0003mJ-2D; Sat, 01 Jul 2023 03:53:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFVPi-0003m5-9g for bug-gnu-emacs@gnu.org; Sat, 01 Jul 2023 03:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFVPi-0001EO-0k for bug-gnu-emacs@gnu.org; Sat, 01 Jul 2023 03:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qFVPh-0001sI-Sw for bug-gnu-emacs@gnu.org; Sat, 01 Jul 2023 03:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eliza Velasquez Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Jul 2023 07:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64394 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64394-submit@debbugs.gnu.org id=B64394.16881979677184 (code B ref 64394); Sat, 01 Jul 2023 07:53:01 +0000 Original-Received: (at 64394) by debbugs.gnu.org; 1 Jul 2023 07:52:47 +0000 Original-Received: from localhost ([127.0.0.1]:56380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFVPS-0001ro-KP for submit@debbugs.gnu.org; Sat, 01 Jul 2023 03:52:46 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:48449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFVPR-0001rb-36 for 64394@debbugs.gnu.org; Sat, 01 Jul 2023 03:52:45 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E3FE85C0176; Sat, 1 Jul 2023 03:52:39 -0400 (EDT) Original-Received: from imap48 ([10.202.2.98]) by compute5.internal (MEProxy); Sat, 01 Jul 2023 03:52:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eliza.sh; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1688197959; x=1688284359; bh=BJ ShTjxsIu+uwqLpEVSmyTpkbGN2Qt3hejlXDrAaaIg=; b=OyCwFSraYqUpiWRdsA jeWgPicsnbqN7z9BSwHIPaQVur/znPzcUgFXc3ZrYsKLhhzo0eG5oSwTGhaqeinR sofs5nOTYki8VkBFNs0Q5NV+jmGE6gGNf+f+Dqjlb5mOA07PR19SR+RXUGPtqtGL ZCmqT7L47Jqbv2WNt+zgCKiob9N+g9mHHq8AYeG6Q49CtheAc/yCbsIm6UwlPH4E Ir4SPph2RLKI9C3Kf/5FhVW8d3h8E1myoEs/qGIykpChSvmDgQM/cofEKaDcHisk q6WOStsDkAIMhERwNwoUiumtA5CiKJf9XOqrprzF5V744kYcam4DOWln4tOsLG7J TOCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1688197959; x=1688284359; bh=BJShTjxsIu+uw qLpEVSmyTpkbGN2Qt3hejlXDrAaaIg=; b=WBcCal6VRND1Cack7C5IJIOulfnXj cwuvYOrv7Q556w3IE9SVTJBS/Mg0T6/LMHAMPG+UwVwN6T09975nnMYw9jhNaNTY 7KyqS8xJAdnPZLFveyno0NBU85IqAPYsnpZtlXvy3Lq+iDwa5aH5rZ7TLa1HcYmg gcG6pEE2q6vIoMKwghNVwKlcFR7jfHIuIWC7b5mMYCLscEWMH7X0BHGgZj1IYmkY gdYY0gNoUoXpq5GuJBasBFZMA8bXL80wy6VWuDxfDHw57UDpQ2hIqGuMsrmHKrAZ arEA2AMcvWScxT4ikW4JNEMlXi9A78vevU5zwa/2wzA8ylSheevyUiXNA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrtdejgdduvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepoffhvfevufgjfhffkfggtgesthdtredtredttdenucfhrhhomhepgfhlihii rgcugggvlhgrshhquhgviicuoegvlhhiiigrsegvlhhiiigrrdhshheqnecuggftrfgrth htvghrnhepfedukeekgeevueetiefhgefhieefteeljeeivdehheekjeffkeeltdduheei vdeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvg hlihiirgesvghlihiirgdrshhh X-ME-Proxy: Feedback-ID: i87c446d8:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 74B7431A0064; Sat, 1 Jul 2023 03:52:39 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <833528rt62.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264363 Archived-At: On Sat, Jul 01 2023 at 10:24 +03, Eli Zaretskii wrote: > I'm probably missing something, but how can display-buffer fail to > support any action function, such as display-buffer-no-window? > > Martin, what am I missing here? I was also confused. Based on the documentation for `display-buffer-no-window', it seems that callers are supposed to explicitly pass an `(allow-no-window . t)' cons pair when calling `display-buffer' as a signal that they can correctly handle a return value of nil. If it's absent, `display-buffer-no-window' seems to err on the side of caution, assume the caller can't handle nil, displays the window anyway, and returns it like all the other display functions. Technically it seems that you can add `(allow-no-window . t)' to `display-buffer-alist' to always force the buffer never to appear, but that doesn't seem at all like its intended use. > That's fine, but those are your preferences. I'd feel uncomfortable > with forcing them on everyone, if we already have a way of tailoring > this behavior by user customizations. I might not have been clear with what I meant here, sorry; I mean that in my own personal config, when I run `mpv', its output appears in a buffer named `*shell:mpv*' instead of `*Async Shell Command*', and I have an explicit entry for it in `display-buffer-alist' so that it doesn't appear via `display-buffer-no-window'. This was functioning well, except the moment I set `async-shell-command-display-buffer' to nil, the buffer displayed itself the moment mpv began to write to stdout. A minimally reproable example in `emacs -Q': --8<---------------cut here---------------start------------->8--- (setq display-buffer-alist '(("\\*Async Shell Command\\*" (display-buffer-no-window)))) (setq async-shell-command-display-buffer nil) --8<---------------cut here---------------end--------------->8--- `M-& echo foo RET' will unexpectedly show the `*Async Shell Command*' buffer. -- Eliza