aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog18
-rw-r--r--lisp/window.el104
-rw-r--r--src/ChangeLog7
-rw-r--r--src/window.c82
4 files changed, 118 insertions, 93 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b53365d7d35..8fe51fc341b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -9,6 +9,24 @@
9 window-next and window-prev are now called window-top-child, 9 window-next and window-prev are now called window-top-child,
10 window-left-child, window-next-sibling and window-prev-sibling 10 window-left-child, window-next-sibling and window-prev-sibling
11 respectively. 11 respectively.
12 (resize-window-reset): Rename to window-resize-reset.
13 (resize-window-reset-1): Rename to window-resize-reset-1.
14 (resize-window): Rename to window-resize.
15 (window-min-height, window-min-width)
16 (resize-mini-window, resize-this-window, resize-root-window)
17 (resize-root-window-vertically, adjust-window-trailing-edge)
18 (enlarge-window, shrink-window, maximize-window)
19 (minimize-window, delete-window, quit-restore-window)
20 (split-window, balance-windows, balance-windows-area-adjust)
21 (balance-windows-area, window-state-put-2)
22 (display-buffer-even-window-sizes, display-buffer-set-height)
23 (display-buffer-set-width, set-window-text-height)
24 (fit-window-to-buffer): Rename all "resize-window" prefixed
25 calls to use the "window-resize" prefix convention.
26 (display-buffer-alist): Fix symbol for label specifier.
27 (display-buffer-reuse-window): Set reuse-dedicated to cdr of
28 corresponding specifier.
29 Reported by Juanma Barranquero <lekktu@gmail.com>.
12 30
132011-06-27 Vincent Belaïche <vincentb1@users.sourceforge.net> 312011-06-27 Vincent Belaïche <vincentb1@users.sourceforge.net>
14 32
diff --git a/lisp/window.el b/lisp/window.el
index 3d65acd22a6..f693077f753 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -170,7 +170,7 @@ of this variable is honored when windows are resized or split.
170 170
171Applications should never rebind this variable. To resize a 171Applications should never rebind this variable. To resize a
172window to a height less than the one specified here, an 172window to a height less than the one specified here, an
173application should instead call `resize-window' with a non-nil 173application should instead call `window-resize' with a non-nil
174IGNORE argument. In order to have `split-window' make a window 174IGNORE argument. In order to have `split-window' make a window
175shorter, explictly specify the SIZE argument of that function." 175shorter, explictly specify the SIZE argument of that function."
176 :type 'integer 176 :type 'integer
@@ -190,7 +190,7 @@ split.
190 190
191Applications should never rebind this variable. To resize a 191Applications should never rebind this variable. To resize a
192window to a width less than the one specified here, an 192window to a width less than the one specified here, an
193application should instead call `resize-window' with a non-nil 193application should instead call `window-resize' with a non-nil
194IGNORE argument. In order to have `split-window' make a window 194IGNORE argument. In order to have `split-window' make a window
195narrower, explictly specify the SIZE argument of that function." 195narrower, explictly specify the SIZE argument of that function."
196 :type 'integer 196 :type 'integer
@@ -1353,7 +1353,7 @@ meaning of this argument."
1353 (length (window-list-1 nil minibuf))) 1353 (length (window-list-1 nil minibuf)))
1354 1354
1355;;; Resizing windows. 1355;;; Resizing windows.
1356(defun resize-window-reset (&optional frame horizontal) 1356(defun window-resize-reset (&optional frame horizontal)
1357 "Reset resize values for all windows on FRAME. 1357 "Reset resize values for all windows on FRAME.
1358FRAME defaults to the selected frame. 1358FRAME defaults to the selected frame.
1359 1359
@@ -1361,19 +1361,19 @@ This function stores the current value of `window-total-size' applied
1361with argument HORIZONTAL in the new total size of all windows on 1361with argument HORIZONTAL in the new total size of all windows on
1362FRAME. It also resets the new normal size of each of these 1362FRAME. It also resets the new normal size of each of these
1363windows." 1363windows."
1364 (resize-window-reset-1 1364 (window-resize-reset-1
1365 (frame-root-window (normalize-live-frame frame)) horizontal)) 1365 (frame-root-window (normalize-live-frame frame)) horizontal))
1366 1366
1367(defun resize-window-reset-1 (window horizontal) 1367(defun window-resize-reset-1 (window horizontal)
1368 "Internal function of `resize-window-reset'." 1368 "Internal function of `window-resize-reset'."
1369 ;; Register old size in the new total size. 1369 ;; Register old size in the new total size.
1370 (set-window-new-total window (window-total-size window horizontal)) 1370 (set-window-new-total window (window-total-size window horizontal))
1371 ;; Reset new normal size. 1371 ;; Reset new normal size.
1372 (set-window-new-normal window) 1372 (set-window-new-normal window)
1373 (when (window-child window) 1373 (when (window-child window)
1374 (resize-window-reset-1 (window-child window) horizontal)) 1374 (window-resize-reset-1 (window-child window) horizontal))
1375 (when (window-right window) 1375 (when (window-right window)
1376 (resize-window-reset-1 (window-right window) horizontal))) 1376 (window-resize-reset-1 (window-right window) horizontal)))
1377 1377
1378;; The following routine is used to manually resize the minibuffer 1378;; The following routine is used to manually resize the minibuffer
1379;; window and is currently used, for example, by ispell.el. 1379;; window and is currently used, for example, by ispell.el.
@@ -1396,7 +1396,7 @@ as small) as possible but don't signal an error."
1396 (setq delta min-delta))) 1396 (setq delta min-delta)))
1397 1397
1398 ;; Resize now. 1398 ;; Resize now.
1399 (resize-window-reset frame) 1399 (window-resize-reset frame)
1400 ;; Ideally we should be able to resize just the last subwindow of 1400 ;; Ideally we should be able to resize just the last subwindow of
1401 ;; root here. See the comment in `resize-root-window-vertically' 1401 ;; root here. See the comment in `resize-root-window-vertically'
1402 ;; for why we do not do that. 1402 ;; for why we do not do that.
@@ -1406,7 +1406,7 @@ as small) as possible but don't signal an error."
1406 ;; a minibuffer-only frame. 1406 ;; a minibuffer-only frame.
1407 (resize-mini-window-internal window)))) 1407 (resize-mini-window-internal window))))
1408 1408
1409(defun resize-window (window delta &optional horizontal ignore) 1409(defun window-resize (window delta &optional horizontal ignore)
1410 "Resize WINDOW vertically by DELTA lines. 1410 "Resize WINDOW vertically by DELTA lines.
1411WINDOW can be an arbitrary window and defaults to the selected 1411WINDOW can be an arbitrary window and defaults to the selected
1412one. An attempt to resize the root window of a frame will raise 1412one. An attempt to resize the root window of a frame will raise
@@ -1441,7 +1441,7 @@ instead."
1441 ((window-minibuffer-p window) 1441 ((window-minibuffer-p window)
1442 (resize-mini-window window delta)) 1442 (resize-mini-window window delta))
1443 ((window-resizable-p window delta horizontal ignore) 1443 ((window-resizable-p window delta horizontal ignore)
1444 (resize-window-reset frame horizontal) 1444 (window-resize-reset frame horizontal)
1445 (resize-this-window window delta horizontal ignore t) 1445 (resize-this-window window delta horizontal ignore t)
1446 (if (and (not (window-splits window)) 1446 (if (and (not (window-splits window))
1447 (window-iso-combined-p window horizontal) 1447 (window-iso-combined-p window horizontal)
@@ -1462,7 +1462,7 @@ instead."
1462 normal-delta))) 1462 normal-delta)))
1463 ;; Otherwise, resize all other windows in the same combination. 1463 ;; Otherwise, resize all other windows in the same combination.
1464 (resize-other-windows window delta horizontal ignore)) 1464 (resize-other-windows window delta horizontal ignore))
1465 (resize-window-apply frame horizontal)) 1465 (window-resize-apply frame horizontal))
1466 (t 1466 (t
1467 (error "Cannot resize window %s" window))))) 1467 (error "Cannot resize window %s" window)))))
1468 1468
@@ -1726,7 +1726,7 @@ already set by this routine."
1726 (while sub 1726 (while sub
1727 (when (or (consp (window-new-normal sub)) 1727 (when (or (consp (window-new-normal sub))
1728 (numberp (window-new-normal sub))) 1728 (numberp (window-new-normal sub)))
1729 ;; Reset new normal size fields so `resize-window-apply' 1729 ;; Reset new normal size fields so `window-resize-apply'
1730 ;; won't use them to apply new sizes. 1730 ;; won't use them to apply new sizes.
1731 (set-window-new-normal sub)) 1731 (set-window-new-normal sub))
1732 1732
@@ -1867,7 +1867,7 @@ This function recursively resizes WINDOW's subwindows to fit the
1867new size. Make sure that WINDOW is `window-resizable' before 1867new size. Make sure that WINDOW is `window-resizable' before
1868calling this function. Note that this function does not resize 1868calling this function. Note that this function does not resize
1869siblings of WINDOW or WINDOW's parent window. You have to 1869siblings of WINDOW or WINDOW's parent window. You have to
1870eventually call `resize-window-apply' in order to make resizing 1870eventually call `window-resize-apply' in order to make resizing
1871actually take effect." 1871actually take effect."
1872 (when add 1872 (when add
1873 ;; Add DELTA to the new total size of WINDOW. 1873 ;; Add DELTA to the new total size of WINDOW.
@@ -1898,7 +1898,7 @@ This function is only called by the frame resizing routines. It
1898resizes windows proportionally and never deletes any windows." 1898resizes windows proportionally and never deletes any windows."
1899 (when (and (windowp window) (numberp delta) 1899 (when (and (windowp window) (numberp delta)
1900 (window-sizable-p window delta horizontal ignore)) 1900 (window-sizable-p window delta horizontal ignore))
1901 (resize-window-reset (window-frame window) horizontal) 1901 (window-resize-reset (window-frame window) horizontal)
1902 (resize-this-window window delta horizontal ignore t))) 1902 (resize-this-window window delta horizontal ignore t)))
1903 1903
1904(defun resize-root-window-vertically (window delta) 1904(defun resize-root-window-vertically (window delta)
@@ -1922,7 +1922,7 @@ any windows."
1922 (unless (window-sizable window delta) 1922 (unless (window-sizable window delta)
1923 (setq ignore t)))) 1923 (setq ignore t))))
1924 1924
1925 (resize-window-reset (window-frame window)) 1925 (window-resize-reset (window-frame window))
1926 ;; Ideally, we would resize just the last window in a combination 1926 ;; Ideally, we would resize just the last window in a combination
1927 ;; but that's not feasible for the following reason: If we grow 1927 ;; but that's not feasible for the following reason: If we grow
1928 ;; the minibuffer window and the last window cannot be shrunk any 1928 ;; the minibuffer window and the last window cannot be shrunk any
@@ -2000,7 +2000,7 @@ move it as far as possible in the desired direction."
2000 (setq delta (min max-delta (- min-delta)))) 2000 (setq delta (min max-delta (- min-delta))))
2001 (unless (zerop delta) 2001 (unless (zerop delta)
2002 ;; Start resizing. 2002 ;; Start resizing.
2003 (resize-window-reset frame horizontal) 2003 (window-resize-reset frame horizontal)
2004 ;; Try to enlarge LEFT first. 2004 ;; Try to enlarge LEFT first.
2005 (setq this-delta (window-resizable left delta horizontal)) 2005 (setq this-delta (window-resizable left delta horizontal))
2006 (unless (zerop this-delta) 2006 (unless (zerop this-delta)
@@ -2023,7 +2023,7 @@ move it as far as possible in the desired direction."
2023 (setq delta (max (- max-delta) min-delta))) 2023 (setq delta (max (- max-delta) min-delta)))
2024 (unless (zerop delta) 2024 (unless (zerop delta)
2025 ;; Start resizing. 2025 ;; Start resizing.
2026 (resize-window-reset frame horizontal) 2026 (window-resize-reset frame horizontal)
2027 ;; Try to enlarge RIGHT. 2027 ;; Try to enlarge RIGHT.
2028 (setq this-delta (window-resizable right (- delta) horizontal)) 2028 (setq this-delta (window-resizable right (- delta) horizontal))
2029 (unless (zerop this-delta) 2029 (unless (zerop this-delta)
@@ -2040,7 +2040,7 @@ move it as far as possible in the desired direction."
2040 (+ (window-top-line left) (window-total-size left))))))) 2040 (+ (window-top-line left) (window-total-size left)))))))
2041 (unless (zerop delta) 2041 (unless (zerop delta)
2042 ;; Don't report an error in the standard case. 2042 ;; Don't report an error in the standard case.
2043 (unless (resize-window-apply frame horizontal) 2043 (unless (window-resize-apply frame horizontal)
2044 ;; But do report an error if applying the changes fails. 2044 ;; But do report an error if applying the changes fails.
2045 (error "Failed adjusting window %s" window))))))) 2045 (error "Failed adjusting window %s" window)))))))
2046 2046
@@ -2057,9 +2057,9 @@ Return nil."
2057 ((window-size-fixed-p nil horizontal) 2057 ((window-size-fixed-p nil horizontal)
2058 (error "Selected window has fixed size")) 2058 (error "Selected window has fixed size"))
2059 ((window-resizable-p nil delta horizontal) 2059 ((window-resizable-p nil delta horizontal)
2060 (resize-window nil delta horizontal)) 2060 (window-resize nil delta horizontal))
2061 (t 2061 (t
2062 (resize-window 2062 (window-resize
2063 nil (if (> delta 0) 2063 nil (if (> delta 0)
2064 (window-max-delta nil horizontal) 2064 (window-max-delta nil horizontal)
2065 (- (window-min-delta nil horizontal))) 2065 (- (window-min-delta nil horizontal)))
@@ -2078,9 +2078,9 @@ Return nil."
2078 ((window-size-fixed-p nil horizontal) 2078 ((window-size-fixed-p nil horizontal)
2079 (error "Selected window has fixed size")) 2079 (error "Selected window has fixed size"))
2080 ((window-resizable-p nil (- delta) horizontal) 2080 ((window-resizable-p nil (- delta) horizontal)
2081 (resize-window nil (- delta) horizontal)) 2081 (window-resize nil (- delta) horizontal))
2082 (t 2082 (t
2083 (resize-window 2083 (window-resize
2084 nil (if (> delta 0) 2084 nil (if (> delta 0)
2085 (- (window-min-delta nil horizontal)) 2085 (- (window-min-delta nil horizontal))
2086 (window-max-delta nil horizontal)) 2086 (window-max-delta nil horizontal))
@@ -2092,8 +2092,8 @@ Make WINDOW as large as possible without deleting any windows.
2092WINDOW can be any window and defaults to the selected window." 2092WINDOW can be any window and defaults to the selected window."
2093 (interactive) 2093 (interactive)
2094 (setq window (normalize-any-window window)) 2094 (setq window (normalize-any-window window))
2095 (resize-window window (window-max-delta window)) 2095 (window-resize window (window-max-delta window))
2096 (resize-window window (window-max-delta window t) t)) 2096 (window-resize window (window-max-delta window t) t))
2097 2097
2098(defun minimize-window (&optional window) 2098(defun minimize-window (&optional window)
2099 "Minimize WINDOW. 2099 "Minimize WINDOW.
@@ -2101,8 +2101,8 @@ Make WINDOW as small as possible without deleting any windows.
2101WINDOW can be any window and defaults to the selected window." 2101WINDOW can be any window and defaults to the selected window."
2102 (interactive) 2102 (interactive)
2103 (setq window (normalize-any-window window)) 2103 (setq window (normalize-any-window window))
2104 (resize-window window (- (window-min-delta window))) 2104 (window-resize window (- (window-min-delta window)))
2105 (resize-window window (- (window-min-delta window t)) t)) 2105 (window-resize window (- (window-min-delta window t)) t))
2106 2106
2107(defsubst frame-root-window-p (window) 2107(defsubst frame-root-window-p (window)
2108 "Return non-nil if WINDOW is the root window of its frame." 2108 "Return non-nil if WINDOW is the root window of its frame."
@@ -2371,7 +2371,7 @@ non-side window, signal an error."
2371 ;; Emacs 23 preferably gives WINDOW's space to its left 2371 ;; Emacs 23 preferably gives WINDOW's space to its left
2372 ;; sibling. 2372 ;; sibling.
2373 (sibling (or (window-left window) (window-right window)))) 2373 (sibling (or (window-left window) (window-right window))))
2374 (resize-window-reset frame horizontal) 2374 (window-resize-reset frame horizontal)
2375 (cond 2375 (cond
2376 ((and (not (window-splits window)) 2376 ((and (not (window-splits window))
2377 sibling (window-sizable-p sibling size)) 2377 sibling (window-sizable-p sibling size))
@@ -2945,7 +2945,7 @@ buffer list. Interactively, KILL is the prefix argument."
2945 (set-window-start window (nth 1 quit-restore)) 2945 (set-window-start window (nth 1 quit-restore))
2946 (set-window-point window (nth 2 quit-restore)) 2946 (set-window-point window (nth 2 quit-restore))
2947 (when (and resize (/= (nth 4 quit-restore) (window-total-size window))) 2947 (when (and resize (/= (nth 4 quit-restore) (window-total-size window)))
2948 (resize-window 2948 (window-resize
2949 window (- (nth 4 quit-restore) (window-total-size window)))) 2949 window (- (nth 4 quit-restore) (window-total-size window))))
2950 ;; Reset the quit-restore parameter. 2950 ;; Reset the quit-restore parameter.
2951 (set-window-parameter window 'quit-restore nil) 2951 (set-window-parameter window 'quit-restore nil)
@@ -3141,7 +3141,7 @@ frame. The selected window is not changed by this function."
3141 ;; SIZE specification violates minimum size restrictions. 3141 ;; SIZE specification violates minimum size restrictions.
3142 (error "Window %s too small for splitting" window))) 3142 (error "Window %s too small for splitting" window)))
3143 3143
3144 (resize-window-reset frame horizontal) 3144 (window-resize-reset frame horizontal)
3145 3145
3146 (setq new-parent 3146 (setq new-parent
3147 ;; Make new-parent non-nil if we need a new parent window; 3147 ;; Make new-parent non-nil if we need a new parent window;
@@ -3396,13 +3396,13 @@ window."
3396 (error "Not a window or frame %s" window-or-frame)))) 3396 (error "Not a window or frame %s" window-or-frame))))
3397 (frame (window-frame window))) 3397 (frame (window-frame window)))
3398 ;; Balance vertically. 3398 ;; Balance vertically.
3399 (resize-window-reset (window-frame window)) 3399 (window-resize-reset (window-frame window))
3400 (balance-windows-1 window) 3400 (balance-windows-1 window)
3401 (resize-window-apply frame) 3401 (window-resize-apply frame)
3402 ;; Balance horizontally. 3402 ;; Balance horizontally.
3403 (resize-window-reset (window-frame window) t) 3403 (window-resize-reset (window-frame window) t)
3404 (balance-windows-1 window t) 3404 (balance-windows-1 window t)
3405 (resize-window-apply frame t))) 3405 (window-resize-apply frame t)))
3406 3406
3407(defun window-fixed-size-p (&optional window direction) 3407(defun window-fixed-size-p (&optional window direction)
3408 "Return t if WINDOW cannot be resized in DIRECTION. 3408 "Return t if WINDOW cannot be resized in DIRECTION.
@@ -3422,13 +3422,13 @@ Changing this globally has no effect.")
3422(make-variable-buffer-local 'window-area-factor) 3422(make-variable-buffer-local 'window-area-factor)
3423 3423
3424(defun balance-windows-area-adjust (window delta horizontal) 3424(defun balance-windows-area-adjust (window delta horizontal)
3425 "Wrapper around `resize-window' with error checking. 3425 "Wrapper around `window-resize' with error checking.
3426Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function." 3426Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function."
3427 ;; `resize-window' may fail if delta is too large. 3427 ;; `window-resize' may fail if delta is too large.
3428 (while (>= (abs delta) 1) 3428 (while (>= (abs delta) 1)
3429 (condition-case nil 3429 (condition-case nil
3430 (progn 3430 (progn
3431 (resize-window window delta horizontal) 3431 (window-resize window delta horizontal)
3432 (setq delta 0)) 3432 (setq delta 0))
3433 (error 3433 (error
3434 ;;(message "adjust: %s" (error-message-string err)) 3434 ;;(message "adjust: %s" (error-message-string err))
@@ -3496,7 +3496,7 @@ specific buffers."
3496 ;; become significant. 3496 ;; become significant.
3497 (setq carry (+ carry areadiff)) 3497 (setq carry (+ carry areadiff))
3498 ;; This used `adjust-window-trailing-edge' before and uses 3498 ;; This used `adjust-window-trailing-edge' before and uses
3499 ;; `resize-window' now. Error wrapping is still needed. 3499 ;; `window-resize' now. Error wrapping is still needed.
3500 (balance-windows-area-adjust win diff horiz) 3500 (balance-windows-area-adjust win diff horiz)
3501 ;; (sit-for 0.5) 3501 ;; (sit-for 0.5)
3502 (let ((change (cons win (window-edges win)))) 3502 (let ((change (cons win (window-edges win))))
@@ -3721,13 +3721,13 @@ value can be also stored on disk and read back in a new session."
3721 (window-total-height window))) 3721 (window-total-height window)))
3722 window-size-fixed) 3722 window-size-fixed)
3723 (when (window-resizable-p window delta) 3723 (when (window-resizable-p window delta)
3724 (resize-window window delta))) 3724 (window-resize window delta)))
3725 ;; Else check whether the window is not high enough. 3725 ;; Else check whether the window is not high enough.
3726 (let* ((min-size (window-min-size window nil ignore)) 3726 (let* ((min-size (window-min-size window nil ignore))
3727 (delta (- min-size (window-total-size window)))) 3727 (delta (- min-size (window-total-size window))))
3728 (when (and (> delta 0) 3728 (when (and (> delta 0)
3729 (window-resizable-p window delta nil ignore)) 3729 (window-resizable-p window delta nil ignore))
3730 (resize-window window delta nil ignore)))) 3730 (window-resize window delta nil ignore))))
3731 ;; Adjust horizontally. 3731 ;; Adjust horizontally.
3732 (if (memq window-size-fixed '(t width)) 3732 (if (memq window-size-fixed '(t width))
3733 ;; A fixed width window, try to restore the original size. 3733 ;; A fixed width window, try to restore the original size.
@@ -3735,13 +3735,13 @@ value can be also stored on disk and read back in a new session."
3735 (window-total-width window))) 3735 (window-total-width window)))
3736 window-size-fixed) 3736 window-size-fixed)
3737 (when (window-resizable-p window delta) 3737 (when (window-resizable-p window delta)
3738 (resize-window window delta))) 3738 (window-resize window delta)))
3739 ;; Else check whether the window is not wide enough. 3739 ;; Else check whether the window is not wide enough.
3740 (let* ((min-size (window-min-size window t ignore)) 3740 (let* ((min-size (window-min-size window t ignore))
3741 (delta (- min-size (window-total-size window t)))) 3741 (delta (- min-size (window-total-size window t))))
3742 (when (and (> delta 0) 3742 (when (and (> delta 0)
3743 (window-resizable-p window delta t ignore)) 3743 (window-resizable-p window delta t ignore))
3744 (resize-window window delta t ignore)))) 3744 (window-resize window delta t ignore))))
3745 ;; Set dedicated status. 3745 ;; Set dedicated status.
3746 (set-window-dedicated-p window (cdr (assq 'dedicated state))) 3746 (set-window-dedicated-p window (cdr (assq 'dedicated state)))
3747 ;; Install positions (maybe we should do this after all windows 3747 ;; Install positions (maybe we should do this after all windows
@@ -4183,7 +4183,7 @@ using the location specifiers `same-window' or `other-frame'."
4183 :tag "Label" 4183 :tag "Label"
4184 :format "%v" 4184 :format "%v"
4185 :help-echo "A symbol equalling the buffer display label." 4185 :help-echo "A symbol equalling the buffer display label."
4186 (const :format "" symbol) 4186 (const :format "" label)
4187 (symbol :format "Label: %v\n" :size 32)))) 4187 (symbol :format "Label: %v\n" :size 32))))
4188 4188
4189 ;; Display specifiers. 4189 ;; Display specifiers.
@@ -4678,7 +4678,7 @@ larger than WINDOW."
4678 ;; WINDOW and the selected one. But for a simple two windows 4678 ;; WINDOW and the selected one. But for a simple two windows
4679 ;; configuration the present behavior is good enough so why care? 4679 ;; configuration the present behavior is good enough so why care?
4680 (ignore-errors 4680 (ignore-errors
4681 (resize-window 4681 (window-resize
4682 window (/ (- (window-total-height) (window-total-height window)) 4682 window (/ (- (window-total-height) (window-total-height window))
4683 2)))) 4683 2))))
4684 ((and (window-iso-combined-p window t) 4684 ((and (window-iso-combined-p window t)
@@ -4687,7 +4687,7 @@ larger than WINDOW."
4687 ;; Don't throw an error if we can't even window widths, see 4687 ;; Don't throw an error if we can't even window widths, see
4688 ;; comment above. 4688 ;; comment above.
4689 (ignore-errors 4689 (ignore-errors
4690 (resize-window 4690 (window-resize
4691 window (/ (- (window-total-width) (window-total-width window)) 4691 window (/ (- (window-total-width) (window-total-width window))
4692 2) t))))) 4692 2) t)))))
4693 4693
@@ -4706,7 +4706,7 @@ documentation of `display-buffer-alist' for a description."
4706 (delta (- height (window-total-size window)))) 4706 (delta (- height (window-total-size window))))
4707 (when (and (window-resizable-p window delta nil 'safe) 4707 (when (and (window-resizable-p window delta nil 'safe)
4708 (window-iso-combined-p window)) 4708 (window-iso-combined-p window))
4709 (resize-window window delta nil 'safe)))) 4709 (window-resize window delta nil 'safe))))
4710 ((functionp set-height) 4710 ((functionp set-height)
4711 (ignore-errors (funcall set-height window)))))) 4711 (ignore-errors (funcall set-height window))))))
4712 4712
@@ -4725,7 +4725,7 @@ documentation of `display-buffer-alist' for a description."
4725 (delta (- width (window-total-size window t)))) 4725 (delta (- width (window-total-size window t))))
4726 (when (and (window-resizable-p window delta t 'safe) 4726 (when (and (window-resizable-p window delta t 'safe)
4727 (window-iso-combined-p window t)) 4727 (window-iso-combined-p window t))
4728 (resize-window window delta t 'safe)))) 4728 (window-resize window delta t 'safe))))
4729 ((functionp set-width) 4729 ((functionp set-width)
4730 (ignore-errors (funcall set-width window)))))) 4730 (ignore-errors (funcall set-width window))))))
4731 4731
@@ -4781,7 +4781,7 @@ none was found."
4781 (let* ((method-window (nth 0 method)) 4781 (let* ((method-window (nth 0 method))
4782 (method-buffer (nth 1 method)) 4782 (method-buffer (nth 1 method))
4783 (method-frame (nth 2 method)) 4783 (method-frame (nth 2 method))
4784 (reuse-dedicated (assq 'reuse-window-dedicated specifiers)) 4784 (reuse-dedicated (cdr (assq 'reuse-window-dedicated specifiers)))
4785 windows other-frame dedicated time best-window best-time) 4785 windows other-frame dedicated time best-window best-time)
4786 (when (eq method-frame 'other) 4786 (when (eq method-frame 'other)
4787 ;; `other' is not handled by `window-list-1'. 4787 ;; `other' is not handled by `window-list-1'.
@@ -6807,7 +6807,7 @@ where some error may be present."
6807 ;; windows 1-line tall, which means that there's no more space for 6807 ;; windows 1-line tall, which means that there's no more space for
6808 ;; the modeline. 6808 ;; the modeline.
6809 (let ((window-min-height (min 2 height))) ; One text line plus a modeline. 6809 (let ((window-min-height (min 2 height))) ; One text line plus a modeline.
6810 (resize-window window delta))))) 6810 (window-resize window delta)))))
6811 6811
6812(defun enlarge-window-horizontally (delta) 6812(defun enlarge-window-horizontally (delta)
6813 "Make selected window DELTA columns wider. 6813 "Make selected window DELTA columns wider.
@@ -6950,8 +6950,8 @@ WINDOW was scrolled."
6950 ;; It's silly to put `point' at the end of the previous 6950 ;; It's silly to put `point' at the end of the previous
6951 ;; line and so maybe force horizontal scrolling. 6951 ;; line and so maybe force horizontal scrolling.
6952 (set-window-point window (line-beginning-position 0))) 6952 (set-window-point window (line-beginning-position 0)))
6953 ;; Call `resize-window' with OVERRIDE argument equal WINDOW. 6953 ;; Call `window-resize' with OVERRIDE argument equal WINDOW.
6954 (resize-window window delta nil window) 6954 (window-resize window delta nil window)
6955 ;; Check if the last line is surely fully visible. If 6955 ;; Check if the last line is surely fully visible. If
6956 ;; not, enlarge the window. 6956 ;; not, enlarge the window.
6957 (let ((end (save-excursion 6957 (let ((end (save-excursion
@@ -6974,7 +6974,7 @@ WINDOW was scrolled."
6974 (while (and (< desired-height max-height) 6974 (while (and (< desired-height max-height)
6975 (= desired-height (window-total-size)) 6975 (= desired-height (window-total-size))
6976 (not (pos-visible-in-window-p end))) 6976 (not (pos-visible-in-window-p end)))
6977 (resize-window window 1 nil window) 6977 (window-resize window 1 nil window)
6978 (setq desired-height (1+ desired-height))))) 6978 (setq desired-height (1+ desired-height)))))
6979 (error (setq delta nil))) 6979 (error (setq delta nil)))
6980 delta)))) 6980 delta))))
diff --git a/src/ChangeLog b/src/ChangeLog
index c6621cec567..149448fc9de 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -15,6 +15,13 @@
15 (Fwindow_hchild): Rename to Fwindow_left_child. 15 (Fwindow_hchild): Rename to Fwindow_left_child.
16 (Fwindow_next): Rename to Fwindow_next_sibling. 16 (Fwindow_next): Rename to Fwindow_next_sibling.
17 (Fwindow_prev): Rename to Fwindow_prev_sibling. 17 (Fwindow_prev): Rename to Fwindow_prev_sibling.
18 (resize_window_check): Rename to window_resize_check.
19 (resize_window_apply): Rename to window_resize_apply.
20 (Fresize_window_apply): Rename to Fwindow_resize_apply.
21 (Fdelete_other_windows_internal, resize_frame_windows)
22 (Fsplit_window_internal, Fdelete_window_internal)
23 (grow_mini_window, shrink_mini_window)
24 (Fresize_mini_window_internal): Fix callers accordingly.
18 25
192011-06-26 Jan Djärv <jan.h.d@swipnet.se> 262011-06-26 Jan Djärv <jan.h.d@swipnet.se>
20 27
diff --git a/src/window.c b/src/window.c
index 19b3edf4c77..6656796b350 100644
--- a/src/window.c
+++ b/src/window.c
@@ -82,8 +82,8 @@ static int foreach_window_1 (struct window *,
82 int (* fn) (struct window *, void *), 82 int (* fn) (struct window *, void *),
83 void *); 83 void *);
84static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); 84static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object);
85static int resize_window_check (struct window *, int); 85static int window_resize_check (struct window *, int);
86static void resize_window_apply (struct window *, int); 86static void window_resize_apply (struct window *, int);
87static Lisp_Object select_window (Lisp_Object, Lisp_Object, int); 87static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
88 88
89/* This is the window in which the terminal's cursor should 89/* This is the window in which the terminal's cursor should
@@ -2695,13 +2695,13 @@ window-start value is reasonable when this function is called. */)
2695 XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); 2695 XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines));
2696 w->top_line = r->top_line; 2696 w->top_line = r->top_line;
2697 resize_root_window (window, delta, Qnil, Qnil); 2697 resize_root_window (window, delta, Qnil, Qnil);
2698 if (resize_window_check (w, 0)) 2698 if (window_resize_check (w, 0))
2699 resize_window_apply (w, 0); 2699 window_resize_apply (w, 0);
2700 else 2700 else
2701 { 2701 {
2702 resize_root_window (window, delta, Qnil, Qt); 2702 resize_root_window (window, delta, Qnil, Qt);
2703 if (resize_window_check (w, 0)) 2703 if (window_resize_check (w, 0))
2704 resize_window_apply (w, 0); 2704 window_resize_apply (w, 0);
2705 else 2705 else
2706 resize_failed = 1; 2706 resize_failed = 1;
2707 } 2707 }
@@ -2713,13 +2713,13 @@ window-start value is reasonable when this function is called. */)
2713 XSETINT (delta, XINT (r->total_cols) - XINT (w->total_cols)); 2713 XSETINT (delta, XINT (r->total_cols) - XINT (w->total_cols));
2714 w->left_col = r->left_col; 2714 w->left_col = r->left_col;
2715 resize_root_window (window, delta, Qt, Qnil); 2715 resize_root_window (window, delta, Qt, Qnil);
2716 if (resize_window_check (w, 1)) 2716 if (window_resize_check (w, 1))
2717 resize_window_apply (w, 1); 2717 window_resize_apply (w, 1);
2718 else 2718 else
2719 { 2719 {
2720 resize_root_window (window, delta, Qt, Qt); 2720 resize_root_window (window, delta, Qt, Qt);
2721 if (resize_window_check (w, 1)) 2721 if (window_resize_check (w, 1))
2722 resize_window_apply (w, 1); 2722 window_resize_apply (w, 1);
2723 else 2723 else
2724 resize_failed = 1; 2724 resize_failed = 1;
2725 } 2725 }
@@ -3415,7 +3415,7 @@ Note: This function does not operate on any subwindows of WINDOW. */)
3415 `window-min-height' or `window-min-width'. It does check that window 3415 `window-min-height' or `window-min-width'. It does check that window
3416 sizes do not drop below one line (two columns). */ 3416 sizes do not drop below one line (two columns). */
3417static int 3417static int
3418resize_window_check (struct window *w, int horflag) 3418window_resize_check (struct window *w, int horflag)
3419{ 3419{
3420 struct window *c; 3420 struct window *c;
3421 3421
@@ -3429,7 +3429,7 @@ resize_window_check (struct window *w, int horflag)
3429 while (c) 3429 while (c)
3430 { 3430 {
3431 if ((XINT (c->new_total) != XINT (w->new_total)) 3431 if ((XINT (c->new_total) != XINT (w->new_total))
3432 || !resize_window_check (c, horflag)) 3432 || !window_resize_check (c, horflag))
3433 return 0; 3433 return 0;
3434 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3434 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3435 } 3435 }
@@ -3442,7 +3442,7 @@ resize_window_check (struct window *w, int horflag)
3442 int sum_of_sizes = 0; 3442 int sum_of_sizes = 0;
3443 while (c) 3443 while (c)
3444 { 3444 {
3445 if (!resize_window_check (c, horflag)) 3445 if (!window_resize_check (c, horflag))
3446 return 0; 3446 return 0;
3447 sum_of_sizes = sum_of_sizes + XINT (c->new_total); 3447 sum_of_sizes = sum_of_sizes + XINT (c->new_total);
3448 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3448 c = NILP (c->next) ? 0 : XWINDOW (c->next);
@@ -3461,7 +3461,7 @@ resize_window_check (struct window *w, int horflag)
3461 int sum_of_sizes = 0; 3461 int sum_of_sizes = 0;
3462 while (c) 3462 while (c)
3463 { 3463 {
3464 if (!resize_window_check (c, horflag)) 3464 if (!window_resize_check (c, horflag))
3465 return 0; 3465 return 0;
3466 sum_of_sizes = sum_of_sizes + XINT (c->new_total); 3466 sum_of_sizes = sum_of_sizes + XINT (c->new_total);
3467 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3467 c = NILP (c->next) ? 0 : XWINDOW (c->next);
@@ -3474,7 +3474,7 @@ resize_window_check (struct window *w, int horflag)
3474 while (c) 3474 while (c)
3475 { 3475 {
3476 if ((XINT (c->new_total) != XINT (w->new_total)) 3476 if ((XINT (c->new_total) != XINT (w->new_total))
3477 || !resize_window_check (c, horflag)) 3477 || !window_resize_check (c, horflag))
3478 return 0; 3478 return 0;
3479 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3479 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3480 } 3480 }
@@ -3494,9 +3494,9 @@ resize_window_check (struct window *w, int horflag)
3494 each of these windows. 3494 each of these windows.
3495 3495
3496 This function does not perform any error checks. Make sure you have 3496 This function does not perform any error checks. Make sure you have
3497 run resize_window_check on W before applying this function. */ 3497 run window_resize_check on W before applying this function. */
3498static void 3498static void
3499resize_window_apply (struct window *w, int horflag) 3499window_resize_apply (struct window *w, int horflag)
3500{ 3500{
3501 struct window *c; 3501 struct window *c;
3502 int pos; 3502 int pos;
@@ -3530,7 +3530,7 @@ resize_window_apply (struct window *w, int horflag)
3530 XSETFASTINT (c->left_col, pos); 3530 XSETFASTINT (c->left_col, pos);
3531 else 3531 else
3532 XSETFASTINT (c->top_line, pos); 3532 XSETFASTINT (c->top_line, pos);
3533 resize_window_apply (c, horflag); 3533 window_resize_apply (c, horflag);
3534 if (!horflag) 3534 if (!horflag)
3535 pos = pos + XINT (c->total_lines); 3535 pos = pos + XINT (c->total_lines);
3536 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3536 c = NILP (c->next) ? 0 : XWINDOW (c->next);
@@ -3546,7 +3546,7 @@ resize_window_apply (struct window *w, int horflag)
3546 XSETFASTINT (c->left_col, pos); 3546 XSETFASTINT (c->left_col, pos);
3547 else 3547 else
3548 XSETFASTINT (c->top_line, pos); 3548 XSETFASTINT (c->top_line, pos);
3549 resize_window_apply (c, horflag); 3549 window_resize_apply (c, horflag);
3550 if (horflag) 3550 if (horflag)
3551 pos = pos + XINT (c->total_cols); 3551 pos = pos + XINT (c->total_cols);
3552 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3552 c = NILP (c->next) ? 0 : XWINDOW (c->next);
@@ -3559,7 +3559,7 @@ resize_window_apply (struct window *w, int horflag)
3559} 3559}
3560 3560
3561 3561
3562DEFUN ("resize-window-apply", Fresize_window_apply, Sresize_window_apply, 1, 2, 0, 3562DEFUN ("window-resize-apply", Fwindow_resize_apply, Swindow_resize_apply, 1, 2, 0,
3563 doc: /* Apply requested size values for window-tree of FRAME. 3563 doc: /* Apply requested size values for window-tree of FRAME.
3564Optional argument HORIZONTAL omitted or nil means apply requested height 3564Optional argument HORIZONTAL omitted or nil means apply requested height
3565values. HORIZONTAL non-nil means apply requested width values. 3565values. HORIZONTAL non-nil means apply requested width values.
@@ -3584,12 +3584,12 @@ be applied on the Elisp level. */)
3584 f = XFRAME (frame); 3584 f = XFRAME (frame);
3585 r = XWINDOW (FRAME_ROOT_WINDOW (f)); 3585 r = XWINDOW (FRAME_ROOT_WINDOW (f));
3586 3586
3587 if (!resize_window_check (r, horflag) 3587 if (!window_resize_check (r, horflag)
3588 || ! EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) 3588 || ! EQ (r->new_total, (horflag ? r->total_cols : r->total_lines)))
3589 return Qnil; 3589 return Qnil;
3590 3590
3591 BLOCK_INPUT; 3591 BLOCK_INPUT;
3592 resize_window_apply (r, horflag); 3592 window_resize_apply (r, horflag);
3593 3593
3594 windows_or_buffers_changed++; 3594 windows_or_buffers_changed++;
3595 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3595 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
@@ -3641,22 +3641,22 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3641 XSETINT (delta, new_size - old_size); 3641 XSETINT (delta, new_size - old_size);
3642 /* Try a "normal" resize first. */ 3642 /* Try a "normal" resize first. */
3643 resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil); 3643 resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil);
3644 if (resize_window_check (r, horflag) && new_size == XINT (r->new_total)) 3644 if (window_resize_check (r, horflag) && new_size == XINT (r->new_total))
3645 resize_window_apply (r, horflag); 3645 window_resize_apply (r, horflag);
3646 else 3646 else
3647 { 3647 {
3648 /* Try with "reasonable" minimum sizes next. */ 3648 /* Try with "reasonable" minimum sizes next. */
3649 resize_root_window (root, delta, horflag ? Qt : Qnil, Qt); 3649 resize_root_window (root, delta, horflag ? Qt : Qnil, Qt);
3650 if (resize_window_check (r, horflag) 3650 if (window_resize_check (r, horflag)
3651 && new_size == XINT (r->new_total)) 3651 && new_size == XINT (r->new_total))
3652 resize_window_apply (r, horflag); 3652 window_resize_apply (r, horflag);
3653 else 3653 else
3654 { 3654 {
3655 /* Finally, try with "safe" minimum sizes. */ 3655 /* Finally, try with "safe" minimum sizes. */
3656 resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe); 3656 resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe);
3657 if (resize_window_check (r, horflag) 3657 if (window_resize_check (r, horflag)
3658 && new_size == XINT (r->new_total)) 3658 && new_size == XINT (r->new_total))
3659 resize_window_apply (r, horflag); 3659 window_resize_apply (r, horflag);
3660 else 3660 else
3661 { 3661 {
3662 /* We lost. Delete all windows but the frame's 3662 /* We lost. Delete all windows but the frame's
@@ -3765,7 +3765,7 @@ set correctly. See the code of `split-window' for how this is done. */)
3765 XSETINT (p->new_total, 3765 XSETINT (p->new_total,
3766 XINT (horflag ? p->total_cols : p->total_lines) 3766 XINT (horflag ? p->total_cols : p->total_lines)
3767 - XINT (total_size)); 3767 - XINT (total_size));
3768 if (!resize_window_check (p, horflag)) 3768 if (!window_resize_check (p, horflag))
3769 error ("Window sizes don't fit"); 3769 error ("Window sizes don't fit");
3770 else 3770 else
3771 /* Undo the temporary pretension. */ 3771 /* Undo the temporary pretension. */
@@ -3773,7 +3773,7 @@ set correctly. See the code of `split-window' for how this is done. */)
3773 } 3773 }
3774 else 3774 else
3775 { 3775 {
3776 if (!resize_window_check (o, horflag)) 3776 if (!window_resize_check (o, horflag))
3777 error ("Resizing old window failed"); 3777 error ("Resizing old window failed");
3778 else if (XINT (total_size) + XINT (o->new_total) 3778 else if (XINT (total_size) + XINT (o->new_total)
3779 != XINT (horflag ? o->total_cols : o->total_lines)) 3779 != XINT (horflag ? o->total_cols : o->total_lines))
@@ -3861,13 +3861,13 @@ set correctly. See the code of `split-window' for how this is done. */)
3861 n->total_cols = o->total_cols; 3861 n->total_cols = o->total_cols;
3862 } 3862 }
3863 3863
3864 /* Iso-coordinates and sizes are assigned by resize_window_apply, 3864 /* Iso-coordinates and sizes are assigned by window_resize_apply,
3865 get them ready here. */ 3865 get them ready here. */
3866 n->new_total = total_size; 3866 n->new_total = total_size;
3867 n->new_normal = normal_size; 3867 n->new_normal = normal_size;
3868 3868
3869 BLOCK_INPUT; 3869 BLOCK_INPUT;
3870 resize_window_apply (p, horflag); 3870 window_resize_apply (p, horflag);
3871 adjust_glyphs (f); 3871 adjust_glyphs (f);
3872 /* Set buffer of NEW to buffer of reference window. Don't run 3872 /* Set buffer of NEW to buffer of reference window. Don't run
3873 any hooks. */ 3873 any hooks. */
@@ -3945,13 +3945,13 @@ when WINDOW is the only window on its frame. */)
3945 XWINDOW (s->next)->prev = sibling; 3945 XWINDOW (s->next)->prev = sibling;
3946 } 3946 }
3947 3947
3948 if (resize_window_check (r, horflag) 3948 if (window_resize_check (r, horflag)
3949 && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) 3949 && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines)))
3950 /* We can delete WINDOW now. */ 3950 /* We can delete WINDOW now. */
3951 { 3951 {
3952 /* Block input. */ 3952 /* Block input. */
3953 BLOCK_INPUT; 3953 BLOCK_INPUT;
3954 resize_window_apply (p, horflag); 3954 window_resize_apply (p, horflag);
3955 3955
3956 windows_or_buffers_changed++; 3956 windows_or_buffers_changed++;
3957 Vwindow_list = Qnil; 3957 Vwindow_list = Qnil;
@@ -4074,10 +4074,10 @@ grow_mini_window (struct window *w, int delta)
4074 root = FRAME_ROOT_WINDOW (f); 4074 root = FRAME_ROOT_WINDOW (f);
4075 r = XWINDOW (root); 4075 r = XWINDOW (root);
4076 value = call2 (Qresize_root_window_vertically, root, make_number (- delta)); 4076 value = call2 (Qresize_root_window_vertically, root, make_number (- delta));
4077 if (INTEGERP (value) && resize_window_check (r, 0)) 4077 if (INTEGERP (value) && window_resize_check (r, 0))
4078 { 4078 {
4079 BLOCK_INPUT; 4079 BLOCK_INPUT;
4080 resize_window_apply (r, 0); 4080 window_resize_apply (r, 0);
4081 4081
4082 /* Grow the mini-window. */ 4082 /* Grow the mini-window. */
4083 XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); 4083 XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines));
@@ -4109,10 +4109,10 @@ shrink_mini_window (struct window *w)
4109 r = XWINDOW (root); 4109 r = XWINDOW (root);
4110 value = call2 (Qresize_root_window_vertically, 4110 value = call2 (Qresize_root_window_vertically,
4111 root, make_number (size - 1)); 4111 root, make_number (size - 1));
4112 if (INTEGERP (value) && resize_window_check (r, 0)) 4112 if (INTEGERP (value) && window_resize_check (r, 0))
4113 { 4113 {
4114 BLOCK_INPUT; 4114 BLOCK_INPUT;
4115 resize_window_apply (r, 0); 4115 window_resize_apply (r, 0);
4116 4116
4117 /* Shrink the mini-window. */ 4117 /* Shrink the mini-window. */
4118 XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); 4118 XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines));
@@ -4150,12 +4150,12 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4150 4150
4151 r = XWINDOW (FRAME_ROOT_WINDOW (f)); 4151 r = XWINDOW (FRAME_ROOT_WINDOW (f));
4152 height = XINT (r->total_lines) + XINT (w->total_lines); 4152 height = XINT (r->total_lines) + XINT (w->total_lines);
4153 if (resize_window_check (r, 0) 4153 if (window_resize_check (r, 0)
4154 && XINT (w->new_total) > 0 4154 && XINT (w->new_total) > 0
4155 && height == XINT (r->new_total) + XINT (w->new_total)) 4155 && height == XINT (r->new_total) + XINT (w->new_total))
4156 { 4156 {
4157 BLOCK_INPUT; 4157 BLOCK_INPUT;
4158 resize_window_apply (r, 0); 4158 window_resize_apply (r, 0);
4159 4159
4160 w->total_lines = w->new_total; 4160 w->total_lines = w->new_total;
4161 XSETFASTINT (w->top_line, XINT (r->top_line) + XINT (r->total_lines)); 4161 XSETFASTINT (w->top_line, XINT (r->top_line) + XINT (r->total_lines));
@@ -6615,7 +6615,7 @@ function `window-nest' and altered by the function `set-window-nest'. */);
6615 defsubr (&Swindow_new_normal); 6615 defsubr (&Swindow_new_normal);
6616 defsubr (&Sset_window_new_total); 6616 defsubr (&Sset_window_new_total);
6617 defsubr (&Sset_window_new_normal); 6617 defsubr (&Sset_window_new_normal);
6618 defsubr (&Sresize_window_apply); 6618 defsubr (&Swindow_resize_apply);
6619 defsubr (&Swindow_body_size); 6619 defsubr (&Swindow_body_size);
6620 defsubr (&Swindow_hscroll); 6620 defsubr (&Swindow_hscroll);
6621 defsubr (&Sset_window_hscroll); 6621 defsubr (&Sset_window_hscroll);