From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: managing windows in two frames Date: Sat, 07 Sep 2013 11:37:49 +0200 Message-ID: <522AF3ED.3090601@gmx.at> References: <8561uiclrj.fsf@stephe-leake.org> <5225DB8D.6060709@gmx.at> <858uzcbggs.fsf@stephe-leake.org> <85ppso1dve.fsf@stephe-leake.org> <5229B417.60006@gmx.at> <85hadx584g.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1378546694 13407 80.91.229.3 (7 Sep 2013 09:38:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Sep 2013 09:38:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 07 11:38:16 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VIEy7-0001dc-DK for ged-emacs-devel@m.gmane.org; Sat, 07 Sep 2013 11:38:15 +0200 Original-Received: from localhost ([::1]:41303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIEy7-0004X8-1x for ged-emacs-devel@m.gmane.org; Sat, 07 Sep 2013 05:38:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIExw-0004NM-35 for emacs-devel@gnu.org; Sat, 07 Sep 2013 05:38:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VIExm-0003I2-S7 for emacs-devel@gnu.org; Sat, 07 Sep 2013 05:38:04 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:58573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIExm-0003Ho-AR for emacs-devel@gnu.org; Sat, 07 Sep 2013 05:37:54 -0400 Original-Received: from [62.47.33.250] ([62.47.33.250]) by mail.gmx.com (mrgmx003) with ESMTPA (Nemesis) id 0MRoRF-1VP1Ee1hqj-00Svp8 for ; Sat, 07 Sep 2013 11:37:53 +0200 In-Reply-To: <85hadx584g.fsf@stephe-leake.org> X-Provags-ID: V03:K0:+gLzswjpr5myC8pYFS0R0KVOOgvjBAHcLxa8x38oeqVm1cEFxiK 3Z0SHnlLlxeDkzb9c2OE/OVH5k2hs+bRwsGf/Vir1+nK0Gf2VWJRACcCfX4KF2vF/ERztcP MjIxVS/blTNaU/GFU/ZINyuPXpCMMLzhNyvRtEp0h2a5NA/YCvEi8+9xu0eeoNOsteAJRXl YmCCwQa34Nuf9ZL4ODewA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163253 Archived-At: > `find-file' does not call `display-buffer'; `find-file-other-window' > does call `display-buffer'. (I just checked by enabling Edebug in > display-buffer.) > > `find-file' calls `switch-to-buffer' which calls `pop-to-buffer'. Usually, `switch-to-buffer' simply sets the buffer of the selected window. It calls `pop-to-buffer' only if something unexpected happens. But you're right in the sense that `find-file' is usually not affected by `display-buffer-alist'. > The same is true for all the other "put a buffer in this window" > user level functions I've encountered. Right. There was a period where Stefan wanted to deprecate calls of `switch-to-buffer' from Elisp but later Chong restored the old behavior (and neither wanted to change the specification of `switch-to-buffer' itself). IIRC he simply wanted to keep the old semantics unchanged. > `display-buffer-same-window' is an action for `display-buffer'. > > Ah! We could change the implementation of `find-file' to use > `display-buffer' with an action of `display-buffer-same-window'; that > action would be changed by prefix C-x 4 or C-x 5. Yes. We'd definitely have to replace all `switch-to-buffer' calls to propose an action like `display-buffer-same-window' if we wanted to make the prefixes work here. But we have to do it in some "overriding" sense to make sure that a user's "general" `display-buffer-alist' settings don't interfere with the semantics of the current operation. > `find-file-other-window' could then be implemented by setting > `display-buffer-overriding-action' and calling `find-file'. > > That would make sense, and should be mostly transparent to users. All > the other similar functions would have to be changed in a similar way - > I haven't tried to enumerate them. We could implement C-x 4 and 5 for > the current uses of `display-buffer' first, and see how people like it. We first have to handle the case where `display-buffer' pops up a *Completions* window (which might pop up a *Backtrace* window ...). I yet have no good idea how to do that. martin