GNU bug report logs -
#3142
23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically
Previous Next
Full log
Message #12 received at 3142 <at> emacsbugs.donarmstrong.com (full text, mbox):
> I would expect that split-window-preferred-function would accept
> split-window-horizontally and split-window-vertically.
`split-window-preferred-function', if non-nil, must be a function called
with a WINDOW as single argument. `split-window-vertically' and
`split-window-horizontally' are functions that split the selected window
and take a SIZE argument. Hence, when you set
`split-window-preferred-function' to `split-window-vertically' as you
did you will get a
split-window-vertically: Window height 1 too small (after splitting)
error because you call `split-window-vertically' with a window as
argument, and `prefix-numeric-value' when called with a window as
argument returns 1, a SIZE argument disliked by `split-window'.
Sounds contrived, but I don't have a better explanation.
If you really need `split-window-preferred-function' use
`split-window-vertically' you have to write a wrapper like
(defun my-split-window-function (window)
(with-selected-window window
(split-window-vertically)))
> At the very
> least, there should be an easy way to set this to "always split
> vertically", "always split horizontally", and "intelligently split".
Setting `split-width-threshold' nil for "always split vertically" and
`split-height-threshold' nil for "always split horizontally" should
accomplish that. Can't you use these directly?
martin
This bug report was last modified 13 years and 291 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.