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: martin rudalics
Subject: Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action'
Date: Thu, 30 Dec 2021 18:14:14 +0100

> 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

'display-buffer--maybe-same-window' is here for compatibility reasons
with the 'same-window-buffer-names/-regexps' options and can be used
only in an "ored" fashion as in 'display-buffer--maybe-at-bottom' or
'display-buffer-fallback-action'.  Otherwise, it would defeat
'display-buffer-alist' because it uses the same window only if that has
been advocated by 'same-window-p' which ignores 'display-buffer-alist'.
It's not redundant as long as we want to maintain compatibility for
those options.

> 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?

It can be used as a substitute for 'pop-to-buffer' wherever we decide
that consistency should prevail over long-standing behavior.  I have
been missing the present and the preceding thread but I think we should
revert the behavior for Emacs 28 and use 'pop-to-buffer' there.  Sam's
protest in this respect was justified - we cannot simply tell people
that they should customize 'display-buffer-alist' in order to get back
some long-standing behavior.  That's not our style.

Now 'pop-to-buffer-reuse-or-same-window' is still no 100% substitute for
'pop-to-buffer' but we can try it because it handles Sam's main argument
against 'pop-to-buffer-same-window' - that the same buffer appears twice
on the same frame.  Whether that suffices to fix all regressions in this
context should probably be answered in Emacs 29.

martin



reply via email to

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