From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen 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:33:06 -0700 Message-ID: <87musl9x31.fsf@ericabrahamsen.net> References: <9755.9843.306611.23448@gargle.gargle.HOWL> <87y3c7pw4w.fsf@ericabrahamsen.net> <87h8iuik3g.fsf@moondust.localdomain> <87o9d2eaql.fsf@ericabrahamsen.net> <875zzawbd6.fsf_-_@moondust.localdomain> <5B9A1599.2060800@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536856323 20222 195.159.176.226 (13 Sep 2018 16:32:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Sep 2018 16:32:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: "N. Jackson" , Roland Winkler , Stefan Monnier , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 13 18:31:59 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 1g0UX6-00051p-Pp for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2018 18:31:57 +0200 Original-Received: from localhost ([::1]:43420 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0UZC-0003kP-Sz for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2018 12:34:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0UYQ-0003kG-LW for emacs-devel@gnu.org; Thu, 13 Sep 2018 12:33:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0UYN-00069a-Gr for emacs-devel@gnu.org; Thu, 13 Sep 2018 12:33:18 -0400 Original-Received: from mail.ericabrahamsen.net ([50.56.99.223]:57165) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g0UYN-00060Z-BC; Thu, 13 Sep 2018 12:33:15 -0400 Original-Received: from localhost (174-21-164-146.tukw.qwest.net [174.21.164.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 3E583C302E; Thu, 13 Sep 2018 16:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1536856388; bh=Xt38UWat1ifpQjF8xDodA884VSE+EpUebBhwasvpp00=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=zZHmIAD734awyiI/R4TgDuaDJmYesvsscSpAmuV8mZnScdK29d7xFR7DzNUb6aWts 3u/CzhOETtuvpL+nVDXG8P3ObaDAzvnvqOqATLywlL1XIzyMkob/z0oJZtqUBR51Yr ql1RVDNorkru1wDoGpCmM60hqUWAvGzuMN5vSi6U= In-Reply-To: <5B9A1599.2060800@gmx.at> (martin rudalics's message of "Thu, 13 Sep 2018 09:45:29 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 50.56.99.223 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:229739 Archived-At: martin rudalics writes: >> 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. I thought this is what side windows are for? Maybe it would be tricky to save and restore whole-frame window configurations (though there are other tools for that), but side windows, combined perhaps with atomic windows, seem like the right tool for making rectangular compositions. The docs even say something about making Emacs look like a traditional IDE, etc...