unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mark T. Kennedy" <mkennedy@diamondbackcap.com>
To: martin rudalics <rudalics@gmx.at>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: switch-to-buffer-other-frame fails to pop-up window
Date: Thu, 06 Dec 2007 13:43:05 -0500	[thread overview]
Message-ID: <475842B9.6060001@diamondbackcap.com> (raw)
In-Reply-To: <47572229.8000803@gmx.at>


martin rudalics wrote:
>  > 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.

but two windows exist already in your "c-x 4 b" scenario.  and if only one window
existed, it would be created.  the "other window" invariant is maintained regardless
of whether it has to create a new window or just switch to an existing one.

but "c-x 5 b" behaves like "c-x 4 b" in the single-frame, two-window
scenario you described above.  it does *not* cause a second frame to
be created.  it just switches to w2 without creating a new frame.  the
"other frame" invariant is *not* maintained.

>
>  > 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.

mea culpa.  i did not think to look in the elisp doc.

>
>  > 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?
>
>

that would certainly provide a work-around and make me happy.

but i'm still curious why the intent of pop-up-frames is overridden by
display-buffer.  there has to be a reason lurking somewhere?

/mark

This communication and any attachments may contain confidential/proprietary information and is intended for information purposes only. It is not an invitation or offer to purchase interests from Diamondback.  Any representation to the contrary is unintentional.  This communication is intended only for the person(s) to whom it is addressed.  If you are not the intended recipient you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message or any attachments is not permitted.  If you have received this in error, please notify the sender immediately by e-mail and delete this message.  All e-mails sent to or received from this address will be received by Diamondback's company e-mail system and is subject to a
 rchival and possible review by someone other than the recipient.  This notice is automatically appended to each e-mail message leaving Diamondback.





  reply	other threads:[~2007-12-06 18:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03 14:48 switch-to-buffer-other-frame fails to pop-up window Mark T. Kennedy
2007-12-04  7:37 ` martin rudalics
2007-12-05 19:55   ` Mark T. Kennedy
2007-12-05 22:11     ` martin rudalics
2007-12-06 18:43       ` Mark T. Kennedy [this message]
2007-12-06 19:48         ` Drew Adams
2007-12-06 20:11           ` Mark T. Kennedy
2007-12-06 22:06             ` Drew Adams
2007-12-07 16:39               ` Mark T. Kennedy
2007-12-07 17:18                 ` Drew Adams
2007-12-07 19:41                 ` Mark T. Kennedy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=475842B9.6060001@diamondbackcap.com \
    --to=mkennedy@diamondbackcap.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).