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: Sat, 14 Dec 2024 13:30:46 +0200 Message-ID: <86a5cyv6vt.fsf@gnu.org> References: 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="40751"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 Sat Dec 14 12:31:53 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 1tMQNF-000ARN-F2 for ged-emacs-devel@m.gmane-mx.org; Sat, 14 Dec 2024 12:31:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMQMI-0000t7-RA; Sat, 14 Dec 2024 06:30:54 -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 1tMQMG-0000si-Ah for emacs-devel@gnu.org; Sat, 14 Dec 2024 06:30:52 -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 1tMQME-0004IZ-M7; Sat, 14 Dec 2024 06:30:51 -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=Bajgwg0woTRMx67kAdigys3WmJ79mhwcDc7q1XaDk3Q=; b=NczIRn2WH5Dn3tQzgZFQ W7HVNfeJmY4O2PHsZ+rKyNo//aca3Xg61BKvucpdfBYWfbMVc0l/72ycsXN631ciqjMk53RrDHTCc 7pHuru/W+ZCUEy9KAnvwS2jauiuQp8X8cIOdqHW1oJioc7SNvWRMSCIcKr1CHCHME8c8XcDqEkccw VWAv4PqqCiI9mfTmmRydUCul+6dkDrZk6PlIvK0deujiWjzFApYUiJNXC6P73G/NsNiJLIqIwTW6e 7PJYYBD76goMB5iVYz9YoCzEsvPEVBTP4mUUuGZgyXE8wnmRbzmfPu65YN9ZYfSPvwb+Mv3/KvN/f /zuCovVp+F/MAQ==; In-Reply-To: (message from Nicolas =?utf-8?Q?Despr=C3=A8s?= on Sat, 14 Dec 2024 11:05:30 +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:326480 Archived-At: > From: Nicolas Desprès > Date: Sat, 14 Dec 2024 11:05:30 +0100 > > Currently, `split-window-sensibly' prefers to split vertically, > disregarding the shape of the frame. This is a good default when > Emacs is taller than wider. However, when Emacs is in fullscreen > (landscape screen layout), splitting vertically is generally not the > thing to do because there is plenty of space on the right. > > Typical scenario: Emacs is in fullscreen; one buffer is open in a window > covering the entire frame. Another buffer is opened in a second > window (C-x 4 f). In this case, the split should generally be horizontal. > The attached patch changes `split-window-sensibly' to just try > spliting the longest edge first. It works well when implemented in my init.el > and installed by setting `split-window-preferred-function'. Why don't the user options split-height-threshold and split-width-threshold we already have are not enough to allow to have this without any code changes? I add martin to this discussion, since I expect him to have a lot of insight on these matters. Thanks.