all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eliza Velasquez <eliza@eliza.sh>
To: Eli Zaretskii <eliz@gnu.org>, martin rudalics <rudalics@gmx.at>
Cc: 64394@debbugs.gnu.org
Subject: bug#64394: [PATCH] Fix `async-shell-command-display-buffer' display
Date: Sat, 01 Jul 2023 00:52:32 -0700	[thread overview]
Message-ID: <87h6qo6pbz.fsf@eliza.sh> (raw)
In-Reply-To: <833528rt62.fsf@gnu.org>

On Sat, Jul 01 2023 at 10:24 +03, Eli Zaretskii <eliz@gnu.org> 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





  reply	other threads:[~2023-07-01  7:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01  1:00 bug#64394: [PATCH] Fix `async-shell-command-display-buffer' display Eliza Velasquez
2023-07-01  7:24 ` Eli Zaretskii
2023-07-01  7:52   ` Eliza Velasquez [this message]
2023-07-01  8:12     ` Eli Zaretskii
2023-07-01  8:42       ` Eliza Velasquez
2023-07-02  7:09     ` martin rudalics
2023-07-02 18:03       ` Juri Linkov
2023-07-03  6:46         ` martin rudalics
2023-07-04  1:18           ` Eliza Velasquez
2023-07-04 17:54             ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6qo6pbz.fsf@eliza.sh \
    --to=eliza@eliza.sh \
    --cc=64394@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.