diff options
| author | Martin Rudalics | 2011-06-27 20:32:56 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2011-06-27 20:32:56 +0200 |
| commit | d615d6d2887f159f1a7337be7bd175ce22013e1f (patch) | |
| tree | daa3b9ed6ec8f32ee0b1b93ec2d93e4b324274c3 /lisp | |
| parent | 945152374eaba9c794ec04bb0474e49343c63b23 (diff) | |
| download | emacs-d615d6d2887f159f1a7337be7bd175ce22013e1f.tar.gz emacs-d615d6d2887f159f1a7337be7bd175ce22013e1f.zip | |
Use window- prefix more consistently. Fix two buffer display bugs.
* window.c (resize_window_check): Rename to window_resize_check.
(resize_window_apply): Rename to window_resize_apply.
(Fresize_window_apply): Rename to Fwindow_resize_apply.
(Fdelete_other_windows_internal, resize_frame_windows)
(Fsplit_window_internal, Fdelete_window_internal)
(grow_mini_window, shrink_mini_window)
(Fresize_mini_window_internal): Fix callers accordingly.
* window.el (resize-window-reset): Rename to window-resize-reset.
(resize-window-reset-1): Rename to window-resize-reset-1.
(resize-window): Rename to window-resize.
(window-min-height, window-min-width)
(resize-mini-window, resize-this-window, resize-root-window)
(resize-root-window-vertically, adjust-window-trailing-edge)
(enlarge-window, shrink-window, maximize-window)
(minimize-window, delete-window, quit-restore-window)
(split-window, balance-windows, balance-windows-area-adjust)
(balance-windows-area, window-state-put-2)
(display-buffer-even-window-sizes, display-buffer-set-height)
(display-buffer-set-width, set-window-text-height)
(fit-window-to-buffer): Rename all "resize-window" prefixed
calls to use the "window-resize" prefix convention.
(display-buffer-alist): Fix symbol for label specifier.
(display-buffer-reuse-window): Set reuse-dedicated to cdr of
corresponding specifier.
Reported by Juanma Barranquero <lekktu@gmail.com>.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 18 | ||||
| -rw-r--r-- | lisp/window.el | 104 |
2 files changed, 70 insertions, 52 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 | ||
| 13 | 2011-06-27 Vincent Belaïche <vincentb1@users.sourceforge.net> | 31 | 2011-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 | ||
| 171 | Applications should never rebind this variable. To resize a | 171 | Applications should never rebind this variable. To resize a |
| 172 | window to a height less than the one specified here, an | 172 | window to a height less than the one specified here, an |
| 173 | application should instead call `resize-window' with a non-nil | 173 | application should instead call `window-resize' with a non-nil |
| 174 | IGNORE argument. In order to have `split-window' make a window | 174 | IGNORE argument. In order to have `split-window' make a window |
| 175 | shorter, explictly specify the SIZE argument of that function." | 175 | shorter, explictly specify the SIZE argument of that function." |
| 176 | :type 'integer | 176 | :type 'integer |
| @@ -190,7 +190,7 @@ split. | |||
| 190 | 190 | ||
| 191 | Applications should never rebind this variable. To resize a | 191 | Applications should never rebind this variable. To resize a |
| 192 | window to a width less than the one specified here, an | 192 | window to a width less than the one specified here, an |
| 193 | application should instead call `resize-window' with a non-nil | 193 | application should instead call `window-resize' with a non-nil |
| 194 | IGNORE argument. In order to have `split-window' make a window | 194 | IGNORE argument. In order to have `split-window' make a window |
| 195 | narrower, explictly specify the SIZE argument of that function." | 195 | narrower, 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. |
| 1358 | FRAME defaults to the selected frame. | 1358 | FRAME defaults to the selected frame. |
| 1359 | 1359 | ||
| @@ -1361,19 +1361,19 @@ This function stores the current value of `window-total-size' applied | |||
| 1361 | with argument HORIZONTAL in the new total size of all windows on | 1361 | with argument HORIZONTAL in the new total size of all windows on |
| 1362 | FRAME. It also resets the new normal size of each of these | 1362 | FRAME. It also resets the new normal size of each of these |
| 1363 | windows." | 1363 | windows." |
| 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. |
| 1411 | WINDOW can be an arbitrary window and defaults to the selected | 1411 | WINDOW can be an arbitrary window and defaults to the selected |
| 1412 | one. An attempt to resize the root window of a frame will raise | 1412 | one. 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 | |||
| 1867 | new size. Make sure that WINDOW is `window-resizable' before | 1867 | new size. Make sure that WINDOW is `window-resizable' before |
| 1868 | calling this function. Note that this function does not resize | 1868 | calling this function. Note that this function does not resize |
| 1869 | siblings of WINDOW or WINDOW's parent window. You have to | 1869 | siblings of WINDOW or WINDOW's parent window. You have to |
| 1870 | eventually call `resize-window-apply' in order to make resizing | 1870 | eventually call `window-resize-apply' in order to make resizing |
| 1871 | actually take effect." | 1871 | actually 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 | |||
| 1898 | resizes windows proportionally and never deletes any windows." | 1898 | resizes 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. | |||
| 2092 | WINDOW can be any window and defaults to the selected window." | 2092 | WINDOW 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. | |||
| 2101 | WINDOW can be any window and defaults to the selected window." | 2101 | WINDOW 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. |
| 3426 | Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function." | 3426 | Arguments 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)))) |