Subject: Re: bug#1061: pop-up-frames does not work on a tty

From: martin rudalics <[email-masked]>
Date: Wed, 01 Oct 2008 15:05:28 +0200

> With the current CVS HEAD:
 >
 > emacs -Q -nw
 > M-: (setq pop-up-frames t) RET
 > C-h f ding RET
 >
 > The *Help* buffer does not appear at this point, a new frame is created,
 > but the current frame does not show the help buffer.

I'm aware of this problem.  Does the attached patch fix it?

 > with emacs-22.2 the *Help* buffer is displayed.

Not here on Windows.  And I wonder how this could work on your system.
FWIW, the underlying logic did not change.

Does `pop-to-buffer' for some arbitrary, non-visible buffer work with
-nw?  What happens with `display-buffer'?

martin
*** window.el.~1.153.~	2008-09-13 10:14:15.250000000 +0200
--- window.el	2008-10-01 14:51:12.437500000 +0200
***************
*** 987,994 ****
  			buffer (if (listp pars) pars))))))
       ((or pop-up-frames (not frame-to-use))
        ;; We want or need a new frame.
!       (window--display-buffer-2
!        buffer (frame-selected-window (funcall pop-up-frame-function))))
       ((and pop-up-windows
  	   ;; Make a new window.
  	   (or (not (frame-parameter frame-to-use 'unsplittable))
--- 987,997 ----
  			buffer (if (listp pars) pars))))))
       ((or pop-up-frames (not frame-to-use))
        ;; We want or need a new frame.
!       (setq frame-to-use (funcall pop-up-frame-function))
!       (prog1
! 	  (window--display-buffer-2
! 	   buffer (frame-selected-window frame-to-use))
! 	(select-frame-set-input-focus frame-to-use)))
       ((and pop-up-windows
  	   ;; Make a new window.
  	   (or (not (frame-parameter frame-to-use 'unsplittable))