Subject: bug#4271: 23.1; pop-to-buffer -vs- multiple terminals

From: martin rudalics <[email-masked]>
Date: Thu, 27 Aug 2009 07:52:52 +0200

> When I ran vc-diff on this terminal, I was surprised that I was not
 > switched to the *vc-diff* buffer.  It turns out that *vc-diff* was in a
 > window on one of the X frames -- but not visible to me now, using the
 > tty.
 >
 > I ran (pop-to-buffer "*vc-diff*") and this did not show the buffer.  I
 > think that this should ignore frames on other terminals when determining
 > whether a buffer is visible.

Could you please edebug `display-buffer' and find out how the `let' part
below gets executed in your case

      ((let ((frames (or frame
			(and (or use-pop-up-frames
				 display-buffer-reuse-frames
				 (not (last-nonminibuffer-frame)))
			     0)
			(last-nonminibuffer-frame))))
	(setq window-to-use
	      (catch 'found
		;; Search frames for a window displaying BUFFER.  Return
		;; the selected window only if we are allowed to do so.
		(dolist (window (get-buffer-window-list buffer 'nomini frames))
		  (when (or can-use-selected-window
			    (not (eq (selected-window) window)))
		    (throw 'found window))))))

Thanks, martin.