[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107871: Improve fix for resizing
From: |
martin rudalics |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107871: Improve fix for resizing minibuffer windows. |
Date: |
Fri, 20 Apr 2012 11:59:10 +0200 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107871
committer: martin rudalics <address@hidden>
branch nick: emacs-24
timestamp: Fri 2012-04-20 11:59:10 +0200
message:
Improve fix for resizing minibuffer windows.
modified:
lisp/window.el
=== modified file 'lisp/window.el'
--- a/lisp/window.el 2012-04-20 08:49:24 +0000
+++ b/lisp/window.el 2012-04-20 09:59:10 +0000
@@ -1482,6 +1482,7 @@
instead."
(setq window (window-normalize-window window))
(let* ((frame (window-frame window))
+ (minibuffer-window (minibuffer-window frame))
sibling)
(cond
((eq window (frame-root-window frame))
@@ -1490,6 +1491,15 @@
(if horizontal
(error "Cannot resize minibuffer window horizontally")
(window--resize-mini-window window delta)))
+ ((and (not horizontal)
+ (window-full-height-p window)
+ (eq (window-frame minibuffer-window) frame)
+ (or (not resize-mini-windows)
+ (eq minibuffer-window (active-minibuffer-window))))
+ ;; If WINDOW is full height and either `resize-mini-windows' is
+ ;; nil or the minibuffer window is active, resize the minibuffer
+ ;; window.
+ (window--resize-mini-window minibuffer-window (- delta)))
((window--resizable-p window delta horizontal ignore)
(window--resize-reset frame horizontal)
(window--resize-this-window window delta horizontal ignore t)
@@ -2119,22 +2129,30 @@
negative, shrink selected window by -DELTA lines or columns.
Return nil."
(interactive "p")
- (cond
- ((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
- (window-resize
- nil (if (> delta 0)
- (window-max-delta nil horizontal)
- (- (window-min-delta nil horizontal)))
- horizontal))))
+ (let ((minibuffer-window (minibuffer-window)))
+ (cond
+ ((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)))
+ ((and (not horizontal)
+ (window-full-height-p)
+ (eq (window-frame minibuffer-window) (selected-frame))
+ (not resize-mini-windows))
+ ;; If the selected window is full height and `resize-mini-windows'
+ ;; is nil, resize the minibuffer window.
+ (window--resize-mini-window minibuffer-window (- delta)))
+ ((window--resizable-p nil delta horizontal)
+ (window-resize nil delta horizontal))
+ (t
+ (window-resize
+ nil (if (> delta 0)
+ (window-max-delta nil horizontal)
+ (- (window-min-delta nil horizontal)))
+ horizontal)))))
(defun shrink-window (delta &optional horizontal)
"Make the selected window DELTA lines smaller.
@@ -2145,22 +2163,30 @@
Also see the `window-min-height' variable.
Return nil."
(interactive "p")
- (cond
- ((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
- (window-resize
- nil (if (> delta 0)
- (- (window-min-delta nil horizontal))
- (window-max-delta nil horizontal))
- horizontal))))
+ (let ((minibuffer-window (minibuffer-window)))
+ (cond
+ ((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))))
+ ((and (not horizontal)
+ (window-full-height-p)
+ (eq (window-frame minibuffer-window) (selected-frame))
+ (not resize-mini-windows))
+ ;; If the selected window is full height and `resize-mini-windows'
+ ;; is nil, resize the minibuffer window.
+ (window--resize-mini-window minibuffer-window delta))
+ ((window--resizable-p nil (- delta) horizontal)
+ (window-resize nil (- delta) horizontal))
+ (t
+ (window-resize
+ nil (if (> delta 0)
+ (- (window-min-delta nil horizontal))
+ (window-max-delta nil horizontal))
+ horizontal)))))
(defun maximize-window (&optional window)
"Maximize WINDOW.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107871: Improve fix for resizing minibuffer windows.,
martin rudalics <=