> - ((eq buffer (window-buffer))) > + ((and (eq buffer (window-buffer)) > + (not switch-to-buffer-pop-to))) > > This would show the buffer twice even when it already appears in the > same window, right? Are you sure that this is TRT? Unconditionally? This change is intentional. If the user requests to display the same buffer in another window, we have to follow user's request - it's a normal wish to display the same buffer in two different windows. > BTW your patch does not apply here well due to some whitespace > mismatches. Sorry, I created the previous patch ignoring whitespace changes, so it would be easier for you to see differences. But now it should apply properly with this new patch that takes into account all your comments: