emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'di


From: Juri Linkov
Subject: Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action'
Date: Thu, 30 Dec 2021 18:04:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> ... we need a general new display
>> buffer action that preferably (1) reuses a window already showing the
>> buffer (2) uses the same window and only then (3) uses another window.
>> Maybe Juri has an idea.

Some commands pop their windows in unexpected places anyway,
so often have to resort to typing a same-window-prefix key
before running such commands :-)

> The attached diff should illustrate what I mean here.
> [...]
> +(defvar display-buffer--reuse-or-same-window-action
> +  '((display-buffer-reuse-window
> +     display-buffer-same-window)
> +    (inhibit-same-window . nil))

Shouldn't the first item be display-buffer--maybe-same-window
before display-buffer-reuse-window?  This is what is used by default
in display-buffer-fallback-action, but it has a comment with a question,
so probably it's really redundant:

  (defconst display-buffer-fallback-action
    '((display-buffer--maybe-same-window  ;FIXME: why isn't this redundant?
       display-buffer-reuse-window

> +(defun pop-to-buffer-reuse-or-same-window (buffer &optional norecord)
> +  "Select specified BUFFER in a window showing it or the same one.
> +This is like `pop-to-buffer-same-window', but tries first to
> +reuse a window already showing BUFFER and only if no such window
> +exists behaves like `pop-to-buffer-same-window'."
> +  (pop-to-buffer buffer display-buffer--reuse-or-same-window-action 
> norecord))

Grep counted 100 occurrences of pop-to-buffer-same-window in the source tree,
but I guess only shell commands could use pop-to-buffer-reuse-or-same-window?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]