Following discussion on emacs-devel (thread "Window splitting issues with margins"), this patch replaces the call to `window-width' in `window-splittable-p' with `window-total-width'. This takes the window margins into account when determining if a window can be split horizontally. Note: a similar change to `window-height' isn't necessary, because `window-height' is an alias for `window-total-height'. (Whereas `window-width' is an alias for `window-body-width'.) BTW: this is my first patch. I have no idea if I got all the conventions right...