Subject: Re: bug#45072: 28.0.50; Emacs switches other buffer back uncontrollably, if other window's buffer is changed by user during minibuffer editing

From: Stefan Monnier <[email-masked]>
Date: Mon, 19 Apr 2021 12:22:11 -0400

>>> Maybe 'quit-window' is better?
>>
>> Part of the problem is one of documentation: it's hard to know which one
>> to call just by reading the docstrings.
>>
>> Also the above quoted text sounds counter intuitive: "bury buffer"
>> sounds like it's mostly focused on hiding the *buffer*, potentially
>> hiding the window along the way if necessary, whereas "quit window"
>> sounds like it's mostly going to eliminate the *window*.
>
> That's why Lisp code should call `quit-restore-window' instead of
> `quit-window'.

I suspect the docstring of the other functions should point to it if we
want this to have any uptake.

>> Of course, there's also the fact that `quit-window` is fairly new
>> (introduced in Emacs-24), whereas `bury-buffer` has been with us forever.
> Both, `bury-buffer' and `quit-window' should be used interactively only.

Maybe we should begin with adding

    (declare (interactive-only quit-restore-window))

to `quit-window` (adding it to `bury-buffer` risks us drowning under
a deluge of warnings)?

        Stefan