Subject: Re: bug#9639: 24.0.90; Problem with bury-buffer in minibuffer-hide-completions

From: Stefan Monnier <[email-masked]>
Date: Sat, 01 Oct 2011 20:38:33 -0400

>> BTW, can't we just use `quit-window'?
> This would delete a stand-alone frame and not iconify it.

That's a problem of quit-window.  I know that some users like this
behavior, but making the distinction based on whether the code happened
to use quit-window instead of bury-buffer is wrong, IMO.

Both bury-buffer and quit-window should hide dedicated frames in the
same way, either both by iconifying, or both by deleting the frame (and
they should share the same code to do it).

This shared code can provide a hook to let the user choose how the frame
gets hidden, but the default should be to iconify since that's how it's
worked until now (and also because I think it's a safer default, in the
sense that iconifying throws away less information than deleting the
frame).

>> But of course, if we can get the *Completions* window/frame deleted
>> without marking it as dedicated, that'd be fine as well.
> We could give `quit-window' a third argument telling it to iconify the
> frame instead of deleting it or add an option to deal with this case.

An argument doesn't seem right, since the choice doesn't depend on the
caller, AFAIK, but on the user.

> Since I still intend to eventually replace window excursions by
> `display-buffer' + `quit-window' (which will probably take years) some
> general pattern would be useful anyway.

Yes, we agree on this overarching goal, tho I think the issue is not so
much save-window-excursion (which generally needs to be solved by
changing the code so it doesn't call display-buffer at all) but rather
"stash current-window-configuration + set-window-configuration".

        Stefan