Subject: bug#1237: 23.0.60; `switch-to-buffer-other-window' sometimes uses selected window

From: martin rudalics <[email-masked]>
Date: Sat, 25 Oct 2008 15:28:12 +0200

> run_window_configuration_change_hook selects each window before running
 > the hook buffer-locally which makes any reasoning (within the function
 > run by the hook) about which window will be selected when the command
 > completes void.  In addition it unwinds with select_window_norecord
 > which won't restore the current buffer when the selected window gets
 > reselected.  Both of these don't explain the problem that somewhere
 > `select-window' must get called with norecord nil :-(

OK.  The reason may be twofold: `save-selected-window' may twice
select a window with norecord nil:

		(set-frame-selected-window (car elt) (cdr elt)))) ; <--- here
	 (if (window-live-p save-selected-window-window)
	     (select-window save-selected-window-window)))))) <--- and here

Fixing these two fixes the bug.  I have to find out how to do this in an
unobtrusive way though.

martin, who'd never ever run `window-configuration-change-hook'
buffer-locally in the first place ;-)