From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: display-buffer-other-frame - useful? doc string? Date: Sun, 09 Mar 2008 17:48:02 -0400 Message-ID: References: <002401c8820f$7d6042c0$0600a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205099303 11718 80.91.229.12 (9 Mar 2008 21:48:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Mar 2008 21:48:23 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 09 22:48:50 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JYTNx-0000Rr-4m for ged-emacs-devel@m.gmane.org; Sun, 09 Mar 2008 22:48:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYTNO-000431-P3 for ged-emacs-devel@m.gmane.org; Sun, 09 Mar 2008 17:48:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYTNL-00042w-Mw for emacs-devel@gnu.org; Sun, 09 Mar 2008 17:48:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYTNI-00042k-5N for emacs-devel@gnu.org; Sun, 09 Mar 2008 17:48:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYTNI-00042h-0N for emacs-devel@gnu.org; Sun, 09 Mar 2008 17:48:08 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JYTNH-0002Jz-PD for emacs-devel@gnu.org; Sun, 09 Mar 2008 17:48:07 -0400 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JYTNH-0003lI-Ct for emacs-pretest-bug@gnu.org; Sun, 09 Mar 2008 17:48:07 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JYTNE-0002J1-7q for emacs-pretest-bug@gnu.org; Sun, 09 Mar 2008 17:48:07 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JYTNE-0002In-0Q for emacs-pretest-bug@gnu.org; Sun, 09 Mar 2008 17:48:04 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmgCAI/300fO+J2CdGdsb2JhbACQfgEwgRqWIoEH X-IronPort-AV: E=Sophos;i="4.25,471,1199682000"; d="scan'208";a="15769274" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 09 Mar 2008 17:48:03 -0400 Original-Received: from pastel.home ([206.248.157.130]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id PYF03603; Sun, 09 Mar 2008 17:48:03 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 9E781805A; Sun, 9 Mar 2008 17:48:02 -0400 (EDT) In-Reply-To: <002401c8820f$7d6042c0$0600a8c0@us.oracle.com> (Drew Adams's message of "Sun, 9 Mar 2008 10:00:41 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:91921 gmane.emacs.pretest.bugs:21473 Archived-At: > 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