Fix bugs in window resizing code
* lisp/window.el (adjust-window-trailing-edge): Fix mismatched parenthesis. (shrink-window, enlarge-window): Fix bug#22723 where windows with preserved size would not get resized. Also now signal an error when the window cannot be shrunk or enlarged as requested.
This commit is contained in:
parent
289d5c6e97
commit
3722a694fa
1 changed files with 13 additions and 13 deletions
|
@ -3241,9 +3241,9 @@ move it as far as possible in the desired direction."
|
||||||
(setq ignore 'preserved)
|
(setq ignore 'preserved)
|
||||||
(setq right first-right)
|
(setq right first-right)
|
||||||
(while (and right
|
(while (and right
|
||||||
(or (window-size-fixed-p right horizontal 'preserved))
|
(or (window-size-fixed-p right horizontal 'preserved)
|
||||||
(<= (window-size right horizontal t)
|
(<= (window-size right horizontal t)
|
||||||
(window-min-size right horizontal 'preserved t)))
|
(window-min-size right horizontal 'preserved t))))
|
||||||
(setq right
|
(setq right
|
||||||
(or (window-right right)
|
(or (window-right right)
|
||||||
(progn
|
(progn
|
||||||
|
@ -3352,12 +3352,12 @@ negative, shrink selected window by -DELTA lines or columns."
|
||||||
(window--resize-mini-window minibuffer-window (- delta)))
|
(window--resize-mini-window minibuffer-window (- delta)))
|
||||||
((window--resizable-p nil delta horizontal)
|
((window--resizable-p nil delta horizontal)
|
||||||
(window-resize nil delta horizontal))
|
(window-resize nil delta horizontal))
|
||||||
|
((window--resizable-p nil delta horizontal 'preserved)
|
||||||
|
(window-resize nil delta horizontal 'preserved))
|
||||||
|
((eq this-command 'enlarge-window)
|
||||||
|
(user-error "Cannot enlarge selected window"))
|
||||||
(t
|
(t
|
||||||
(window-resize
|
(error "Cannot enlarge selected window")))))
|
||||||
nil (if (> delta 0)
|
|
||||||
(window-max-delta nil horizontal)
|
|
||||||
(- (window-min-delta nil horizontal)))
|
|
||||||
horizontal)))))
|
|
||||||
|
|
||||||
(defun shrink-window (delta &optional horizontal)
|
(defun shrink-window (delta &optional horizontal)
|
||||||
"Make the selected window DELTA lines smaller.
|
"Make the selected window DELTA lines smaller.
|
||||||
|
@ -3387,12 +3387,12 @@ Also see the `window-min-height' variable."
|
||||||
(window--resize-mini-window minibuffer-window delta))
|
(window--resize-mini-window minibuffer-window delta))
|
||||||
((window--resizable-p nil (- delta) horizontal)
|
((window--resizable-p nil (- delta) horizontal)
|
||||||
(window-resize nil (- delta) horizontal))
|
(window-resize nil (- delta) horizontal))
|
||||||
|
((window--resizable-p nil (- delta) horizontal 'preserved)
|
||||||
|
(window-resize nil (- delta) horizontal 'preserved))
|
||||||
|
((eq this-command 'shrink-window)
|
||||||
|
(user-error "Cannot shrink selected window"))
|
||||||
(t
|
(t
|
||||||
(window-resize
|
(error "Cannot shrink selected window")))))
|
||||||
nil (if (> delta 0)
|
|
||||||
(- (window-min-delta nil horizontal))
|
|
||||||
(window-max-delta nil horizontal))
|
|
||||||
horizontal)))))
|
|
||||||
|
|
||||||
(defun maximize-window (&optional window)
|
(defun maximize-window (&optional window)
|
||||||
"Maximize WINDOW.
|
"Maximize WINDOW.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue