unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Nicolas Desprès" <nicolas.despres@gmail.com>,
	"martin rudalics" <rudalics@gmx.at>
Cc: rpluim@gmail.com, juri@linkov.net, emacs-devel@gnu.org
Subject: Re: Prefer to split along the longest edge
Date: Thu, 19 Dec 2024 08:39:30 +0200	[thread overview]
Message-ID: <86ttb0kwgt.fsf@gnu.org> (raw)
In-Reply-To: <CAPqtr1LX6OPi+jY+ufL=iBei824qUr_-X=uwniTsawy-0zL5zg@mail.gmail.com> (message from Nicolas Desprès on Wed, 18 Dec 2024 22:08:58 +0100)

> From: Nicolas Desprès <nicolas.despres@gmail.com>
> Date: Wed, 18 Dec 2024 22:08:58 +0100
> Cc: Eli Zaretskii <eliz@gnu.org>, 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?



  reply	other threads:[~2024-12-19  6:39 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-14 10:05 Prefer to split along the longest edge Nicolas Desprès
2024-12-14 11:30 ` Eli Zaretskii
2024-12-14 11:45   ` Nicolas Desprès
2024-12-14 12:34     ` Eli Zaretskii
2024-12-14 14:06       ` Nicolas Desprès
2024-12-14 14:55         ` Eli Zaretskii
2024-12-14 15:41           ` Nicolas Desprès
2024-12-14 17:16   ` martin rudalics
2024-12-14 17:33     ` Eli Zaretskii
2024-12-14 17:36     ` Eli Zaretskii
2024-12-14 18:35 ` Juri Linkov
2024-12-14 20:10   ` Nicolas Desprès
2024-12-15  7:34     ` Juri Linkov
2024-12-15  9:29       ` Nicolas Desprès
2024-12-16  7:55         ` Juri Linkov
2024-12-16 11:56           ` Nicolas Desprès
2024-12-16 17:14             ` Eli Zaretskii
2024-12-16 17:44               ` Juri Linkov
2024-12-16 19:07                 ` Eli Zaretskii
2024-12-16 19:14                   ` Juri Linkov
2024-12-16 19:53                     ` Eli Zaretskii
2024-12-17  6:12                       ` Nicolas Desprès
2024-12-17  7:40                         ` Juri Linkov
2024-12-17  8:35                           ` Nicolas Desprès
2024-12-17  9:02                             ` martin rudalics
2024-12-17  9:09                               ` Nicolas Desprès
2024-12-17 13:34                               ` Eli Zaretskii
2024-12-18 10:05                                 ` martin rudalics
2024-12-18 14:12                                   ` Eli Zaretskii
2024-12-18 16:24                                     ` martin rudalics
2024-12-18 16:55                                       ` Eli Zaretskii
2024-12-18 17:41                                         ` martin rudalics
2024-12-18 18:41                                           ` Eli Zaretskii
2024-12-18 19:13                                             ` martin rudalics
2024-12-19  7:06                                           ` Juri Linkov
2024-12-18 17:25                                       ` Juri Linkov
2024-12-17  6:06               ` Nicolas Desprès
2024-12-17 12:52                 ` Eli Zaretskii
2024-12-17 12:59                 ` Eli Zaretskii
2024-12-17 13:12                   ` Robert Pluim
2024-12-18 21:08                     ` Nicolas Desprès
2024-12-19  6:39                       ` Eli Zaretskii [this message]
2024-12-19  8:52                         ` martin rudalics
2024-12-19  9:21                           ` Eli Zaretskii
2024-12-19 16:20                             ` Nicolas Desprès
2024-12-20  9:03                               ` martin rudalics
2024-12-20 14:43                                 ` Nicolas Desprès
2024-12-20 15:05                                   ` Robert Pluim
2024-12-20 20:25                                     ` Stephen Berman
2024-12-21 11:54                                       ` Nicolas Desprès
2024-12-16 17:32             ` Juri Linkov
2024-12-17  9:01               ` martin rudalics
2024-12-17 13:32                 ` Eli Zaretskii
2024-12-17  1:51             ` Liu Hui
2024-12-17  7:43               ` Juri Linkov
2024-12-17  8:27                 ` Nicolas Desprès
2024-12-17  8:26               ` Nicolas Desprès
2024-12-16 17:15           ` [External] : " Drew Adams
2024-12-17  8:39             ` Nicolas Desprès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ttb0kwgt.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=nicolas.despres@gmail.com \
    --cc=rpluim@gmail.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).