Subject: bug#10144: 24.0.91; `pop-up-frames' with dedicated windows is broken: `C-x C-f'

From: "Drew Adams" <[email-masked]>
Date: Mon, 28 Nov 2011 09:25:41 -0800

> >> You mean in Emacs-23 only.
> > No, I meant in all Emacs versions prior to 24 (with my setup).
                                                  ^^^^^^^^^^^^^^^
> > And in 24 too, back when Martin's code was used.
> 
> I can't imagine how that could be the case: find-file has always used
> switch-to-buffer and switch-to-buffer in Emacs<23 never did anything
> else than use the selected window (and hence fail in minibuffer-only
> frames and dedicated windows).

Did you actually read my mail?  Did you read the part about this being the case
for _my setup_ but not for emacs -Q?  Did you see where I show my redefinition
of `switch-to-buffer'?

That's the point of my clarification in that message: the new problem was with
my setup only, and I suspect (seems pretty clear, but untested) that it is due
to my not doing the same thing for Emacs 24 as I do for other versions.  I used
different code for 24 because, prior to some recent change in Emacs (?), Emacs
24 (unlike previous versions) DTRT _without_ my needing that tweak to
`switch-to-buffer' for dedicated windows.

> > What's the point of such an error message when Emacs could DTRT and
> > show the user the buffer s?he asked to see?
> 
> The user decided to use RET rather than `o', so the user explicitly
> indicated that she wants to display the buffer in the selected window
> rather than in another window.  So it's not obvious that displaying
> the buffer in another window is the right thing to do.

I agree that such should be a user choice - it's not obvious a priori what the
best thing to do is.

IOW, let users choose what Emacs should do when there is an attempt to show
another buffer in a dedicated window: raise an error or use another window.  To
me (from long use), the latter is a much better behavior, but I agree that users
should be able to decide.

I still ask the general question: What good is such an error?  What am I
missing?  For instance, why would you, as one user, prefer faising the error to
displaying the buffer in another window?  I know you're used to the error
behavior, but why, given the choice, would you actually prefer it?

> OTOH I do agree that find-file is not quite like switch-to-buffer, in
> that the indication "use current window" is not as clear cut.

`find-file' is just one example.  The point of my redefinition of
`switch-to-buffer' (besides fitting the frame) is to use another window when the
target window is dedicated.

To me that makes sense, and I've used it for a very long time now, with no
problems.  I will, as I said, try to adjust my code so it works for Emacs 24
too.

I haven't had a chance yet to check this and make that change, but assuming I'm
right about the cause of the problem then (a) you can close this bug (please
wait for me to confirm my supposition), but (b) please consider a user option to
let users get the behavior I expect: use another window when the target window
is dedicated.