From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Prefer to split along the longest edge Date: Thu, 19 Dec 2024 08:39:30 +0200 Message-ID: <86ttb0kwgt.fsf@gnu.org> References: <87r06a3yfg.fsf@mail.linkov.net> <87zfkx2ydr.fsf@mail.linkov.net> <8734io2hac.fsf@mail.linkov.net> <86pllrpn2p.fsf@gnu.org> <86o71ao47d.fsf@gnu.org> <874j324fni.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35581"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, juri@linkov.net, emacs-devel@gnu.org To: Nicolas =?utf-8?Q?Despr=C3=A8s?= , martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 19 07:40:21 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tOACq-000926-BJ for ged-emacs-devel@m.gmane-mx.org; Thu, 19 Dec 2024 07:40:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOACB-0002py-GD; Thu, 19 Dec 2024 01:39:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOAC7-0002jh-Q2 for emacs-devel@gnu.org; Thu, 19 Dec 2024 01:39:36 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOAC6-0000rw-Fd; Thu, 19 Dec 2024 01:39:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=N70jqyac3od/nmw1qAkVf0APNZJJhPEMMM5vNuTpY2s=; b=bS5RLAMJ3QWg2CQKxiED 9yv5HWpVSb50AY/TRdwDoStEluu0G5Lck0Uh7Vy1OvaVL1be474f078X18z9oRSWh7quRtHCptaLP Ci5LKmVmRpHxoP6CybKXl0FyPyHNUCNnEgXK8uouSvzFyWuRbYS4G+Haom5/dA/iwm+tFpgUyi3rr /RTJ1yyB3ttW2qhnhgeiwDRM4ACKW2A3O2l1lyBy1RtLa9JphJJiaIpvVhe8ZPV9yXVuroqUcjzLs eDD5022XqS/x25xAybmGRut/8QgorvY5tuAm+MEoXQ/OCf0xKaXBvusSMn76AwGY8btWjwFTnwxha uKAKCAkP0tfalQ==; In-Reply-To: (message from Nicolas =?utf-8?Q?Despr=C3=A8s?= on Wed, 18 Dec 2024 22:08:58 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326698 Archived-At: > From: Nicolas Desprès > Date: Wed, 18 Dec 2024 22:08:58 +0100 > Cc: Eli Zaretskii , juri@linkov.net, emacs-devel@gnu.org > > Thanks Robert and Eli for your review, and sorry for the delayed answer, it has been pretty busy at work > lately. > > You'll find attached a new version of the patch that should address all your remarks. Thanks, a few minor nits for the documentation parts below. > @@ -519,7 +520,9 @@ Window Choice > @code{split-width-threshold} is smaller than the window's width, the > split puts the new window on the right. If neither condition holds, > Emacs tries to split so that the new window is below---but only if the > -window was not split before (to avoid excessive splitting). > +window was not split before (to avoid excessive splitting). Whether > +Emacs tries to split the vertical or horizontal edge first, is > +determined by the value of @code{split-window-preferred-direction}. Instead of "tries to split the vertical or horizontal edge first", I'd prefer a simpler "tries first to split vertically or horizontally". The "edge" part might confuse some readers. > ++++ > +*** New user option 'split-window-preferred-direction'. > +Users can now choose which edge (vertical or horizontal) is tried to be > +split first. Same rewording here. "Users can now choose in which direction Emacs tries to split windows first: vertical or horizontal." > +(defcustom split-window-preferred-direction 'vertical > + "The edge that will be first tried when Emacs need to split a window. Likewise here: I'd replace "edge" with "direction" or "dimension". > +When this variable is to `vertical' (the default) Emacs tries to split ^^^^^ "is set to" > +vertically first and then horizontally. If set to `horizontal' it does > +the opposite. When set to `longest', it the first direction tried will ^^ Two spaces there. Also, please use "If set to", not "When set to", to avoid potential confusion due to misinterpretation of "when" as something time-related. > +depends on the frame shape: in landscape orientation it will be like > +`horizontal', but in portrait it will be like `vertical'. Basically the > +longest edge is split first. ^^^^^^^^^^^^ "longest dimension", perhaps? or "longest window dimension"? > +If both `split-width-threshold' and `split-height-threshold' cannot be > +satisfied, Emacs will fallback to split vertically. ^^^^^^^^ "fall back", two words. Also, given the effect of this new option, I think we should say ".. will fall back to splitting vertically, regardless of the value of this variable." Otherwise, it is not immediately clear how this sentence is related to this variable. > + (const :tag "Try to split along the longest edge first" I'd use "the longest dimension" instead of "longest edge". > + If the threshold > +(`split-height-threshold' respectively `split-width-threshold') > +specifies an integer, WINDOW is at least that threshold lines tall > +(respectively wide) and can be split (vertically respectively > +horizontally). This sentence doesn't look right, and the doc string in general is hard to read and understand, because it tries to say things too concisely. How about this variant: WINDOW defaults to the currently selected window. If the split-size threshold of the window dimension determined by `split-window-preferred-direction' specifies an integer, the corresponding dimension of WINDOW is at least that large, then first try splitting window in two along that dimension (one below the other if splitting vertically, side by side if splitting horizontally). The relevant threshold is `split-height-threshold' when splitting vertically, and `split-width-threshold' when splitting horizontally. If splitting along the preferred dimension fails, try splitting WINDOW along the other dimension. If that also fails, and WINDOW is the only window on its frame, try splitting WINDOW vertically disregarding the value of `split-height-threshold'. If splitting succeeds, return the lower window if splitting vertically, the right one if splitting horizontally. If splitting fails, return nil. Martin, any comments or corrections to the above doc string?