>> + (defcustom split-window-preferred-function 'split-selected-window >> + "Function called by `display-buffer' to split a window. >> + The window that shall be split is selected when this function is >> + called. The function is supposed to either return the new window >> + or nil if the window can (or shall) not be split." >> + :type 'function >> + :version "23.1" >> + :group 'windows) > > If setting this option to `split-window-horizontally' and > `split-window-vertically' is possible and it works correctly > with these value, then I suggest adding them as constants, > e.g. "Always split horizontally" and "Always split vertically". Done. But note that a function like `split-window-vertically' is suited for interactive use and thus may throw an error when the window is too small. I can't allow an error in `display-buffer' so I have to wrap that call in a `condition-case'. > Also I suggest keeping the common function name prefix "split-window-", > i.e. instead of `split-selected-window' to name it something like > "split-window-sensibly" or "split-window-with-thresholds". I've chosen `split-window-sensibly'. It also calls `split-window-vertically' and `split-window-horizontally' now. Please try the new patch - we're in pretest and I don't want to take too many chances. martin