[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: split-window-right doesn't work with wide margins
From: |
martin rudalics |
Subject: |
Re: split-window-right doesn't work with wide margins |
Date: |
Mon, 18 Jan 2016 11:30:54 +0100 |
> a recent change on emacs-25 seems to cause problems for
> split-window-right when a window has wide margins. To reproduce, simply
> create a wide frame with one window, create a wide right margin with
> `M-: (set-window-margins nil nil 130)` and then `C-x 3`. This will
> produce the following error
>
> split-window: Window #<window 3 on *scratch*> too small for splitting (2)
>
> Does anyone know what change may have caused this?
If you're sure that this is a recent change, please try to locate it.
Here Emacs 25 behaves right as Emacs 24.5 in this regard.
> And is it intentional
> behaviour or should this be considered a bug?
The window on the right conceptually inherits the margins from the
original window. If the margins won't fit, Emacs signals an error.
You could try to bind C-x 3 to a function based on ‘split-window’ that
explicitly sets its SIZE argument to something like half of the width of
the selected window. Obviously, this will rely on a suitable function
on ‘window-configuration-change-hook’ that resets margins appropriately.
Or write a ‘split-window-function’ which, when a window shall be split
horizontally, first resets the margins of the original window to a small
value, calls the orginal ‘split-window’ and restores the margins to some
suitable value afterwards.
martin