unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-pretest-bug@gnu.org
Subject: Re: display-buffer-other-frame - useful? doc string?
Date: Sun, 09 Mar 2008 17:48:02 -0400	[thread overview]
Message-ID: <jwvpru3y3xb.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <002401c8820f$7d6042c0$0600a8c0@us.oracle.com> (Drew Adams's message of "Sun, 9 Mar 2008 10:00:41 -0800")

> Is the command `display-buffer-other-frame' useful as it is currently
> designed? It displays a buffer in another frame, but it also lowers
> that frame among all window-manager windows. Even if the buffer was
> already displayed in another frame, that frame is still lowered behind
> all others.
 
> That hardly seems like TRT. If you ask to display a buffer, you don't
> want it to be buried out of sight behind all other window-manager
> windows.
 
> Aside from the question of its usefulness, I wonder about its doc
> string. The first line of the doc string is identical to the first
> line of the doc string of `switch-to-buffer-other-frame': "Switch to
> buffer BUFFER in another frame." 
 
> But `display-buffer-other-frame' does *not* switch to the buffer (it
> does not select it); it simply displays it (in a not-very-visible
> fashion). Contrast that with the doc string of `display-buffer', whose
> first line explicitly says that the buffer is not selected: "Make
> BUFFER appear in some window but don't select it."
 
> Command `display-buffer-other-frame' is not documented in any manual -
> perhaps for good reason. It seems half-baked, to me.
 
It indeed looks very odd and the code has no comment to explain/justify
the funny dance it does.  My guess is that the call to `lower-frame' is
to make sure the new frame doesn't hide the current one.  And the calls
to make-frame-(in)visible may be used to try and convince the window
manager to give focus to the original frame.

AFAICT it's only used interactively via the C-x 5 C-o binding (which
I didn't know until right now), so we should be able to change its
behavior without breaking any elisp code.

The intention of this function seems to be (compared to C-x 5 b) that
the focus should stay in the original frame rather than go to the
new frame.  Of course, focus between frames is something very difficult
for Emacs to control, especially when one of the frame is
being created.

So please to try and fix the code as best as you can, and then we can
try and ask around if your patch doesn't make things worse in
other environments.

This code was apparently installed "recently":

revision 1.820
date: 2006-03-24 08:59:14 -0500;  author: rfrancoise;  state: Exp;  lines: +1 -1;
(ctl-x-5-map): Really bind C-x 5 C-o to `display-buffer-other-frame'.
----------------------------
revision 1.819
date: 2006-03-20 10:05:19 -0500;  author: rms;  state: Exp;  lines: +15 -0;
(display-buffer-other-frame): New command.
(ctl-x-4-map): Bind C-x 5 C-o to it.
----------------------------

Maybe Richard remembers where it comes from and why it looks and behaves
the way it does?


        Stefan




  reply	other threads:[~2008-03-09 21:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-09 18:00 display-buffer-other-frame - useful? doc string? Drew Adams
2008-03-09 21:48 ` Stefan Monnier [this message]
2008-03-09 22:06   ` Drew Adams
2008-03-10 17:16     ` Richard Stallman
2008-03-10 17:19       ` Drew Adams
2008-03-10 17:59       ` Stefan Monnier
2008-03-11 20:24         ` Richard Stallman
2008-03-10 17:15   ` Richard Stallman
2008-03-10 17:34   ` Andreas Schwab
2008-03-10 18:01     ` Stefan Monnier
2008-03-10 18:43       ` Andreas Schwab
2008-03-10  6:11 ` Richard Stallman
2008-03-10  6:22   ` Drew Adams
2008-04-06  0:13 ` Drew Adams
2008-04-06  2:28   ` Stefan Monnier
2008-04-06  7:52     ` Drew Adams
2008-04-07  0:51       ` Stefan Monnier
2008-04-07  1:18         ` Drew Adams
2008-04-07 16:01           ` Stefan Monnier
2008-04-07 16:14             ` Drew Adams
2008-04-07 16:44               ` Lennart Borgman (gmail)
2008-04-07 16:52                 ` Drew Adams
2008-04-07 17:02                   ` Lennart Borgman (gmail)
2008-04-07 17:06                     ` Drew Adams

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=jwvpru3y3xb.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    --cc=emacs-pretest-bug@gnu.org \
    /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).