Subject: bug#9532: 24.0.50; `special-display-regexps' is no longer respected

From: Chong Yidong <[email-masked]>
Date: Wed, 21 Sep 2011 23:37:06 -0400

Chong Yidong <[email-masked]> writes:

> So, you agree to the incompatibility for the non-interactive case?  That
> is to say, a non-interactive call to switch-to-buffer (and ONLY a
> non-interactive call) will now trigger special display.  Previously, in
> Emacs 23, it would use the selected window.
>
> If you agree, I'd implement the behavior by adding a new value for
> s-t-b's FORCE-SAME-WINDOW argument, `try', which would be the default
> for interactive calls.  That would mean to first try displaying in the
> current selected window directly instead of going through p-t-b.

It just occurred to me that it would be safer to leave switch-to-buffer
unchanged, and instead reinstate pop-to-buffer-same-window specifically
for the callers in question, i.e. the callers who used the
same-window-regexps/display-buffer trick.  pop-to-buffer-same-window
would raise a special window for special buffers, instead of using the
selected window; s-t-b would use the selected window, as in Emacs 23.

There are only about 9 uses of the same-window-regexps + display-buffer
trick which would be changed to use pop-to-buffer-same-window, compared
to hundreds of users of switch-to-buffer.  So unintended consequences
would be much less likely.