From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Suggesting `frame-split-biggest-window' Re: customize location and shape of a new window in a frame Date: Thu, 13 Sep 2018 09:45:29 +0200 Message-ID: <5B9A1599.2060800@gmx.at> References: <9755.9843.306611.23448@gargle.gargle.HOWL> <87y3c7pw4w.fsf@ericabrahamsen.net> <87h8iuik3g.fsf@moondust.localdomain> <87o9d2eaql.fsf@ericabrahamsen.net> <875zzawbd6.fsf_-_@moondust.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1536824718 29354 195.159.176.226 (13 Sep 2018 07:45:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Sep 2018 07:45:18 +0000 (UTC) Cc: emacs-devel@gnu.org, Roland Winkler , Stefan Monnier To: "N. Jackson" , Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 13 09:45:14 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0MJN-0007W4-FV for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2018 09:45:13 +0200 Original-Received: from localhost ([::1]:40938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0MLU-0003Lx-0t for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2018 03:47:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0MKE-0003L9-G8 for emacs-devel@gnu.org; Thu, 13 Sep 2018 03:46:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0MKD-0004nM-KR for emacs-devel@gnu.org; Thu, 13 Sep 2018 03:46:06 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:53787) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g0MK9-0004jc-CF; Thu, 13 Sep 2018 03:46:01 -0400 Original-Received: from [192.168.1.101] ([213.162.73.2]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MMXVC-1fuIaC0LS2-008H9u; Thu, 13 Sep 2018 09:45:38 +0200 In-Reply-To: <875zzawbd6.fsf_-_@moondust.localdomain> X-Provags-ID: V03:K1:CaFGv/rVTd4m2/1GrOxn4Aw5HHkJLVxfih7KL5bbzVysDqFBMtG kFuu7IaGrLxmNTpsaZZqQjSjACyIOIR2yAm8PvovFsBR8qWVcDXZ1DwMdXn8GorXGGHLbGM ts7TXdWEOAWVqIGd2HNGd8wYagEThbCjvFEQ5EB+RderPe3QlTnhqHeA+4s4QzM4nCWt8Fv QtIZIPnsZdUYNuqjoORQw== X-UI-Out-Filterresults: notjunk:1;V01:K0:L96idG1cKew=:cQwJ1iohh5DyZbsFrotYRS uu1Fbwz1eOt0BMAPkBD0/+9zRJSgIO+fBbbLctxMwCusm7oRypOROsVpKVwYr5SnypCBz1DbB xrDFxUdx494ZIlOxznt8EK063Rs7Seaqsb+RbXqOQCA2tiGN3jXwJQn5Ktv+4AE4sdPNqu0Kr L/NO+GfeKyXssMIf+NjzTWRiW4qIatNiU2CX+GMRhgr9YBXHJ+c4g4RzgcnX4xkfOC+gNt+KV 7YpUCqxF17G9aCQ3aVGFq0G591OYke1a8k4c5vRHTR0/Mbq8htzbwvKVnCBETHVSseg8Wshzu nvoF10v5baLla09kZ7xgc7oCafL2ybUyRj3i8oQhB8WFA9HyTy+Iew8t3dzJMwPiIB9JQp9PD 28LfJbUJRiPrHHLhhQHCPFV5vbdCubQL8Ga208miWQSF+FzOIqeuqQvy7R+qubRqhk2BkTkt/ rMtJJY8TgriW2c3ecfIh9qt5LFQxboMZMVb0b1m0wVgkybq4DfR5dvZbsM/OKaqXB+kX2nyfV +289o0hQMnGf2RSaMCRjkbGpShTtwF6BwTOFpSpP7Lh+JrxaYgR1Q0SC4K20mjmrB5UrS7vw8 JkyDLvwaIN2El6KMbhflKgkWd2+HzHEWOAk5aZ8q3OGlGQoyhXkUebReOE0+VUUDBZgdUWRdB bvA2cZES9jn+3pa5rbn6kkIo8iKsTohNGsZjyq2Bt0alyQXVZwy+csfTeHJkfKpDM7Zs6XmUY qhLS2Hxe5KF2ub+zm5Nbp+0gJPTv6F8w+t3T0VCeesegS89h7pSozPw99u5fddmApvfphaQt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:229736 Archived-At: > If there was a function (frame-split-biggest-window FRAME SIZE SIDE > PIXELWISE) to split the "biggest" [*] window in the frame, then > neither BBDB nor any other Elisp code would need to keep reinventing > this wheel. > > (The other two functions, more for interactive use, would be > `frame-split-biggest-window-below' and > `frame-split-biggest-window-right'.) > > [*] To find the "biggest" window when splitting below, find the > tallest window or windows and split the widest of them; when > splitting right, find the widest window or windows and split the > tallest of them. We have a number of options for that. One of them is the option 'split-window-preferred-function' (a misnomer) which is by default set to 'split-window-sensibly'. Consult their definitions first. The latter's behavior is guided by the options 'split-height-threshold' and 'split-width-threshold' (two more misnomers) . Together, these should provide a boilerplate for writing your own function which you can then put into 'display-buffer-alist'. One functionality Emacs is sadly lacking is that of orderly setting up and saving compositions of windows in form of a rectangle. Eclipse calls these "perspectives", in Emacs the concept of "window state" comes most closely. Currently, you have to set up such a state by using a sequence of 'split-window' calls which requires to know the intrinsics of window splitting, the relationship of parent and child windows, window combinations and the like. Using 'display-buffer' for setting up states will hardly produce good results. It would be nice to have some sort of basic, prefabricated layouts like the ones you sketched and choose from them (though a four window layout with a different window in each corner of them frame would still require to know whether the root window is a vertical or horizontal combination). But I have no good idea yet which layout types are really needed and how to provide a suitable interface for accessing them. IIRC the "Emacs IDE" had provisions for them but I have not heard from its developers for years. martin