aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2019-02-20 11:17:23 +0100
committerMartin Rudalics2019-02-20 11:17:23 +0100
commit15a2b2c0716079a078b1147a6d9e89ce4d343fd6 (patch)
tree655ee827f6d38c9f71a9aa7240c3c2174cc52edb
parent712661b4ab94eb4fbde51d2f96f011e38380883e (diff)
downloademacs-15a2b2c0716079a078b1147a6d9e89ce4d343fd6.tar.gz
emacs-15a2b2c0716079a078b1147a6d9e89ce4d343fd6.zip
Fix handling of MINIBUF argument in 'walk-window-tree'
* lisp/window.el (walk-window-tree): Handle MINIBUF argument as advertised when FRAME is minibuffer-only. (window--resize-apply-p, window--sanitize-window-sizes) (delete-other-windows, split-window-sensibly): Call 'walk-window-tree' with suitable MINIBUF argument.
-rw-r--r--lisp/window.el34
1 files changed, 19 insertions, 15 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 19f84696e0f..80828bb35c8 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -571,23 +571,25 @@ FRAME.
571 571
572Optional argument MINIBUF t means run FUN on FRAME's minibuffer 572Optional argument MINIBUF t means run FUN on FRAME's minibuffer
573window even if it isn't active. MINIBUF nil or omitted means run 573window even if it isn't active. MINIBUF nil or omitted means run
574FUN on FRAME's minibuffer window only if it's active. In both 574FUN on FRAME's minibuffer window only if it's active. In either
575cases the minibuffer window must be part of FRAME. MINIBUF 575case the minibuffer window must be part of FRAME. MINIBUF
576neither nil nor t means never run FUN on the minibuffer window. 576neither nil nor t means never run FUN on the minibuffer window.
577 577
578This function performs a pre-order, depth-first traversal of the 578This function performs a pre-order, depth-first traversal of the
579window tree. If FUN changes the window tree, the result is 579window tree. If FUN changes the window tree, the result is
580unpredictable." 580unpredictable."
581 (setq frame (window-normalize-frame frame)) 581 (let ((root (frame-root-window frame))
582 (walk-window-tree-1 fun (frame-root-window frame) any) 582 (mini (minibuffer-window frame)))
583 (when (memq minibuf '(nil t)) 583 (setq frame (window-normalize-frame frame))
584 (unless (eq root mini)
585 (walk-window-tree-1 fun root any))
584 ;; Run FUN on FRAME's minibuffer window if requested. 586 ;; Run FUN on FRAME's minibuffer window if requested.
585 (let ((minibuffer-window (minibuffer-window frame))) 587 (when (and (window-live-p mini)
586 (when (and (window-live-p minibuffer-window) 588 (eq (window-frame mini) frame)
587 (eq (window-frame minibuffer-window) frame) 589 (or (eq minibuf t)
588 (or (eq minibuf t) 590 (and (not minibuf)
589 (minibuffer-window-active-p minibuffer-window))) 591 (minibuffer-window-active-p mini))))
590 (funcall fun minibuffer-window))))) 592 (funcall fun mini))))
591 593
592(defun walk-window-subtree (fun &optional window any) 594(defun walk-window-subtree (fun &optional window any)
593 "Run function FUN on the subtree of windows rooted at WINDOW. 595 "Run function FUN on the subtree of windows rooted at WINDOW.
@@ -2773,7 +2775,7 @@ shall be resized horizontally."
2773 (unless (= (window-new-pixel window) 2775 (unless (= (window-new-pixel window)
2774 (window-size window horizontal t)) 2776 (window-size window horizontal t))
2775 (throw 'apply t))) 2777 (throw 'apply t)))
2776 frame t) 2778 frame t t)
2777 nil)) 2779 nil))
2778 2780
2779(defun window-resize (window delta &optional horizontal ignore pixelwise) 2781(defun window-resize (window delta &optional horizontal ignore pixelwise)
@@ -3393,7 +3395,8 @@ may happen when the FRAME is not large enough to accommodate it."
3393 (when (> delta 0) 3395 (when (> delta 0)
3394 (if (window-resizable-p window delta horizontal nil t) 3396 (if (window-resizable-p window delta horizontal nil t)
3395 (window-resize window delta horizontal nil t) 3397 (window-resize window delta horizontal nil t)
3396 (setq value nil)))))) 3398 (setq value nil)))))
3399 nil nil 'nomini)
3397 value)) 3400 value))
3398 3401
3399(defun adjust-window-trailing-edge (window delta &optional horizontal pixelwise) 3402(defun adjust-window-trailing-edge (window delta &optional horizontal pixelwise)
@@ -4171,7 +4174,8 @@ any window whose `no-delete-other-windows' parameter is non-nil."
4171 (and (not (window-parameter other 'window-side)) 4174 (and (not (window-parameter other 'window-side))
4172 (window-parameter 4175 (window-parameter
4173 other 'no-delete-other-windows))) 4176 other 'no-delete-other-windows)))
4174 (throw 'tag nil)))) 4177 (throw 'tag nil)))
4178 nil nil 'nomini)
4175 t) 4179 t)
4176 (setq main (window-main-window frame))) 4180 (setq main (window-main-window frame)))
4177 (t 4181 (t
@@ -6655,7 +6659,7 @@ split."
6655 (unless (or (eq w window) 6659 (unless (or (eq w window)
6656 (window-dedicated-p w)) 6660 (window-dedicated-p w))
6657 (throw 'done nil))) 6661 (throw 'done nil)))
6658 frame) 6662 frame nil 'nomini)
6659 t))) 6663 t)))
6660 (not (window-minibuffer-p window)) 6664 (not (window-minibuffer-p window))
6661 (let ((split-height-threshold 0)) 6665 (let ((split-height-threshold 0))