summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2012-04-20 10:49:24 +0200
committerMartin Rudalics <rudalics@gmx.at>2012-04-20 10:49:24 +0200
commit41cfe0cb4c3cad4c4a417f8a91eb0180e5cc7211 (patch)
treefe5bca88f83a08cbba4f1dd5ee48f984a928e33a /lisp/window.el
parent50e5ebca7edcf5299b89ff74499991de01e22046 (diff)
downloademacs-41cfe0cb4c3cad4c4a417f8a91eb0180e5cc7211.tar.gz
Fix resizing of minibuffer windows (Bug#11276).
* window.el (adjust-window-trailing-edge, enlarge-window) (shrink-window, window-resize): * mouse.el (mouse-drag-line): Fix resizing of minibuffer windows (Bug#11276).
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el34
1 files changed, 26 insertions, 8 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 28abec42680..9afc69d543d 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1486,8 +1486,10 @@ instead."
(cond
((eq window (frame-root-window frame))
(error "Cannot resize the root window of a frame"))
- ((window-minibuffer-p window)
- (window--resize-mini-window window delta))
+ ((window-minibuffer-p window)
+ (if horizontal
+ (error "Cannot resize minibuffer window horizontally")
+ (window--resize-mini-window window delta)))
((window--resizable-p window delta horizontal ignore)
(window--resize-reset frame horizontal)
(window--resize-this-window window delta horizontal ignore t)
@@ -2002,17 +2004,25 @@ right. If DELTA is less than zero, move the edge upwards or to
the left. If the edge can't be moved by DELTA lines or columns,
move it as far as possible in the desired direction."
(setq window (window-normalize-window window))
- (let ((frame (window-frame window))
- (right window)
- left this-delta min-delta max-delta)
+ (let* ((frame (window-frame window))
+ (minibuffer-window (minibuffer-window frame))
+ (right window)
+ left this-delta min-delta max-delta)
;; Find the edge we want to move.
(while (and (or (not (window-combined-p right horizontal))
(not (window-right right)))
(setq right (window-parent right))))
(cond
- ((and (not right) (not horizontal) (not resize-mini-windows)
- (eq (window-frame (minibuffer-window frame)) frame))
- (window--resize-mini-window (minibuffer-window frame) (- delta)))
+ ((and (not right) (not horizontal)
+ ;; Resize the minibuffer window if it's on the same frame as
+ ;; and immediately below WINDOW and it's either active or
+ ;; `resize-mini-windows' is nil.
+ (eq (window-frame minibuffer-window) frame)
+ (= (nth 1 (window-edges minibuffer-window))
+ (nth 3 (window-edges window)))
+ (or (not resize-mini-windows)
+ (eq minibuffer-window (active-minibuffer-window))))
+ (window--resize-mini-window minibuffer-window (- delta)))
((or (not (setq left right)) (not (setq right (window-right right))))
(if horizontal
(error "No window on the right of this one")
@@ -2113,6 +2123,10 @@ Return nil."
((zerop delta))
((window-size-fixed-p nil horizontal)
(error "Selected window has fixed size"))
+ ((window-minibuffer-p)
+ (if horizontal
+ (error "Cannot resize minibuffer window horizontally")
+ (window--resize-mini-window (selected-window) delta)))
((window--resizable-p nil delta horizontal)
(window-resize nil delta horizontal))
(t
@@ -2135,6 +2149,10 @@ Return nil."
((zerop delta))
((window-size-fixed-p nil horizontal)
(error "Selected window has fixed size"))
+ ((window-minibuffer-p)
+ (if horizontal
+ (error "Cannot resize minibuffer window horizontally")
+ (window--resize-mini-window (selected-window) (- delta))))
((window--resizable-p nil (- delta) horizontal)
(window-resize nil (- delta) horizontal))
(t