bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: switch-to-buffer-other-frame fails to pop-up window


From: martin rudalics
Subject: Re: switch-to-buffer-other-frame fails to pop-up window
Date: Wed, 05 Dec 2007 23:11:53 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> 1) contrast the behavior of 'c-x 5 b' with 'c-x 4 b'.  'c-x 4 b' always 
forces the creation of two
> different windows, even when displaying the same buffer.  'c-x 5 b' does not 
always force the
> creation of two frames.

When you have two windows on the selected frame, w1 is the selected
window and w2 the other one, w2 shows buffer b, and w1 does not show
buffer b, C-x 4 b will simply switch to w2.  Thus C-x 4 b and C-x 5 b
behave very similarly.

> 2) one might guess that 'switch-to-buffer-other-frame' is essentially a 
wrapper that
> sets 'pop-up-frames' to 't' and then calls display-buffer (and it is).
> while the behavior of display-buffer is meticulously documented, the observed
> behavior clashes with the documentation for 'pop-up-frames'.  now if it were
> called "maybe-pop-up-frames" or "frequently-pop-up-frames", i wouldn't feel
> so bad, but... :-).

The documentation of `pop-up-frames' in the Elisp manual appears
correct:

 -- User Option: pop-up-frames
     This variable controls whether `display-buffer' makes new frames.
     If it is non-`nil', `display-buffer' looks for an existing window
     already displaying the desired buffer, on any visible frame.  If
     it finds one, it returns that window.  Otherwise it makes a new
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     frame.  The variables `pop-up-windows' and
     `split-height-threshold' do not matter if `pop-up-frames' is
     non-`nil'.

The doc-strings of `pop-up-frames' and `switch-to-buffer-other-frame'
are misleading.  The former says "*Non-nil means `display-buffer' should
make a separate frame." but fails to explain the semantics of "should".
The latter tells "Switch to buffer buffer in another frame." which is
just silly IMHO.

> so i'm requesting (not demanding :-) a change in behavior.
>
> what use case would clash with a change like this?

I don't know, maybe there is one.  We could try to provide a third value
for `pop-up-frames': If it's 'force `display-buffer' would _always_ try
to display the buffer in a new frame regardless of how many times it is
already displayed.  What do you think?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]