all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 44483@debbugs.gnu.org
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	[thread overview]
Message-ID: <87d00qihb0.fsf@fastmail.fm> (raw)
In-Reply-To: <83ft5m8s5a.fsf@gnu.org>


On Fri, Nov 06 2020, Eli Zaretskii wrote:
>> From: Joost Kremers <joostkremers@fastmail.fm>
>> 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





  reply	other threads:[~2020-11-06 16:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 14:09 bug#44483: 27.1.50; Window parameter `min-margins' doesn't split window in half Joost Kremers
2020-11-06 14:41 ` Eli Zaretskii
2020-11-06 16:25   ` Joost Kremers [this message]
2020-11-06 18:29     ` Eli Zaretskii
2020-11-06 18:12 ` martin rudalics
2020-11-06 20:36   ` Joost Kremers
2020-11-07  9:00     ` martin rudalics
2020-11-08 15:00       ` Joost Kremers
2020-11-09  8:31         ` martin rudalics
2021-10-11 12:35           ` Stefan Kangas
2021-10-11 17:18             ` martin rudalics

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

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

  git send-email \
    --in-reply-to=87d00qihb0.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --cc=44483@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.