aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/window.el35
1 files changed, 24 insertions, 11 deletions
diff --git a/lisp/window.el b/lisp/window.el
index f87294ceb15..8939e7d589b 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -6465,8 +6465,9 @@ If this is an integer, `split-window-sensibly' may split a window
6465vertically only if it has at least this many lines. If this is 6465vertically only if it has at least this many lines. If this is
6466nil, `split-window-sensibly' is not allowed to split a window 6466nil, `split-window-sensibly' is not allowed to split a window
6467vertically. If, however, a window is the only window on its 6467vertically. If, however, a window is the only window on its
6468frame, `split-window-sensibly' may split it vertically 6468frame, or all the other ones are dedicated,
6469disregarding the value of this variable." 6469`split-window-sensibly' may split it vertically disregarding the
6470value of this variable."
6470 :type '(choice (const nil) (integer :tag "lines")) 6471 :type '(choice (const nil) (integer :tag "lines"))
6471 :version "23.1" 6472 :version "23.1"
6472 :group 'windows) 6473 :group 'windows)
@@ -6573,15 +6574,27 @@ split."
6573 ;; Split window horizontally. 6574 ;; Split window horizontally.
6574 (with-selected-window window 6575 (with-selected-window window
6575 (split-window-right))) 6576 (split-window-right)))
6576 (and (eq window (frame-root-window (window-frame window))) 6577 (and
6577 (not (window-minibuffer-p window)) 6578 ;; If WINDOW is the only usable window on its frame (it is
6578 ;; If WINDOW is the only window on its frame and is not the 6579 ;; the only one or, not being the only one, all the other
6579 ;; minibuffer window, try to split it vertically disregarding 6580 ;; ones are dedicated) and is not the minibuffer window, try
6580 ;; the value of `split-height-threshold'. 6581 ;; to split it vertically disregarding the value of
6581 (let ((split-height-threshold 0)) 6582 ;; `split-height-threshold'.
6582 (when (window-splittable-p window) 6583 (let ((frame (window-frame window)))
6583 (with-selected-window window 6584 (or
6584 (split-window-below)))))))) 6585 (eq window (frame-root-window frame))
6586 (catch 'done
6587 (walk-window-tree (lambda (w)
6588 (unless (or (eq w window)
6589 (window-dedicated-p w))
6590 (throw 'done nil)))
6591 frame)
6592 t)))
6593 (not (window-minibuffer-p window))
6594 (let ((split-height-threshold 0))
6595 (when (window-splittable-p window)
6596 (with-selected-window window
6597 (split-window-below))))))))
6585 6598
6586(defun window--try-to-split-window (window &optional alist) 6599(defun window--try-to-split-window (window &optional alist)
6587 "Try to split WINDOW. 6600 "Try to split WINDOW.