From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.bugs Subject: bug#44483: 27.1.50; Window parameter `min-margins' doesn't split window in half Date: Fri, 06 Nov 2020 17:25:07 +0100 Message-ID: <87d00qihb0.fsf@fastmail.fm> References: <87tuu2inkv.fsf@fastmail.fm> <83ft5m8s5a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31743"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.6; emacs 27.1.50 Cc: 44483@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 06 17:26:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kb4Z0-00089d-Dt for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Nov 2020 17:26:11 +0100 Original-Received: from localhost ([::1]:36624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kb4Yy-00071b-Uh for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Nov 2020 11:26:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb4Ys-00071S-N7 for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2020 11:26:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kb4Ys-00056z-9Q for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2020 11:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kb4Ys-00029m-51 for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2020 11:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Joost Kremers Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Nov 2020 16:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44483 X-GNU-PR-Package: emacs Original-Received: via spool by 44483-submit@debbugs.gnu.org id=B44483.16046799198238 (code B ref 44483); Fri, 06 Nov 2020 16:26:02 +0000 Original-Received: (at 44483) by debbugs.gnu.org; 6 Nov 2020 16:25:19 +0000 Original-Received: from localhost ([127.0.0.1]:57117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb4YB-00028m-6O for submit@debbugs.gnu.org; Fri, 06 Nov 2020 11:25:19 -0500 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:57891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb4YA-00028a-1Q for 44483@debbugs.gnu.org; Fri, 06 Nov 2020 11:25:18 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 379C210DB; Fri, 6 Nov 2020 11:25:12 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 06 Nov 2020 11:25:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm1; bh=t/HZnesReT8L4BjSvL96mrnRZq HuD3/mRi96JthGXsc=; b=SU5OaighxJaiM+P0+mW/HlJqLU2S9a3WFzGvWD9jg3 EGHlbqeUpgybxVr6tHXPTRuU5gkyryLX1Shhy++FfGNWf7fn0FKuD8yS1lOwttgb nCigsc/4YQ0FZG4PC1GlwlXi/tRvkhb41/yokRkGy9gClNQCYeHoVP1uex7tFxYY RUTrru7PmmU4lvoX1SBxfKHxv2ov/nQI1AJeVfhCBgTT+CwrS/qAl/SouCMY+w7F zLmkE3Vj7MEQA++z0JleTGeQBFKDyYD93Qo0jfpRDK//diA+nKUrzyul5EL/ed3F p7uscuKwyguGqg3xDXKKLBZxW2fxeQujr/frE9Gpzo9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=t/HZne sReT8L4BjSvL96mrnRZqHuD3/mRi96JthGXsc=; b=lbuWEXwSkqoUUGQyiSbdq/ /Mx9RjYpsAi8H+c+/U4MRIp8E6PFy0xYL4TXIBbCXlTWNygXpOE719svJYs3o0y9 lvZwesS8LEUxbXFXydTeEUuiORZiY4LXAmeRK0hIAX50FY77D5rDayl1o+EUSxhb AZjjWhTQ7xm58R8oLUiT9O1IMin0pUJIW0IzVLVsKnOGBd/0aoPiFh4xGmH4kPe8 lNaXpmS5UXuk7V/LkN7UMXIikqcOqwJLdvP1BBdW4GkDQzFQ98ILw1r2j7YbZSlN d0mAQdd85xV+Y53ycA7HMlti3dnMU/53eVfxhwbQgmjsLCLh2IU+0EvE1d8dcNmQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtledgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufgjfffkgggtsehttdertddtredtnecuhfhrohhmpeflohhoshht ucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhmqe enucggtffrrghtthgvrhhnpefhudffuefhudelhffgleeukeegudevtedtudduhfefteeu gedvvedtuddugffffeenucfkphepleehrdeltddrvddvgedrvdeffeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjohhoshhtkhhrvghmvghr shesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from Swift.fastmail.com (ip5f5ae0e9.dynamic.kabel-deutschland.de [95.90.224.233]) by mail.messagingengine.com (Postfix) with ESMTPA id AAE06306005E; Fri, 6 Nov 2020 11:25:10 -0500 (EST) In-reply-to: <83ft5m8s5a.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192788 Archived-At: On Fri, Nov 06 2020, Eli Zaretskii wrote: >> From: Joost Kremers >> Date: Fri, 06 Nov 2020 15:09:36 +0100 >> >> >> 1. Open any text file, preferably with long lines (to better see the effect). >> >> 2. `M-x visual-line-mode RET` >> >> 3. `M-: (set-window-margins (selected-window) 0 150) RET` >> >> The number 150 is arbitrary. It's appropriate for my case (with a frame width of >> about 238 characters). >> >> 4. `M-: (set-window-parameter (selected-window) 'min-margins '(0 . 0)) RET` >> >> 5. `C-x 3` >> >> At this point, I expect the window to be split into two equally-sized >> side-by-side windows, but the split is at about one third of the original window >> width. > > That expectation is incorrect by default. Well, let me put it this way: If I split a window in which the margins are nil, `split-window-right`, in my experience, always splits the window in half. (Perhaps there are cases where that is not guaranteed, I don't know, but I've never seen any.) My (perhaps naive) expectation was that with `min-margins' set to (0 . 0), `split-window' essentially treats this window as if the margins are nil, so I expected to get a 50/50 split. > To have the windows > equally-sized, you need to set window-combination-resize to t, AFAIU, > otherwise Emacs makes no promise that your expectation will be heeded. A quick check suggests that `window-combination-resize' has no effect here. I still get the 1/3 - 2/3 split at least some of the time. (Mind you, I'm splitting a window that's the single window in its frame, so AFAIU there is no window combination to speak of, and `window-combination-resize' should have no visible effect, from what I can tell from its documentation.) >> Note that in this recipe, the margins of the two windows aren't adjusted after >> the split, so in the left window the text is not visible at all and in the right >> window, the text area is two characters wide. (In my case, YMMV.) > > You expected Emacs to adjust the margins? No, I don't. `visual-fill-column-mode' makes sure the margins are resized after the split. That works as it should. I just mentioned it here because that part of `visual-fill-column-mode' isn't replicated by the recipe. But that's not relevant here, so just ignore it. > The min-margins parameters > is consulted only when determining whether the window can be split, it > has no effect whatsoever on the window dimensions after the split. Yeah, but that's exactly what I'm stumbling over. I've never seen such a 1/3-2/3 split, but now I'm suddenly getting it. So something is causing split-window to treat a window with wide margins and `min-margins' set to (0 . 0) differently from a window with no margins (but otherwise equally sized in an equally sized frame). Whether that something is a bug or not, I can't say. If it's not, though, I'd really like to know if there's a workaround. -- Joost Kremers Life has its moments