Subject: Re: bug#7368: Testcase

From: martin rudalics <[email-masked]>
Date: Sat, 13 Nov 2010 09:32:45 +0100

> C-h v pop-up-frames RET says:
 >
 > pop-up-frames's value is nil
 >
 > Documentation:
 > Whether `display-buffer' should make a separate frame.
 > If nil, never make a separate frame.
 >
 > However, a new frame *does* pop up for me after running the following code:
 >
 > (let ((foo (get-buffer-create "foo.el"))
 >       (bar (get-buffer-create "bar.el")))
 >   (switch-to-buffer foo)
 >   (delete-other-windows)
 >   (completion-at-point)
 >   (display-buffer bar t))

On my trunk Emacs your code produces a new window on the selected frame.
Apparently, some of your settings prevent it from splitting the selected
window and the second argument t means `display-buffer' must not reuse
the selected window.  So `display-buffer' simply has no other choice but
making a new frame.

BTW, the snippet

(progn
   (delete-other-windows)
   (display-buffer (other-buffer) t))

should be sufficient for exhibiting the behavior you observe.

martin