emacs-devel
[Top][All Lists]
Advanced

[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: Tue, 01 Mar 2016 16:48:55 +0100
User-agent: mu4e 0.9.17; emacs 25.0.91.1

On Wed, Jan 20 2016, martin rudalics wrote:>
[split-window function that first reduces the margins]
> No.  ‘split-window-preferred-function’ only affects ‘display-buffer’.
> It does not affect ‘split-window’.  I attached a possible solution which
> is far from ideal.  I hope you get the idea.

I've finally gotten around to implementing this. Yes, I get the idea,
but there wasn't much I could improve, so I've basically taken your
function and adapted it for use in my package. Works fine for me so far,
and I haven't had any serious bug reports (yet).

>  A similar solution would
> be needed for ‘split-window-preferred-function’.  Essentially you would
> have to rewrite ‘split-window-sensibly’ with a reset/restore mechanism
> around the (window-splittable-p window t) and (split-window-right)
> forms.  Slightly more tricky ...

I've taken a slightly different approach. I wrote a function that unsets
the margins and then simply calls `split-window'. Since
`split-window-preferred-function' is a user option, it's not installed
by default. I've left that up to the user to decide. (Though I've set
the option and so far, everything works fine.)

Thanks for your help


-- 
Joost Kremers
Life has its moments



reply via email to

[Prev in Thread] Current Thread [Next in Thread]