[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: split-window-right doesn't work with wide margins
From: |
Joost Kremers |
Subject: |
Re: split-window-right doesn't work with wide margins |
Date: |
Wed, 20 Jan 2016 13:58:58 +0100 |
User-agent: |
mu4e 0.9.15; emacs 24.5.50.1 |
On Mon, Jan 18 2016, martin rudalics <address@hidden> wrote:
> > 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.
`git bisect` points to commit 3477e27 `Complete pixelwise frame/window
resizing, add horizontal scrollbar support.'
> > 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.
Actually, Emacs 24.5 adjusts the window margins:
- emacs -Q
- create a wide frame with one window (window-width reports 236 in my
case)
- M-: (set-window-margins nil nil 130)
- C-x 3
In Emacs 24.5, I am now left with two side-by-side windows that each
have a right margin of 114 (as reported by `window-margins`), but after
the commit above, the same procedure leads to an error message.
> 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.
I found a variable `split-window-preferred-function`, which is probably
what you mean? Would it be possible to give that variable a buffer-local
value and set it to a function that first resets the window margins and
then calls the default value of `split-window-preferred-function`?
--
Joost Kremers
Life has its moments