emacs-devel
[Top][All Lists]
Advanced

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

Re: display-buffer-other-frame - useful? doc string?


From: Stefan Monnier
Subject: Re: display-buffer-other-frame - useful? doc string?
Date: Sun, 09 Mar 2008 17:48:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> 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 via email to

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