diff options
| author | Chong Yidong | 2011-11-05 12:04:33 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-11-05 12:04:33 +0800 |
| commit | 447f16b85d5a429820779d422a4b12e95772071e (patch) | |
| tree | d66d6c6335355469dc0d7641c09018138be06135 | |
| parent | 24300f5fed2856a98785d75952e18a62fe19819c (diff) | |
| download | emacs-447f16b85d5a429820779d422a4b12e95772071e.tar.gz emacs-447f16b85d5a429820779d422a4b12e95772071e.zip | |
* window.el (window-normalize-window): Rename from window-normalize-any-window.
New arg LIVE-ONLY, replacing window-normalize-live-window.
(window-normalize-live-window): Deleted.
(window-combination-p, window-combined-p, window-combinations)
(walk-window-subtree, window-atom-root, window-min-size)
(window-sizable, window-sizable-p, window-size-fixed-p)
(window-min-delta, window-max-delta, window-resizable)
(window-resizable-p, window-full-height-p, window-full-width-p)
(window-current-scroll-bars, window-point-1, set-window-point-1)
(window-at-side-p, window-in-direction, window-resize)
(adjust-window-trailing-edge, maximize-window, minimize-window)
(window-deletable-p, delete-window, delete-other-windows)
(record-window-buffer, unrecord-window-buffer)
(switch-to-prev-buffer, switch-to-next-buffer, window--delete)
(quit-window, split-window, window-state-put)
(set-window-text-height, fit-window-to-buffer)
(shrink-window-if-larger-than-buffer): Callers changed.
| -rw-r--r-- | lisp/ChangeLog | 20 | ||||
| -rw-r--r-- | lisp/window.el | 107 |
2 files changed, 70 insertions, 57 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39d64bcc7c0..9d0ecd46663 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,8 +1,24 @@ | |||
| 1 | 2011-11-05 Chong Yidong <cyd@gnu.org> | 1 | 2011-11-05 Chong Yidong <cyd@gnu.org> |
| 2 | 2 | ||
| 3 | * window.el (window-valid-p): Rename from window-any-p. | 3 | * window.el (window-valid-p): Rename from window-any-p. |
| 4 | (window-normalize-any-window, window-size-ignore) | 4 | (window-size-ignore, window-state-get): Callers changed. |
| 5 | (window-state-get): Callers changed. | 5 | (window-normalize-window): Rename from window-normalize-any-window. |
| 6 | New arg LIVE-ONLY, replacing window-normalize-live-window. | ||
| 7 | (window-normalize-live-window): Deleted. | ||
| 8 | (window-combination-p, window-combined-p, window-combinations) | ||
| 9 | (walk-window-subtree, window-atom-root, window-min-size) | ||
| 10 | (window-sizable, window-sizable-p, window-size-fixed-p) | ||
| 11 | (window-min-delta, window-max-delta, window-resizable) | ||
| 12 | (window-resizable-p, window-full-height-p, window-full-width-p) | ||
| 13 | (window-current-scroll-bars, window-point-1, set-window-point-1) | ||
| 14 | (window-at-side-p, window-in-direction, window-resize) | ||
| 15 | (adjust-window-trailing-edge, maximize-window, minimize-window) | ||
| 16 | (window-deletable-p, delete-window, delete-other-windows) | ||
| 17 | (record-window-buffer, unrecord-window-buffer) | ||
| 18 | (switch-to-prev-buffer, switch-to-next-buffer, window--delete) | ||
| 19 | (quit-window, split-window, window-state-put) | ||
| 20 | (set-window-text-height, fit-window-to-buffer) | ||
| 21 | (shrink-window-if-larger-than-buffer): Callers changed. | ||
| 6 | 22 | ||
| 7 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | 23 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> |
| 8 | 24 | ||
diff --git a/lisp/window.el b/lisp/window.el index e75833fcd57..618cd6487fb 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -132,24 +132,21 @@ FRAME must be a live frame and defaults to the selected frame." | |||
| 132 | (error "%s is not a live frame" frame)) | 132 | (error "%s is not a live frame" frame)) |
| 133 | (selected-frame))) | 133 | (selected-frame))) |
| 134 | 134 | ||
| 135 | (defsubst window-normalize-any-window (window) | 135 | (defsubst window-normalize-window (window &optional live-only) |
| 136 | "Return window specified by WINDOW. | 136 | "Return window specified by WINDOW. |
| 137 | WINDOW must be a window that has not been deleted and defaults to | 137 | If WINDOW is nil, return `selected-window'. |
| 138 | the selected window." | 138 | If WINDOW is a live window or internal window, return WINDOW; |
| 139 | (if window | 139 | if LIVE-ONLY is non-nil, return WINDOW for a live window only. |
| 140 | (if (window-valid-p window) | 140 | Otherwise, signal an error." |
| 141 | window | 141 | (cond ((null window) |
| 142 | (error "%s is not a window" window)) | 142 | (selected-window)) |
| 143 | (selected-window))) | 143 | (live-only |
| 144 | 144 | (if (window-live-p window) | |
| 145 | (defsubst window-normalize-live-window (window) | 145 | window |
| 146 | "Return live window specified by WINDOW. | 146 | (error "%s is not a live window" window))) |
| 147 | WINDOW must be a live window and defaults to the selected one." | 147 | ((if (window-valid-p window) |
| 148 | (if window | 148 | window |
| 149 | (if (and (windowp window) (window-buffer window)) | 149 | (error "%s is not a window" window))))) |
| 150 | window | ||
| 151 | (error "%s is not a live window" window)) | ||
| 152 | (selected-window))) | ||
| 153 | 150 | ||
| 154 | (defvar ignore-window-parameters nil | 151 | (defvar ignore-window-parameters nil |
| 155 | "If non-nil, standard functions ignore window parameters. | 152 | "If non-nil, standard functions ignore window parameters. |
| @@ -203,7 +200,7 @@ narrower, explictly specify the SIZE argument of that function." | |||
| 203 | WINDOW can be any window and defaults to the selected one. | 200 | WINDOW can be any window and defaults to the selected one. |
| 204 | Optional argument HORIZONTAL non-nil means return WINDOW's first | 201 | Optional argument HORIZONTAL non-nil means return WINDOW's first |
| 205 | child if WINDOW is a horizontal combination." | 202 | child if WINDOW is a horizontal combination." |
| 206 | (setq window (window-normalize-any-window window)) | 203 | (setq window (window-normalize-window window)) |
| 207 | (if horizontal | 204 | (if horizontal |
| 208 | (window-left-child window) | 205 | (window-left-child window) |
| 209 | (window-top-child window))) | 206 | (window-top-child window))) |
| @@ -213,7 +210,7 @@ child if WINDOW is a horizontal combination." | |||
| 213 | WINDOW can be any window and defaults to the selected one. | 210 | WINDOW can be any window and defaults to the selected one. |
| 214 | Optional argument HORIZONTAL non-nil means return non-nil if and | 211 | Optional argument HORIZONTAL non-nil means return non-nil if and |
| 215 | only if WINDOW is horizontally combined." | 212 | only if WINDOW is horizontally combined." |
| 216 | (setq window (window-normalize-any-window window)) | 213 | (setq window (window-normalize-window window)) |
| 217 | (let ((parent (window-parent window))) | 214 | (let ((parent (window-parent window))) |
| 218 | (and parent (window-combination-p parent horizontal)))) | 215 | (and parent (window-combination-p parent horizontal)))) |
| 219 | 216 | ||
| @@ -222,7 +219,7 @@ only if WINDOW is horizontally combined." | |||
| 222 | WINDOW can be any window and defaults to the selected one. | 219 | WINDOW can be any window and defaults to the selected one. |
| 223 | Optional argument HORIZONTAL non-nil means to return the largest | 220 | Optional argument HORIZONTAL non-nil means to return the largest |
| 224 | number of horizontally arranged subwindows of WINDOW." | 221 | number of horizontally arranged subwindows of WINDOW." |
| 225 | (setq window (window-normalize-any-window window)) | 222 | (setq window (window-normalize-window window)) |
| 226 | (cond | 223 | (cond |
| 227 | ((window-live-p window) | 224 | ((window-live-p window) |
| 228 | ;; If WINDOW is live, return 1. | 225 | ;; If WINDOW is live, return 1. |
| @@ -291,7 +288,7 @@ on all live and internal subwindows of WINDOW. | |||
| 291 | This function performs a pre-order, depth-first traversal of the | 288 | This function performs a pre-order, depth-first traversal of the |
| 292 | window tree rooted at WINDOW. If PROC changes that window tree, | 289 | window tree rooted at WINDOW. If PROC changes that window tree, |
| 293 | the result is unpredictable." | 290 | the result is unpredictable." |
| 294 | (setq window (window-normalize-any-window window)) | 291 | (setq window (window-normalize-window window)) |
| 295 | (walk-window-tree-1 proc window any t)) | 292 | (walk-window-tree-1 proc window any t)) |
| 296 | 293 | ||
| 297 | (defun windows-with-parameter (parameter &optional value frame any values) | 294 | (defun windows-with-parameter (parameter &optional value frame any values) |
| @@ -337,7 +334,7 @@ too." | |||
| 337 | "Return root of atomic window WINDOW is a part of. | 334 | "Return root of atomic window WINDOW is a part of. |
| 338 | WINDOW can be any window and defaults to the selected one. | 335 | WINDOW can be any window and defaults to the selected one. |
| 339 | Return nil if WINDOW is not part of a atomic window." | 336 | Return nil if WINDOW is not part of a atomic window." |
| 340 | (setq window (window-normalize-any-window window)) | 337 | (setq window (window-normalize-window window)) |
| 341 | (let (root) | 338 | (let (root) |
| 342 | (while (and window (window-parameter window 'window-atom)) | 339 | (while (and window (window-parameter window 'window-atom)) |
| 343 | (setq root window) | 340 | (setq root window) |
| @@ -549,7 +546,7 @@ windows may get as small as `window-safe-min-height' lines and | |||
| 549 | `window-safe-min-width' columns. IGNORE a window means ignore | 546 | `window-safe-min-width' columns. IGNORE a window means ignore |
| 550 | restrictions for that window only." | 547 | restrictions for that window only." |
| 551 | (window-min-size-1 | 548 | (window-min-size-1 |
| 552 | (window-normalize-any-window window) horizontal ignore)) | 549 | (window-normalize-window window) horizontal ignore)) |
| 553 | 550 | ||
| 554 | (defun window-min-size-1 (window horizontal ignore) | 551 | (defun window-min-size-1 (window horizontal ignore) |
| 555 | "Internal function of `window-min-size'." | 552 | "Internal function of `window-min-size'." |
| @@ -642,7 +639,7 @@ imposed by fixed size windows, `window-min-height' or | |||
| 642 | windows may get as small as `window-safe-min-height' lines and | 639 | windows may get as small as `window-safe-min-height' lines and |
| 643 | `window-safe-min-width' columns. IGNORE any window means ignore | 640 | `window-safe-min-width' columns. IGNORE any window means ignore |
| 644 | restrictions for that window only." | 641 | restrictions for that window only." |
| 645 | (setq window (window-normalize-any-window window)) | 642 | (setq window (window-normalize-window window)) |
| 646 | (cond | 643 | (cond |
| 647 | ((< delta 0) | 644 | ((< delta 0) |
| 648 | (max (- (window-min-size window horizontal ignore) | 645 | (max (- (window-min-size window horizontal ignore) |
| @@ -660,7 +657,7 @@ restrictions for that window only." | |||
| 660 | "Return t if WINDOW can be resized by DELTA lines. | 657 | "Return t if WINDOW can be resized by DELTA lines. |
| 661 | For the meaning of the arguments of this function see the | 658 | For the meaning of the arguments of this function see the |
| 662 | doc-string of `window-sizable'." | 659 | doc-string of `window-sizable'." |
| 663 | (setq window (window-normalize-any-window window)) | 660 | (setq window (window-normalize-window window)) |
| 664 | (if (> delta 0) | 661 | (if (> delta 0) |
| 665 | (>= (window-sizable window delta horizontal ignore) delta) | 662 | (>= (window-sizable window delta horizontal ignore) delta) |
| 666 | (<= (window-sizable window delta horizontal ignore) delta))) | 663 | (<= (window-sizable window delta horizontal ignore) delta))) |
| @@ -708,7 +705,7 @@ If this function returns nil, this does not necessarily mean that | |||
| 708 | WINDOW can be resized in the desired direction. The functions | 705 | WINDOW can be resized in the desired direction. The functions |
| 709 | `window-resizable' and `window-resizable-p' will tell that." | 706 | `window-resizable' and `window-resizable-p' will tell that." |
| 710 | (window-size-fixed-1 | 707 | (window-size-fixed-1 |
| 711 | (window-normalize-any-window window) horizontal)) | 708 | (window-normalize-window window) horizontal)) |
| 712 | 709 | ||
| 713 | (defun window-min-delta-1 (window delta &optional horizontal ignore trail noup) | 710 | (defun window-min-delta-1 (window delta &optional horizontal ignore trail noup) |
| 714 | "Internal function for `window-min-delta'." | 711 | "Internal function for `window-min-delta'." |
| @@ -774,7 +771,7 @@ tree but try to enlarge windows within WINDOW's combination only. | |||
| 774 | Optional argument NODOWN non-nil means don't check whether WINDOW | 771 | Optional argument NODOWN non-nil means don't check whether WINDOW |
| 775 | itself \(and its subwindows) can be shrunk; check only whether at | 772 | itself \(and its subwindows) can be shrunk; check only whether at |
| 776 | least one other windows can be enlarged appropriately." | 773 | least one other windows can be enlarged appropriately." |
| 777 | (setq window (window-normalize-any-window window)) | 774 | (setq window (window-normalize-window window)) |
| 778 | (let ((size (window-total-size window horizontal)) | 775 | (let ((size (window-total-size window horizontal)) |
| 779 | (minimum (window-min-size window horizontal ignore))) | 776 | (minimum (window-min-size window horizontal ignore))) |
| 780 | (cond | 777 | (cond |
| @@ -856,7 +853,7 @@ WINDOW's combination. | |||
| 856 | Optional argument NODOWN non-nil means do not check whether | 853 | Optional argument NODOWN non-nil means do not check whether |
| 857 | WINDOW itself \(and its subwindows) can be enlarged; check only | 854 | WINDOW itself \(and its subwindows) can be enlarged; check only |
| 858 | whether other windows can be shrunk appropriately." | 855 | whether other windows can be shrunk appropriately." |
| 859 | (setq window (window-normalize-any-window window)) | 856 | (setq window (window-normalize-window window)) |
| 860 | (if (and (not (window-size-ignore window ignore)) | 857 | (if (and (not (window-size-ignore window ignore)) |
| 861 | (not nodown) (window-size-fixed-p window horizontal)) | 858 | (not nodown) (window-size-fixed-p window horizontal)) |
| 862 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed | 859 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed |
| @@ -900,7 +897,7 @@ within WINDOW's combination. | |||
| 900 | 897 | ||
| 901 | Optional argument NODOWN non-nil means don't check whether WINDOW | 898 | Optional argument NODOWN non-nil means don't check whether WINDOW |
| 902 | and its subwindows can be resized." | 899 | and its subwindows can be resized." |
| 903 | (setq window (window-normalize-any-window window)) | 900 | (setq window (window-normalize-window window)) |
| 904 | (cond | 901 | (cond |
| 905 | ((< delta 0) | 902 | ((< delta 0) |
| 906 | (max (- (window-min-delta window horizontal ignore trail noup nodown)) | 903 | (max (- (window-min-delta window horizontal ignore trail noup nodown)) |
| @@ -914,7 +911,7 @@ and its subwindows can be resized." | |||
| 914 | "Return t if WINDOW can be resized vertically by DELTA lines. | 911 | "Return t if WINDOW can be resized vertically by DELTA lines. |
| 915 | For the meaning of the arguments of this function see the | 912 | For the meaning of the arguments of this function see the |
| 916 | doc-string of `window-resizable'." | 913 | doc-string of `window-resizable'." |
| 917 | (setq window (window-normalize-any-window window)) | 914 | (setq window (window-normalize-window window)) |
| 918 | (if (> delta 0) | 915 | (if (> delta 0) |
| 919 | (>= (window-resizable window delta horizontal ignore trail noup nodown) | 916 | (>= (window-resizable window delta horizontal ignore trail noup nodown) |
| 920 | delta) | 917 | delta) |
| @@ -943,7 +940,7 @@ More precisely, return t if and only if the total height of | |||
| 943 | WINDOW equals the total height of the root window of WINDOW's | 940 | WINDOW equals the total height of the root window of WINDOW's |
| 944 | frame. WINDOW can be any window and defaults to the selected | 941 | frame. WINDOW can be any window and defaults to the selected |
| 945 | one." | 942 | one." |
| 946 | (setq window (window-normalize-any-window window)) | 943 | (setq window (window-normalize-window window)) |
| 947 | (= (window-total-size window) | 944 | (= (window-total-size window) |
| 948 | (window-total-size (frame-root-window window)))) | 945 | (window-total-size (frame-root-window window)))) |
| 949 | 946 | ||
| @@ -962,7 +959,7 @@ otherwise." | |||
| 962 | More precisely, return t if and only if the total width of WINDOW | 959 | More precisely, return t if and only if the total width of WINDOW |
| 963 | equals the total width of the root window of WINDOW's frame. | 960 | equals the total width of the root window of WINDOW's frame. |
| 964 | WINDOW can be any window and defaults to the selected one." | 961 | WINDOW can be any window and defaults to the selected one." |
| 965 | (setq window (window-normalize-any-window window)) | 962 | (setq window (window-normalize-window window)) |
| 966 | (= (window-total-size window t) | 963 | (= (window-total-size window t) |
| 967 | (window-total-size (frame-root-window window) t))) | 964 | (window-total-size (frame-root-window window) t))) |
| 968 | 965 | ||
| @@ -1017,7 +1014,7 @@ or nil). | |||
| 1017 | Unlike `window-scroll-bars', this function reports the scroll bar | 1014 | Unlike `window-scroll-bars', this function reports the scroll bar |
| 1018 | type actually used, once frame defaults and `scroll-bar-mode' are | 1015 | type actually used, once frame defaults and `scroll-bar-mode' are |
| 1019 | taken into account." | 1016 | taken into account." |
| 1020 | (setq window (window-normalize-live-window window)) | 1017 | (setq window (window-normalize-window window t)) |
| 1021 | (let ((vert (nth 2 (window-scroll-bars window))) | 1018 | (let ((vert (nth 2 (window-scroll-bars window))) |
| 1022 | (hor nil)) | 1019 | (hor nil)) |
| 1023 | (when (or (eq vert t) (eq hor t)) | 1020 | (when (or (eq vert t) (eq hor t)) |
| @@ -1081,7 +1078,7 @@ WINDOW can be any live window and defaults to the selected one. | |||
| 1081 | This function is like `window-point' with one exception: If | 1078 | This function is like `window-point' with one exception: If |
| 1082 | WINDOW is selected, it returns the value of `point' of WINDOW's | 1079 | WINDOW is selected, it returns the value of `point' of WINDOW's |
| 1083 | buffer regardless of whether that buffer is current or not." | 1080 | buffer regardless of whether that buffer is current or not." |
| 1084 | (setq window (window-normalize-live-window window)) | 1081 | (setq window (window-normalize-window window t)) |
| 1085 | (if (eq window (selected-window)) | 1082 | (if (eq window (selected-window)) |
| 1086 | (with-current-buffer (window-buffer window) | 1083 | (with-current-buffer (window-buffer window) |
| 1087 | (point)) | 1084 | (point)) |
| @@ -1094,7 +1091,7 @@ WINDOW can be any live window and defaults to the selected one. | |||
| 1094 | This function is like `set-window-point' with one exception: If | 1091 | This function is like `set-window-point' with one exception: If |
| 1095 | WINDOW is selected, it moves `point' of WINDOW's buffer to POS | 1092 | WINDOW is selected, it moves `point' of WINDOW's buffer to POS |
| 1096 | regardless of whether that buffer is current or not." | 1093 | regardless of whether that buffer is current or not." |
| 1097 | (setq window (window-normalize-live-window window)) | 1094 | (setq window (window-normalize-window window t)) |
| 1098 | (if (eq window (selected-window)) | 1095 | (if (eq window (selected-window)) |
| 1099 | (with-current-buffer (window-buffer window) | 1096 | (with-current-buffer (window-buffer window) |
| 1100 | (goto-char pos)) | 1097 | (goto-char pos)) |
| @@ -1105,7 +1102,7 @@ regardless of whether that buffer is current or not." | |||
| 1105 | WINDOW can be any window and defaults to the selected one. SIDE | 1102 | WINDOW can be any window and defaults to the selected one. SIDE |
| 1106 | can be any of the symbols `left', `top', `right' or `bottom'. | 1103 | can be any of the symbols `left', `top', `right' or `bottom'. |
| 1107 | The default value nil is handled like `bottom'." | 1104 | The default value nil is handled like `bottom'." |
| 1108 | (setq window (window-normalize-any-window window)) | 1105 | (setq window (window-normalize-window window)) |
| 1109 | (let ((edge | 1106 | (let ((edge |
| 1110 | (cond | 1107 | (cond |
| 1111 | ((eq side 'left) 0) | 1108 | ((eq side 'left) 0) |
| @@ -1147,7 +1144,7 @@ DIRECTION must be one of `above', `below', `left' or `right'. | |||
| 1147 | WINDOW must be a live window and defaults to the selected one. | 1144 | WINDOW must be a live window and defaults to the selected one. |
| 1148 | IGNORE, when non-nil means a window can be returned even if its | 1145 | IGNORE, when non-nil means a window can be returned even if its |
| 1149 | `no-other-window' parameter is non-nil." | 1146 | `no-other-window' parameter is non-nil." |
| 1150 | (setq window (window-normalize-live-window window)) | 1147 | (setq window (window-normalize-window window t)) |
| 1151 | (unless (memq direction '(above below left right)) | 1148 | (unless (memq direction '(above below left right)) |
| 1152 | (error "Wrong direction %s" direction)) | 1149 | (error "Wrong direction %s" direction)) |
| 1153 | (let* ((frame (window-frame window)) | 1150 | (let* ((frame (window-frame window)) |
| @@ -1502,7 +1499,7 @@ This function resizes other windows proportionally and never | |||
| 1502 | deletes any windows. If you want to move only the low (right) | 1499 | deletes any windows. If you want to move only the low (right) |
| 1503 | edge of WINDOW consider using `adjust-window-trailing-edge' | 1500 | edge of WINDOW consider using `adjust-window-trailing-edge' |
| 1504 | instead." | 1501 | instead." |
| 1505 | (setq window (window-normalize-any-window window)) | 1502 | (setq window (window-normalize-window window)) |
| 1506 | (let* ((frame (window-frame window)) | 1503 | (let* ((frame (window-frame window)) |
| 1507 | sibling) | 1504 | sibling) |
| 1508 | (cond | 1505 | (cond |
| @@ -2021,7 +2018,7 @@ If DELTA is greater zero, then move the edge downwards or to the | |||
| 2021 | right. If DELTA is less than zero, move the edge upwards or to | 2018 | right. If DELTA is less than zero, move the edge upwards or to |
| 2022 | the left. If the edge can't be moved by DELTA lines or columns, | 2019 | the left. If the edge can't be moved by DELTA lines or columns, |
| 2023 | move it as far as possible in the desired direction." | 2020 | move it as far as possible in the desired direction." |
| 2024 | (setq window (window-normalize-any-window window)) | 2021 | (setq window (window-normalize-window window)) |
| 2025 | (let ((frame (window-frame window)) | 2022 | (let ((frame (window-frame window)) |
| 2026 | (right window) | 2023 | (right window) |
| 2027 | left this-delta min-delta max-delta failed) | 2024 | left this-delta min-delta max-delta failed) |
| @@ -2168,7 +2165,7 @@ Return nil." | |||
| 2168 | Make WINDOW as large as possible without deleting any windows. | 2165 | Make WINDOW as large as possible without deleting any windows. |
| 2169 | WINDOW can be any window and defaults to the selected window." | 2166 | WINDOW can be any window and defaults to the selected window." |
| 2170 | (interactive) | 2167 | (interactive) |
| 2171 | (setq window (window-normalize-any-window window)) | 2168 | (setq window (window-normalize-window window)) |
| 2172 | (window-resize window (window-max-delta window)) | 2169 | (window-resize window (window-max-delta window)) |
| 2173 | (window-resize window (window-max-delta window t) t)) | 2170 | (window-resize window (window-max-delta window t) t)) |
| 2174 | 2171 | ||
| @@ -2177,7 +2174,7 @@ WINDOW can be any window and defaults to the selected window." | |||
| 2177 | Make WINDOW as small as possible without deleting any windows. | 2174 | Make WINDOW as small as possible without deleting any windows. |
| 2178 | WINDOW can be any window and defaults to the selected window." | 2175 | WINDOW can be any window and defaults to the selected window." |
| 2179 | (interactive) | 2176 | (interactive) |
| 2180 | (setq window (window-normalize-any-window window)) | 2177 | (setq window (window-normalize-window window)) |
| 2181 | (window-resize window (- (window-min-delta window))) | 2178 | (window-resize window (- (window-min-delta window))) |
| 2182 | (window-resize window (- (window-min-delta window t)) t)) | 2179 | (window-resize window (- (window-min-delta window t)) t)) |
| 2183 | 2180 | ||
| @@ -2333,7 +2330,7 @@ and no others." | |||
| 2333 | "Return t if WINDOW can be safely deleted from its frame. | 2330 | "Return t if WINDOW can be safely deleted from its frame. |
| 2334 | Return `frame' if deleting WINDOW should also delete its | 2331 | Return `frame' if deleting WINDOW should also delete its |
| 2335 | frame." | 2332 | frame." |
| 2336 | (setq window (window-normalize-any-window window)) | 2333 | (setq window (window-normalize-window window)) |
| 2337 | 2334 | ||
| 2338 | (unless ignore-window-parameters | 2335 | (unless ignore-window-parameters |
| 2339 | ;; Handle atomicity. | 2336 | ;; Handle atomicity. |
| @@ -2383,7 +2380,7 @@ Otherwise, if WINDOW is part of an atomic window, call | |||
| 2383 | argument. If WINDOW is the only window on its frame or the last | 2380 | argument. If WINDOW is the only window on its frame or the last |
| 2384 | non-side window, signal an error." | 2381 | non-side window, signal an error." |
| 2385 | (interactive) | 2382 | (interactive) |
| 2386 | (setq window (window-normalize-any-window window)) | 2383 | (setq window (window-normalize-window window)) |
| 2387 | (let* ((frame (window-frame window)) | 2384 | (let* ((frame (window-frame window)) |
| 2388 | (function (window-parameter window 'delete-window)) | 2385 | (function (window-parameter window 'delete-window)) |
| 2389 | (parent (window-parent window)) | 2386 | (parent (window-parent window)) |
| @@ -2464,7 +2461,7 @@ WINDOW is a non-side window, make WINDOW the only non-side window | |||
| 2464 | on the frame. Side windows are not deleted. If WINDOW is a side | 2461 | on the frame. Side windows are not deleted. If WINDOW is a side |
| 2465 | window signal an error." | 2462 | window signal an error." |
| 2466 | (interactive) | 2463 | (interactive) |
| 2467 | (setq window (window-normalize-any-window window)) | 2464 | (setq window (window-normalize-window window)) |
| 2468 | (let* ((frame (window-frame window)) | 2465 | (let* ((frame (window-frame window)) |
| 2469 | (function (window-parameter window 'delete-other-windows)) | 2466 | (function (window-parameter window 'delete-other-windows)) |
| 2470 | (window-side (window-parameter window 'window-side)) | 2467 | (window-side (window-parameter window 'window-side)) |
| @@ -2546,7 +2543,7 @@ This may be a useful alternative binding for \\[delete-other-windows] | |||
| 2546 | (defun record-window-buffer (&optional window) | 2543 | (defun record-window-buffer (&optional window) |
| 2547 | "Record WINDOW's buffer. | 2544 | "Record WINDOW's buffer. |
| 2548 | WINDOW must be a live window and defaults to the selected one." | 2545 | WINDOW must be a live window and defaults to the selected one." |
| 2549 | (let* ((window (window-normalize-live-window window)) | 2546 | (let* ((window (window-normalize-window window t)) |
| 2550 | (buffer (window-buffer window)) | 2547 | (buffer (window-buffer window)) |
| 2551 | (entry (assq buffer (window-prev-buffers window)))) | 2548 | (entry (assq buffer (window-prev-buffers window)))) |
| 2552 | ;; Reset WINDOW's next buffers. If needed, they are resurrected by | 2549 | ;; Reset WINDOW's next buffers. If needed, they are resurrected by |
| @@ -2582,7 +2579,7 @@ WINDOW must be a live window and defaults to the selected one." | |||
| 2582 | WINDOW must be a live window and defaults to the selected one. | 2579 | WINDOW must be a live window and defaults to the selected one. |
| 2583 | BUFFER must be a live buffer and defaults to the buffer of | 2580 | BUFFER must be a live buffer and defaults to the buffer of |
| 2584 | WINDOW." | 2581 | WINDOW." |
| 2585 | (let* ((window (window-normalize-live-window window)) | 2582 | (let* ((window (window-normalize-window window t)) |
| 2586 | (buffer (or buffer (window-buffer window)))) | 2583 | (buffer (or buffer (window-buffer window)))) |
| 2587 | (set-window-prev-buffers | 2584 | (set-window-prev-buffers |
| 2588 | window (assq-delete-all buffer (window-prev-buffers window))) | 2585 | window (assq-delete-all buffer (window-prev-buffers window))) |
| @@ -2615,7 +2612,7 @@ Optional argument BURY-OR-KILL non-nil means the buffer currently | |||
| 2615 | shown in WINDOW is about to be buried or killed and consequently | 2612 | shown in WINDOW is about to be buried or killed and consequently |
| 2616 | shall not be switched to in future invocations of this command." | 2613 | shall not be switched to in future invocations of this command." |
| 2617 | (interactive) | 2614 | (interactive) |
| 2618 | (let* ((window (window-normalize-live-window window)) | 2615 | (let* ((window (window-normalize-window window t)) |
| 2619 | (old-buffer (window-buffer window)) | 2616 | (old-buffer (window-buffer window)) |
| 2620 | ;; Save this since it's destroyed by `set-window-buffer'. | 2617 | ;; Save this since it's destroyed by `set-window-buffer'. |
| 2621 | (next-buffers (window-next-buffers window)) | 2618 | (next-buffers (window-next-buffers window)) |
| @@ -2704,7 +2701,7 @@ shall not be switched to in future invocations of this command." | |||
| 2704 | "In WINDOW switch to next buffer. | 2701 | "In WINDOW switch to next buffer. |
| 2705 | WINDOW must be a live window and defaults to the selected one." | 2702 | WINDOW must be a live window and defaults to the selected one." |
| 2706 | (interactive) | 2703 | (interactive) |
| 2707 | (let* ((window (window-normalize-live-window window)) | 2704 | (let* ((window (window-normalize-window window t)) |
| 2708 | (old-buffer (window-buffer window)) | 2705 | (old-buffer (window-buffer window)) |
| 2709 | (next-buffers (window-next-buffers window)) | 2706 | (next-buffers (window-next-buffers window)) |
| 2710 | new-buffer entry killed-buffers visible) | 2707 | new-buffer entry killed-buffers visible) |
| @@ -2827,7 +2824,7 @@ Optional argument DEDICATED-ONLY non-nil means to delete WINDOW | |||
| 2827 | only if it's dedicated to its buffer. Optional argument KILL | 2824 | only if it's dedicated to its buffer. Optional argument KILL |
| 2828 | means the buffer shown in window will be killed. Return non-nil | 2825 | means the buffer shown in window will be killed. Return non-nil |
| 2829 | if WINDOW gets deleted or its frame is auto-hidden." | 2826 | if WINDOW gets deleted or its frame is auto-hidden." |
| 2830 | (setq window (window-normalize-live-window window)) | 2827 | (setq window (window-normalize-window window t)) |
| 2831 | (unless (and dedicated-only (not (window-dedicated-p window))) | 2828 | (unless (and dedicated-only (not (window-dedicated-p window))) |
| 2832 | (let* ((buffer (window-buffer window)) | 2829 | (let* ((buffer (window-buffer window)) |
| 2833 | (deletable (window-deletable-p window))) | 2830 | (deletable (window-deletable-p window))) |
| @@ -2973,7 +2970,7 @@ WINDOW, \(3) restore the buffer previously displayed in WINDOW, | |||
| 2973 | or \(4) make WINDOW display some other buffer than the present | 2970 | or \(4) make WINDOW display some other buffer than the present |
| 2974 | one. If non-nil, reset `quit-restore' parameter to nil." | 2971 | one. If non-nil, reset `quit-restore' parameter to nil." |
| 2975 | (interactive "P") | 2972 | (interactive "P") |
| 2976 | (setq window (window-normalize-live-window window)) | 2973 | (setq window (window-normalize-window window t)) |
| 2977 | (let* ((buffer (window-buffer window)) | 2974 | (let* ((buffer (window-buffer window)) |
| 2978 | (quit-restore (window-parameter window 'quit-restore)) | 2975 | (quit-restore (window-parameter window 'quit-restore)) |
| 2979 | (prev-buffer | 2976 | (prev-buffer |
| @@ -3105,7 +3102,7 @@ window, these properties as well as the buffer displayed in the | |||
| 3105 | new window are inherited from the window selected on WINDOW's | 3102 | new window are inherited from the window selected on WINDOW's |
| 3106 | frame. The selected window is not changed by this function." | 3103 | frame. The selected window is not changed by this function." |
| 3107 | (interactive "i") | 3104 | (interactive "i") |
| 3108 | (setq window (window-normalize-any-window window)) | 3105 | (setq window (window-normalize-window window)) |
| 3109 | (let* ((side (cond | 3106 | (let* ((side (cond |
| 3110 | ((not side) 'below) | 3107 | ((not side) 'below) |
| 3111 | ((memq side '(below above right left)) side) | 3108 | ((memq side '(below above right left)) side) |
| @@ -3849,7 +3846,7 @@ Optional argument IGNORE non-nil means ignore minimum window | |||
| 3849 | sizes and fixed size restrictions. IGNORE equal `safe' means | 3846 | sizes and fixed size restrictions. IGNORE equal `safe' means |
| 3850 | subwindows can get as small as `window-safe-min-height' and | 3847 | subwindows can get as small as `window-safe-min-height' and |
| 3851 | `window-safe-min-width'." | 3848 | `window-safe-min-width'." |
| 3852 | (setq window (window-normalize-live-window window)) | 3849 | (setq window (window-normalize-window window t)) |
| 3853 | (let* ((frame (window-frame window)) | 3850 | (let* ((frame (window-frame window)) |
| 3854 | (head (car state)) | 3851 | (head (car state)) |
| 3855 | ;; We check here (1) whether the total sizes of root window of | 3852 | ;; We check here (1) whether the total sizes of root window of |
| @@ -5115,7 +5112,7 @@ Note that the current implementation of this function cannot | |||
| 5115 | always set the height exactly, but attempts to be conservative, | 5112 | always set the height exactly, but attempts to be conservative, |
| 5116 | by allocating more lines than are actually needed in the case | 5113 | by allocating more lines than are actually needed in the case |
| 5117 | where some error may be present." | 5114 | where some error may be present." |
| 5118 | (setq window (window-normalize-live-window window)) | 5115 | (setq window (window-normalize-window window t)) |
| 5119 | (let ((delta (- height (window-text-height window)))) | 5116 | (let ((delta (- height (window-text-height window)))) |
| 5120 | (unless (zerop delta) | 5117 | (unless (zerop delta) |
| 5121 | ;; Setting window-min-height to a value like 1 can lead to very | 5118 | ;; Setting window-min-height to a value like 1 can lead to very |
| @@ -5211,7 +5208,7 @@ WINDOW was scrolled." | |||
| 5211 | (interactive) | 5208 | (interactive) |
| 5212 | ;; Do all the work in WINDOW and its buffer and restore the selected | 5209 | ;; Do all the work in WINDOW and its buffer and restore the selected |
| 5213 | ;; window and the current buffer when we're done. | 5210 | ;; window and the current buffer when we're done. |
| 5214 | (setq window (window-normalize-live-window window)) | 5211 | (setq window (window-normalize-window window t)) |
| 5215 | ;; Can't resize a full height or fixed-size window. | 5212 | ;; Can't resize a full height or fixed-size window. |
| 5216 | (unless (or (window-size-fixed-p window) | 5213 | (unless (or (window-size-fixed-p window) |
| 5217 | (window-full-height-p window)) | 5214 | (window-full-height-p window)) |
| @@ -5317,7 +5314,7 @@ window, or if the window is the only window of its frame. | |||
| 5317 | 5314 | ||
| 5318 | Return non-nil if the window was shrunk, nil otherwise." | 5315 | Return non-nil if the window was shrunk, nil otherwise." |
| 5319 | (interactive) | 5316 | (interactive) |
| 5320 | (setq window (window-normalize-live-window window)) | 5317 | (setq window (window-normalize-window window t)) |
| 5321 | ;; Make sure that WINDOW is vertically combined and `point-min' is | 5318 | ;; Make sure that WINDOW is vertically combined and `point-min' is |
| 5322 | ;; visible (for whatever reason that's needed). The remaining issues | 5319 | ;; visible (for whatever reason that's needed). The remaining issues |
| 5323 | ;; should be taken care of by `fit-window-to-buffer'. | 5320 | ;; should be taken care of by `fit-window-to-buffer'. |