diff options
| author | Martin Rudalics | 2011-06-29 14:06:08 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2011-06-29 14:06:08 +0200 |
| commit | 5386012dfddc8bda16a5a2c5dea9121f2be108e8 (patch) | |
| tree | 8845150c976ef2b233cdf256cfb6fae9425aed7f | |
| parent | 130f1dac7ab4681e4db9498ee35c13e7725a4bf2 (diff) | |
| download | emacs-5386012dfddc8bda16a5a2c5dea9121f2be108e8.tar.gz emacs-5386012dfddc8bda16a5a2c5dea9121f2be108e8.zip | |
Rename more functions to use window-/window-- prefixes.
* window.c (resize_root_window, grow_mini_window)
(shrink_mini_window): Rename Qresize_root_window to
Qwindow_resize_root_window and Qresize_root_window_vertically to
Qwindow_resize_root_window_vertically.
* window.el (normalize-live-buffer): Rename to
window-normalize-buffer.
(normalize-live-frame): Rename to window-normalize-frame.
(normalize-any-window): Rename to window-normalize-any-window.
(normalize-live-window): Rename to window-normalize-live-window.
(make-window-atom): Rename to window-make-atom.
(window-resize-reset): Rename to window--resize-reset.
(window-resize-reset-1): Rename to window--resize-reset-1.
(resize-mini-window): Rename to window--resize-mini-window.
(resize-subwindows-skip-p): Rename to
window--resize-subwindows-skip-p.
(resize-subwindows-normal): Rename to
window--resize-subwindows-normal.
(resize-subwindows): Rename to window--resize-subwindows.
(resize-other-windows): Rename to window--resize-siblings.
(resize-this-window): Rename to window--resize-this-window.
(resize-root-window): Rename to window--resize-root-window.
(resize-root-window-vertically): Rename to
window--resize-root-window-vertically.
(normalize-buffer-to-display): Rename to
window-normalize-buffer-to-display.
(normalize-buffer-to-switch-to): Rename to
window-normalize-buffer-to-switch-to.
Correspondingly update all callers of the functions listed
above.
(display-buffer-alist, display-buffer-normalize-arguments)
(display-buffer-normalize-options, display-buffer)
(display-buffer-alist-set): Use "function" instead of
"fun-with-args".
| -rw-r--r-- | lisp/ChangeLog | 32 | ||||
| -rw-r--r-- | lisp/window.el | 294 | ||||
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/window.c | 13 |
4 files changed, 196 insertions, 150 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29ea8dca53c..59a8074871f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,35 @@ | |||
| 1 | 2011-06-29 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (normalize-live-buffer): Rename to | ||
| 4 | window-normalize-buffer. | ||
| 5 | (normalize-live-frame): Rename to window-normalize-frame. | ||
| 6 | (normalize-any-window): Rename to window-normalize-any-window. | ||
| 7 | (normalize-live-window): Rename to window-normalize-live-window. | ||
| 8 | (make-window-atom): Rename to window-make-atom. | ||
| 9 | (window-resize-reset): Rename to window--resize-reset. | ||
| 10 | (window-resize-reset-1): Rename to window--resize-reset-1. | ||
| 11 | (resize-mini-window): Rename to window--resize-mini-window. | ||
| 12 | (resize-subwindows-skip-p): Rename to | ||
| 13 | window--resize-subwindows-skip-p. | ||
| 14 | (resize-subwindows-normal): Rename to | ||
| 15 | window--resize-subwindows-normal. | ||
| 16 | (resize-subwindows): Rename to window--resize-subwindows. | ||
| 17 | (resize-other-windows): Rename to window--resize-siblings. | ||
| 18 | (resize-this-window): Rename to window--resize-this-window. | ||
| 19 | (resize-root-window): Rename to window--resize-root-window. | ||
| 20 | (resize-root-window-vertically): Rename to | ||
| 21 | window--resize-root-window-vertically. | ||
| 22 | (normalize-buffer-to-display): Rename to | ||
| 23 | window-normalize-buffer-to-display. | ||
| 24 | (normalize-buffer-to-switch-to): Rename to | ||
| 25 | window-normalize-buffer-to-switch-to. | ||
| 26 | Correspondingly update all callers of the functions listed | ||
| 27 | above. | ||
| 28 | (display-buffer-alist, display-buffer-normalize-arguments) | ||
| 29 | (display-buffer-normalize-options, display-buffer) | ||
| 30 | (display-buffer-alist-set): Use "function" instead of | ||
| 31 | "fun-with-args". | ||
| 32 | |||
| 1 | 2011-06-28 Chong Yidong <cyd@stupidchicken.com> | 33 | 2011-06-28 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 34 | ||
| 3 | * mail/emacsbug.el (report-emacs-bug): Handle non-gnu bug | 35 | * mail/emacsbug.el (report-emacs-bug): Handle non-gnu bug |
diff --git a/lisp/window.el b/lisp/window.el index 161dbb33646..15e603bc6c9 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -106,8 +106,7 @@ be any window." | |||
| 106 | (or (window-buffer object) (window-child object)) | 106 | (or (window-buffer object) (window-child object)) |
| 107 | t)) | 107 | t)) |
| 108 | 108 | ||
| 109 | ;; The following four functions should probably go to subr.el. | 109 | (defsubst window-normalize-buffer (buffer-or-name) |
| 110 | (defsubst normalize-live-buffer (buffer-or-name) | ||
| 111 | "Return buffer specified by BUFFER-OR-NAME. | 110 | "Return buffer specified by BUFFER-OR-NAME. |
| 112 | BUFFER-OR-NAME must be either a buffer or a string naming a live | 111 | BUFFER-OR-NAME must be either a buffer or a string naming a live |
| 113 | buffer and defaults to the current buffer." | 112 | buffer and defaults to the current buffer." |
| @@ -122,7 +121,7 @@ buffer and defaults to the current buffer." | |||
| 122 | (t | 121 | (t |
| 123 | (error "No such buffer %s" buffer-or-name)))) | 122 | (error "No such buffer %s" buffer-or-name)))) |
| 124 | 123 | ||
| 125 | (defsubst normalize-live-frame (frame) | 124 | (defsubst window-normalize-frame (frame) |
| 126 | "Return frame specified by FRAME. | 125 | "Return frame specified by FRAME. |
| 127 | FRAME must be a live frame and defaults to the selected frame." | 126 | FRAME must be a live frame and defaults to the selected frame." |
| 128 | (if frame | 127 | (if frame |
| @@ -131,7 +130,7 @@ FRAME must be a live frame and defaults to the selected frame." | |||
| 131 | (error "%s is not a live frame" frame)) | 130 | (error "%s is not a live frame" frame)) |
| 132 | (selected-frame))) | 131 | (selected-frame))) |
| 133 | 132 | ||
| 134 | (defsubst normalize-any-window (window) | 133 | (defsubst window-normalize-any-window (window) |
| 135 | "Return window specified by WINDOW. | 134 | "Return window specified by WINDOW. |
| 136 | WINDOW must be a window that has not been deleted and defaults to | 135 | WINDOW must be a window that has not been deleted and defaults to |
| 137 | the selected window." | 136 | the selected window." |
| @@ -141,7 +140,7 @@ the selected window." | |||
| 141 | (error "%s is not a window" window)) | 140 | (error "%s is not a window" window)) |
| 142 | (selected-window))) | 141 | (selected-window))) |
| 143 | 142 | ||
| 144 | (defsubst normalize-live-window (window) | 143 | (defsubst window-normalize-live-window (window) |
| 145 | "Return live window specified by WINDOW. | 144 | "Return live window specified by WINDOW. |
| 146 | WINDOW must be a live window and defaults to the selected one." | 145 | WINDOW must be a live window and defaults to the selected one." |
| 147 | (if window | 146 | (if window |
| @@ -202,7 +201,7 @@ narrower, explictly specify the SIZE argument of that function." | |||
| 202 | WINDOW can be any window and defaults to the selected one. | 201 | WINDOW can be any window and defaults to the selected one. |
| 203 | Optional argument HORIZONTAL non-nil means return WINDOW's first | 202 | Optional argument HORIZONTAL non-nil means return WINDOW's first |
| 204 | child if WINDOW is a horizontal combination." | 203 | child if WINDOW is a horizontal combination." |
| 205 | (setq window (normalize-any-window window)) | 204 | (setq window (window-normalize-any-window window)) |
| 206 | (if horizontal | 205 | (if horizontal |
| 207 | (window-left-child window) | 206 | (window-left-child window) |
| 208 | (window-top-child window))) | 207 | (window-top-child window))) |
| @@ -212,7 +211,7 @@ child if WINDOW is a horizontal combination." | |||
| 212 | WINDOW can be any window and defaults to the selected one. | 211 | WINDOW can be any window and defaults to the selected one. |
| 213 | Optional argument HORIZONTAL non-nil means return non-nil if and | 212 | Optional argument HORIZONTAL non-nil means return non-nil if and |
| 214 | only if WINDOW is horizontally combined." | 213 | only if WINDOW is horizontally combined." |
| 215 | (setq window (normalize-any-window window)) | 214 | (setq window (window-normalize-any-window window)) |
| 216 | (let ((parent (window-parent window))) | 215 | (let ((parent (window-parent window))) |
| 217 | (and parent (window-iso-combination-p parent horizontal)))) | 216 | (and parent (window-iso-combination-p parent horizontal)))) |
| 218 | 217 | ||
| @@ -221,7 +220,7 @@ only if WINDOW is horizontally combined." | |||
| 221 | WINDOW can be any window and defaults to the selected one. | 220 | WINDOW can be any window and defaults to the selected one. |
| 222 | Optional argument HORIZONTAL non-nil means to return the largest | 221 | Optional argument HORIZONTAL non-nil means to return the largest |
| 223 | number of horizontally arranged subwindows of WINDOW." | 222 | number of horizontally arranged subwindows of WINDOW." |
| 224 | (setq window (normalize-any-window window)) | 223 | (setq window (window-normalize-any-window window)) |
| 225 | (cond | 224 | (cond |
| 226 | ((window-live-p window) | 225 | ((window-live-p window) |
| 227 | ;; If WINDOW is live, return 1. | 226 | ;; If WINDOW is live, return 1. |
| @@ -277,7 +276,7 @@ FRAME. | |||
| 277 | This function performs a pre-order, depth-first traversal of the | 276 | This function performs a pre-order, depth-first traversal of the |
| 278 | window tree. If PROC changes the window tree, the result is | 277 | window tree. If PROC changes the window tree, the result is |
| 279 | unpredictable." | 278 | unpredictable." |
| 280 | (let ((walk-window-tree-frame (normalize-live-frame frame))) | 279 | (let ((walk-window-tree-frame (window-normalize-frame frame))) |
| 281 | (walk-window-tree-1 | 280 | (walk-window-tree-1 |
| 282 | proc (frame-root-window walk-window-tree-frame) any))) | 281 | proc (frame-root-window walk-window-tree-frame) any))) |
| 283 | 282 | ||
| @@ -290,7 +289,7 @@ on all live and internal subwindows of WINDOW. | |||
| 290 | This function performs a pre-order, depth-first traversal of the | 289 | This function performs a pre-order, depth-first traversal of the |
| 291 | window tree rooted at WINDOW. If PROC changes that window tree, | 290 | window tree rooted at WINDOW. If PROC changes that window tree, |
| 292 | the result is unpredictable." | 291 | the result is unpredictable." |
| 293 | (setq window (normalize-any-window window)) | 292 | (setq window (window-normalize-any-window window)) |
| 294 | (walk-window-tree-1 proc window any t)) | 293 | (walk-window-tree-1 proc window any t)) |
| 295 | 294 | ||
| 296 | (defun windows-with-parameter (parameter &optional value frame any values) | 295 | (defun windows-with-parameter (parameter &optional value frame any values) |
| @@ -336,14 +335,14 @@ too." | |||
| 336 | "Return root of atomic window WINDOW is a part of. | 335 | "Return root of atomic window WINDOW is a part of. |
| 337 | WINDOW can be any window and defaults to the selected one. | 336 | WINDOW can be any window and defaults to the selected one. |
| 338 | Return nil if WINDOW is not part of a atomic window." | 337 | Return nil if WINDOW is not part of a atomic window." |
| 339 | (setq window (normalize-any-window window)) | 338 | (setq window (window-normalize-any-window window)) |
| 340 | (let (root) | 339 | (let (root) |
| 341 | (while (and window (window-parameter window 'window-atom)) | 340 | (while (and window (window-parameter window 'window-atom)) |
| 342 | (setq root window) | 341 | (setq root window) |
| 343 | (setq window (window-parent window))) | 342 | (setq window (window-parent window))) |
| 344 | root)) | 343 | root)) |
| 345 | 344 | ||
| 346 | (defun make-window-atom (window) | 345 | (defun window-make-atom (window) |
| 347 | "Make WINDOW an atomic window. | 346 | "Make WINDOW an atomic window. |
| 348 | WINDOW must be an internal window. Return WINDOW." | 347 | WINDOW must be an internal window. Return WINDOW." |
| 349 | (if (not (window-child window)) | 348 | (if (not (window-child window)) |
| @@ -548,7 +547,7 @@ windows may get as small as `window-safe-min-height' lines and | |||
| 548 | `window-safe-min-width' columns. IGNORE a window means ignore | 547 | `window-safe-min-width' columns. IGNORE a window means ignore |
| 549 | restrictions for that window only." | 548 | restrictions for that window only." |
| 550 | (window-min-size-1 | 549 | (window-min-size-1 |
| 551 | (normalize-any-window window) horizontal ignore)) | 550 | (window-normalize-any-window window) horizontal ignore)) |
| 552 | 551 | ||
| 553 | (defun window-min-size-1 (window horizontal ignore) | 552 | (defun window-min-size-1 (window horizontal ignore) |
| 554 | "Internal function of `window-min-size'." | 553 | "Internal function of `window-min-size'." |
| @@ -641,7 +640,7 @@ imposed by fixed size windows, `window-min-height' or | |||
| 641 | windows may get as small as `window-safe-min-height' lines and | 640 | windows may get as small as `window-safe-min-height' lines and |
| 642 | `window-safe-min-width' columns. IGNORE any window means ignore | 641 | `window-safe-min-width' columns. IGNORE any window means ignore |
| 643 | restrictions for that window only." | 642 | restrictions for that window only." |
| 644 | (setq window (normalize-any-window window)) | 643 | (setq window (window-normalize-any-window window)) |
| 645 | (cond | 644 | (cond |
| 646 | ((< delta 0) | 645 | ((< delta 0) |
| 647 | (max (- (window-min-size window horizontal ignore) | 646 | (max (- (window-min-size window horizontal ignore) |
| @@ -659,7 +658,7 @@ restrictions for that window only." | |||
| 659 | "Return t if WINDOW can be resized by DELTA lines. | 658 | "Return t if WINDOW can be resized by DELTA lines. |
| 660 | For the meaning of the arguments of this function see the | 659 | For the meaning of the arguments of this function see the |
| 661 | doc-string of `window-sizable'." | 660 | doc-string of `window-sizable'." |
| 662 | (setq window (normalize-any-window window)) | 661 | (setq window (window-normalize-any-window window)) |
| 663 | (if (> delta 0) | 662 | (if (> delta 0) |
| 664 | (>= (window-sizable window delta horizontal ignore) delta) | 663 | (>= (window-sizable window delta horizontal ignore) delta) |
| 665 | (<= (window-sizable window delta horizontal ignore) delta))) | 664 | (<= (window-sizable window delta horizontal ignore) delta))) |
| @@ -707,7 +706,7 @@ If this function returns nil, this does not necessarily mean that | |||
| 707 | WINDOW can be resized in the desired direction. The functions | 706 | WINDOW can be resized in the desired direction. The functions |
| 708 | `window-resizable' and `window-resizable-p' will tell that." | 707 | `window-resizable' and `window-resizable-p' will tell that." |
| 709 | (window-size-fixed-1 | 708 | (window-size-fixed-1 |
| 710 | (normalize-any-window window) horizontal)) | 709 | (window-normalize-any-window window) horizontal)) |
| 711 | 710 | ||
| 712 | (defun window-min-delta-1 (window delta &optional horizontal ignore trail noup) | 711 | (defun window-min-delta-1 (window delta &optional horizontal ignore trail noup) |
| 713 | "Internal function for `window-min-delta'." | 712 | "Internal function for `window-min-delta'." |
| @@ -773,7 +772,7 @@ tree but try to enlarge windows within WINDOW's combination only. | |||
| 773 | Optional argument NODOWN non-nil means don't check whether WINDOW | 772 | Optional argument NODOWN non-nil means don't check whether WINDOW |
| 774 | itself \(and its subwindows) can be shrunk; check only whether at | 773 | itself \(and its subwindows) can be shrunk; check only whether at |
| 775 | least one other windows can be enlarged appropriately." | 774 | least one other windows can be enlarged appropriately." |
| 776 | (setq window (normalize-any-window window)) | 775 | (setq window (window-normalize-any-window window)) |
| 777 | (let ((size (window-total-size window horizontal)) | 776 | (let ((size (window-total-size window horizontal)) |
| 778 | (minimum (window-min-size window horizontal ignore))) | 777 | (minimum (window-min-size window horizontal ignore))) |
| 779 | (cond | 778 | (cond |
| @@ -855,7 +854,7 @@ WINDOW's combination. | |||
| 855 | Optional argument NODOWN non-nil means do not check whether | 854 | Optional argument NODOWN non-nil means do not check whether |
| 856 | WINDOW itself \(and its subwindows) can be enlarged; check only | 855 | WINDOW itself \(and its subwindows) can be enlarged; check only |
| 857 | whether other windows can be shrunk appropriately." | 856 | whether other windows can be shrunk appropriately." |
| 858 | (setq window (normalize-any-window window)) | 857 | (setq window (window-normalize-any-window window)) |
| 859 | (if (and (not (window-size-ignore window ignore)) | 858 | (if (and (not (window-size-ignore window ignore)) |
| 860 | (not nodown) (window-size-fixed-p window horizontal)) | 859 | (not nodown) (window-size-fixed-p window horizontal)) |
| 861 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed | 860 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed |
| @@ -899,7 +898,7 @@ within WINDOW's combination. | |||
| 899 | 898 | ||
| 900 | Optional argument NODOWN non-nil means don't check whether WINDOW | 899 | Optional argument NODOWN non-nil means don't check whether WINDOW |
| 901 | and its subwindows can be resized." | 900 | and its subwindows can be resized." |
| 902 | (setq window (normalize-any-window window)) | 901 | (setq window (window-normalize-any-window window)) |
| 903 | (cond | 902 | (cond |
| 904 | ((< delta 0) | 903 | ((< delta 0) |
| 905 | (max (- (window-min-delta window horizontal ignore trail noup nodown)) | 904 | (max (- (window-min-delta window horizontal ignore trail noup nodown)) |
| @@ -913,7 +912,7 @@ and its subwindows can be resized." | |||
| 913 | "Return t if WINDOW can be resized vertically by DELTA lines. | 912 | "Return t if WINDOW can be resized vertically by DELTA lines. |
| 914 | For the meaning of the arguments of this function see the | 913 | For the meaning of the arguments of this function see the |
| 915 | doc-string of `window-resizable'." | 914 | doc-string of `window-resizable'." |
| 916 | (setq window (normalize-any-window window)) | 915 | (setq window (window-normalize-any-window window)) |
| 917 | (if (> delta 0) | 916 | (if (> delta 0) |
| 918 | (>= (window-resizable window delta horizontal ignore trail noup nodown) | 917 | (>= (window-resizable window delta horizontal ignore trail noup nodown) |
| 919 | delta) | 918 | delta) |
| @@ -942,7 +941,7 @@ More precisely, return t if and only if the total height of | |||
| 942 | WINDOW equals the total height of the root window of WINDOW's | 941 | WINDOW equals the total height of the root window of WINDOW's |
| 943 | frame. WINDOW can be any window and defaults to the selected | 942 | frame. WINDOW can be any window and defaults to the selected |
| 944 | one." | 943 | one." |
| 945 | (setq window (normalize-any-window window)) | 944 | (setq window (window-normalize-any-window window)) |
| 946 | (= (window-total-size window) | 945 | (= (window-total-size window) |
| 947 | (window-total-size (frame-root-window window)))) | 946 | (window-total-size (frame-root-window window)))) |
| 948 | 947 | ||
| @@ -961,7 +960,7 @@ otherwise." | |||
| 961 | More precisely, return t if and only if the total width of WINDOW | 960 | More precisely, return t if and only if the total width of WINDOW |
| 962 | equals the total width of the root window of WINDOW's frame. | 961 | equals the total width of the root window of WINDOW's frame. |
| 963 | WINDOW can be any window and defaults to the selected one." | 962 | WINDOW can be any window and defaults to the selected one." |
| 964 | (setq window (normalize-any-window window)) | 963 | (setq window (window-normalize-any-window window)) |
| 965 | (= (window-total-size window t) | 964 | (= (window-total-size window t) |
| 966 | (window-total-size (frame-root-window window) t))) | 965 | (window-total-size (frame-root-window window) t))) |
| 967 | 966 | ||
| @@ -1002,7 +1001,7 @@ or nil). | |||
| 1002 | Unlike `window-scroll-bars', this function reports the scroll bar | 1001 | Unlike `window-scroll-bars', this function reports the scroll bar |
| 1003 | type actually used, once frame defaults and `scroll-bar-mode' are | 1002 | type actually used, once frame defaults and `scroll-bar-mode' are |
| 1004 | taken into account." | 1003 | taken into account." |
| 1005 | (setq window (normalize-live-window window)) | 1004 | (setq window (window-normalize-live-window window)) |
| 1006 | (let ((vert (nth 2 (window-scroll-bars window))) | 1005 | (let ((vert (nth 2 (window-scroll-bars window))) |
| 1007 | (hor nil)) | 1006 | (hor nil)) |
| 1008 | (when (or (eq vert t) (eq hor t)) | 1007 | (when (or (eq vert t) (eq hor t)) |
| @@ -1077,7 +1076,7 @@ DIRECTION must be one of `above', `below', `left' or `right'. | |||
| 1077 | WINDOW must be a live window and defaults to the selected one. | 1076 | WINDOW must be a live window and defaults to the selected one. |
| 1078 | IGNORE, when non-nil means a window can be returned even if its | 1077 | IGNORE, when non-nil means a window can be returned even if its |
| 1079 | `no-other-window' parameter is non-nil." | 1078 | `no-other-window' parameter is non-nil." |
| 1080 | (setq window (normalize-live-window window)) | 1079 | (setq window (window-normalize-live-window window)) |
| 1081 | (unless (memq direction '(above below left right)) | 1080 | (unless (memq direction '(above below left right)) |
| 1082 | (error "Wrong direction %s" direction)) | 1081 | (error "Wrong direction %s" direction)) |
| 1083 | (let* ((frame (window-frame window)) | 1082 | (let* ((frame (window-frame window)) |
| @@ -1334,7 +1333,7 @@ non-nil values of ALL-FRAMES have special meanings: | |||
| 1334 | 1333 | ||
| 1335 | Anything else means consider all windows on the selected frame | 1334 | Anything else means consider all windows on the selected frame |
| 1336 | and no others." | 1335 | and no others." |
| 1337 | (let ((buffer (normalize-live-buffer buffer-or-name)) | 1336 | (let ((buffer (window-normalize-buffer buffer-or-name)) |
| 1338 | windows) | 1337 | windows) |
| 1339 | (dolist (window (window-list-1 (selected-window) minibuf all-frames)) | 1338 | (dolist (window (window-list-1 (selected-window) minibuf all-frames)) |
| 1340 | (when (eq (window-buffer window) buffer) | 1339 | (when (eq (window-buffer window) buffer) |
| @@ -1353,7 +1352,7 @@ meaning of this argument." | |||
| 1353 | (length (window-list-1 nil minibuf))) | 1352 | (length (window-list-1 nil minibuf))) |
| 1354 | 1353 | ||
| 1355 | ;;; Resizing windows. | 1354 | ;;; Resizing windows. |
| 1356 | (defun window-resize-reset (&optional frame horizontal) | 1355 | (defun window--resize-reset (&optional frame horizontal) |
| 1357 | "Reset resize values for all windows on FRAME. | 1356 | "Reset resize values for all windows on FRAME. |
| 1358 | FRAME defaults to the selected frame. | 1357 | FRAME defaults to the selected frame. |
| 1359 | 1358 | ||
| @@ -1361,23 +1360,23 @@ This function stores the current value of `window-total-size' applied | |||
| 1361 | with argument HORIZONTAL in the new total size of all windows on | 1360 | 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 | 1361 | FRAME. It also resets the new normal size of each of these |
| 1363 | windows." | 1362 | windows." |
| 1364 | (window-resize-reset-1 | 1363 | (window--resize-reset-1 |
| 1365 | (frame-root-window (normalize-live-frame frame)) horizontal)) | 1364 | (frame-root-window (window-normalize-frame frame)) horizontal)) |
| 1366 | 1365 | ||
| 1367 | (defun window-resize-reset-1 (window horizontal) | 1366 | (defun window--resize-reset-1 (window horizontal) |
| 1368 | "Internal function of `window-resize-reset'." | 1367 | "Internal function of `window--resize-reset'." |
| 1369 | ;; Register old size in the new total size. | 1368 | ;; Register old size in the new total size. |
| 1370 | (set-window-new-total window (window-total-size window horizontal)) | 1369 | (set-window-new-total window (window-total-size window horizontal)) |
| 1371 | ;; Reset new normal size. | 1370 | ;; Reset new normal size. |
| 1372 | (set-window-new-normal window) | 1371 | (set-window-new-normal window) |
| 1373 | (when (window-child window) | 1372 | (when (window-child window) |
| 1374 | (window-resize-reset-1 (window-child window) horizontal)) | 1373 | (window--resize-reset-1 (window-child window) horizontal)) |
| 1375 | (when (window-right window) | 1374 | (when (window-right window) |
| 1376 | (window-resize-reset-1 (window-right window) horizontal))) | 1375 | (window--resize-reset-1 (window-right window) horizontal))) |
| 1377 | 1376 | ||
| 1378 | ;; The following routine is used to manually resize the minibuffer | 1377 | ;; The following routine is used to manually resize the minibuffer |
| 1379 | ;; window and is currently used, for example, by ispell.el. | 1378 | ;; window and is currently used, for example, by ispell.el. |
| 1380 | (defun resize-mini-window (window delta) | 1379 | (defun window--resize-mini-window (window delta) |
| 1381 | "Resize minibuffer window WINDOW by DELTA lines. | 1380 | "Resize minibuffer window WINDOW by DELTA lines. |
| 1382 | If WINDOW cannot be resized by DELTA lines make it as large \(or | 1381 | If WINDOW cannot be resized by DELTA lines make it as large \(or |
| 1383 | as small) as possible but don't signal an error." | 1382 | as small) as possible but don't signal an error." |
| @@ -1396,11 +1395,11 @@ as small) as possible but don't signal an error." | |||
| 1396 | (setq delta min-delta))) | 1395 | (setq delta min-delta))) |
| 1397 | 1396 | ||
| 1398 | ;; Resize now. | 1397 | ;; Resize now. |
| 1399 | (window-resize-reset frame) | 1398 | (window--resize-reset frame) |
| 1400 | ;; Ideally we should be able to resize just the last subwindow of | 1399 | ;; Ideally we should be able to resize just the last subwindow of |
| 1401 | ;; root here. See the comment in `resize-root-window-vertically' | 1400 | ;; root here. See the comment in `resize-root-window-vertically' |
| 1402 | ;; for why we do not do that. | 1401 | ;; for why we do not do that. |
| 1403 | (resize-this-window root (- delta) nil nil t) | 1402 | (window--resize-this-window root (- delta) nil nil t) |
| 1404 | (set-window-new-total window (+ height delta)) | 1403 | (set-window-new-total window (+ height delta)) |
| 1405 | ;; The following routine catches the case where we want to resize | 1404 | ;; The following routine catches the case where we want to resize |
| 1406 | ;; a minibuffer-only frame. | 1405 | ;; a minibuffer-only frame. |
| @@ -1432,17 +1431,17 @@ This function resizes other windows proportionally and never | |||
| 1432 | deletes any windows. If you want to move only the low (right) | 1431 | deletes any windows. If you want to move only the low (right) |
| 1433 | edge of WINDOW consider using `adjust-window-trailing-edge' | 1432 | edge of WINDOW consider using `adjust-window-trailing-edge' |
| 1434 | instead." | 1433 | instead." |
| 1435 | (setq window (normalize-any-window window)) | 1434 | (setq window (window-normalize-any-window window)) |
| 1436 | (let* ((frame (window-frame window)) | 1435 | (let* ((frame (window-frame window)) |
| 1437 | sibling) | 1436 | sibling) |
| 1438 | (cond | 1437 | (cond |
| 1439 | ((eq window (frame-root-window frame)) | 1438 | ((eq window (frame-root-window frame)) |
| 1440 | (error "Cannot resize the root window of a frame")) | 1439 | (error "Cannot resize the root window of a frame")) |
| 1441 | ((window-minibuffer-p window) | 1440 | ((window-minibuffer-p window) |
| 1442 | (resize-mini-window window delta)) | 1441 | (window--resize-mini-window window delta)) |
| 1443 | ((window-resizable-p window delta horizontal ignore) | 1442 | ((window-resizable-p window delta horizontal ignore) |
| 1444 | (window-resize-reset frame horizontal) | 1443 | (window--resize-reset frame horizontal) |
| 1445 | (resize-this-window window delta horizontal ignore t) | 1444 | (window--resize-this-window window delta horizontal ignore t) |
| 1446 | (if (and (not (window-splits window)) | 1445 | (if (and (not (window-splits window)) |
| 1447 | (window-iso-combined-p window horizontal) | 1446 | (window-iso-combined-p window horizontal) |
| 1448 | (setq sibling (or (window-right window) (window-left window))) | 1447 | (setq sibling (or (window-right window) (window-left window))) |
| @@ -1453,7 +1452,7 @@ instead." | |||
| 1453 | (let ((normal-delta | 1452 | (let ((normal-delta |
| 1454 | (/ (float delta) | 1453 | (/ (float delta) |
| 1455 | (window-total-size (window-parent window) horizontal)))) | 1454 | (window-total-size (window-parent window) horizontal)))) |
| 1456 | (resize-this-window sibling (- delta) horizontal nil t) | 1455 | (window--resize-this-window sibling (- delta) horizontal nil t) |
| 1457 | (set-window-new-normal | 1456 | (set-window-new-normal |
| 1458 | window (+ (window-normal-size window horizontal) | 1457 | window (+ (window-normal-size window horizontal) |
| 1459 | normal-delta)) | 1458 | normal-delta)) |
| @@ -1461,16 +1460,16 @@ instead." | |||
| 1461 | sibling (- (window-normal-size sibling horizontal) | 1460 | sibling (- (window-normal-size sibling horizontal) |
| 1462 | normal-delta))) | 1461 | normal-delta))) |
| 1463 | ;; Otherwise, resize all other windows in the same combination. | 1462 | ;; Otherwise, resize all other windows in the same combination. |
| 1464 | (resize-other-windows window delta horizontal ignore)) | 1463 | (window--resize-siblings window delta horizontal ignore)) |
| 1465 | (window-resize-apply frame horizontal)) | 1464 | (window-resize-apply frame horizontal)) |
| 1466 | (t | 1465 | (t |
| 1467 | (error "Cannot resize window %s" window))))) | 1466 | (error "Cannot resize window %s" window))))) |
| 1468 | 1467 | ||
| 1469 | (defsubst resize-subwindows-skip-p (window) | 1468 | (defsubst window--resize-subwindows-skip-p (window) |
| 1470 | "Return non-nil if WINDOW shall be skipped by resizing routines." | 1469 | "Return non-nil if WINDOW shall be skipped by resizing routines." |
| 1471 | (memq (window-new-normal window) '(ignore stuck skip))) | 1470 | (memq (window-new-normal window) '(ignore stuck skip))) |
| 1472 | 1471 | ||
| 1473 | (defun resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta) | 1472 | (defun window--resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta) |
| 1474 | "Set the new normal height of subwindows of window PARENT. | 1473 | "Set the new normal height of subwindows of window PARENT. |
| 1475 | HORIZONTAL non-nil means set the new normal width of these | 1474 | HORIZONTAL non-nil means set the new normal width of these |
| 1476 | windows. WINDOW specifies a subwindow of PARENT that has been | 1475 | windows. WINDOW specifies a subwindow of PARENT that has been |
| @@ -1567,7 +1566,7 @@ PARENT in order to resize WINDOW." | |||
| 1567 | ;; Don't get larger than 1 or smaller than 0. | 1566 | ;; Don't get larger than 1 or smaller than 0. |
| 1568 | (min 1.0 (max (- 1.0 sum) 0.0)))))) | 1567 | (min 1.0 (max (- 1.0 sum) 0.0)))))) |
| 1569 | 1568 | ||
| 1570 | (defun resize-subwindows (parent delta &optional horizontal window ignore trail edge) | 1569 | (defun window--resize-subwindows (parent delta &optional horizontal window ignore trail edge) |
| 1571 | "Resize subwindows of window PARENT vertically by DELTA lines. | 1570 | "Resize subwindows of window PARENT vertically by DELTA lines. |
| 1572 | PARENT must be a vertically combined internal window. | 1571 | PARENT must be a vertically combined internal window. |
| 1573 | 1572 | ||
| @@ -1603,10 +1602,10 @@ already set by this routine." | |||
| 1603 | (setq sub first) | 1602 | (setq sub first) |
| 1604 | (while (and (window-right sub) | 1603 | (while (and (window-right sub) |
| 1605 | (or (and (eq trail 'before) | 1604 | (or (and (eq trail 'before) |
| 1606 | (not (resize-subwindows-skip-p | 1605 | (not (window--resize-subwindows-skip-p |
| 1607 | (window-right sub)))) | 1606 | (window-right sub)))) |
| 1608 | (and (eq trail 'after) | 1607 | (and (eq trail 'after) |
| 1609 | (resize-subwindows-skip-p sub)))) | 1608 | (window--resize-subwindows-skip-p sub)))) |
| 1610 | (setq sub (window-right sub))) | 1609 | (setq sub (window-right sub))) |
| 1611 | sub) | 1610 | sub) |
| 1612 | (if horizontal | 1611 | (if horizontal |
| @@ -1623,7 +1622,8 @@ already set by this routine." | |||
| 1623 | (window-sizable-p sub delta horizontal ignore)) | 1622 | (window-sizable-p sub delta horizontal ignore)) |
| 1624 | ;; Resize only windows adjacent to EDGE. | 1623 | ;; Resize only windows adjacent to EDGE. |
| 1625 | (progn | 1624 | (progn |
| 1626 | (resize-this-window sub delta horizontal ignore t trail edge) | 1625 | (window--resize-this-window |
| 1626 | sub delta horizontal ignore t trail edge) | ||
| 1627 | (if (and window (eq (window-parent sub) parent)) | 1627 | (if (and window (eq (window-parent sub) parent)) |
| 1628 | (progn | 1628 | (progn |
| 1629 | ;; Assign new normal sizes. | 1629 | ;; Assign new normal sizes. |
| @@ -1633,15 +1633,16 @@ already set by this routine." | |||
| 1633 | window (- (window-normal-size window horizontal) | 1633 | window (- (window-normal-size window horizontal) |
| 1634 | (- (window-new-normal sub) | 1634 | (- (window-new-normal sub) |
| 1635 | (window-normal-size sub horizontal))))) | 1635 | (window-normal-size sub horizontal))))) |
| 1636 | (resize-subwindows-normal parent horizontal sub 0 trail delta)) | 1636 | (window--resize-subwindows-normal |
| 1637 | ;; Return 'normalized to notify `resize-other-windows' that | 1637 | parent horizontal sub 0 trail delta)) |
| 1638 | ;; Return 'normalized to notify `window--resize-siblings' that | ||
| 1638 | ;; normal sizes have been already set. | 1639 | ;; normal sizes have been already set. |
| 1639 | 'normalized) | 1640 | 'normalized) |
| 1640 | ;; Resize all windows proportionally. | 1641 | ;; Resize all windows proportionally. |
| 1641 | (setq sub first) | 1642 | (setq sub first) |
| 1642 | (while sub | 1643 | (while sub |
| 1643 | (cond | 1644 | (cond |
| 1644 | ((or (resize-subwindows-skip-p sub) | 1645 | ((or (window--resize-subwindows-skip-p sub) |
| 1645 | ;; Ignore windows to skip and fixed-size subwindows - in | 1646 | ;; Ignore windows to skip and fixed-size subwindows - in |
| 1646 | ;; the latter case make it a window to skip. | 1647 | ;; the latter case make it a window to skip. |
| 1647 | (and (not ignore) | 1648 | (and (not ignore) |
| @@ -1738,11 +1739,11 @@ already set by this routine." | |||
| 1738 | (unless (and (zerop delta) (not trail)) | 1739 | (unless (and (zerop delta) (not trail)) |
| 1739 | ;; For the TRAIL non-nil case we have to resize SUB | 1740 | ;; For the TRAIL non-nil case we have to resize SUB |
| 1740 | ;; recursively even if it's size does not change. | 1741 | ;; recursively even if it's size does not change. |
| 1741 | (resize-this-window | 1742 | (window--resize-this-window |
| 1742 | sub delta horizontal ignore nil trail edge)))) | 1743 | sub delta horizontal ignore nil trail edge)))) |
| 1743 | (setq sub (window-right sub))))))) | 1744 | (setq sub (window-right sub))))))) |
| 1744 | 1745 | ||
| 1745 | (defun resize-other-windows (window delta &optional horizontal ignore trail edge) | 1746 | (defun window--resize-siblings (window delta &optional horizontal ignore trail edge) |
| 1746 | "Resize other windows when WINDOW is resized vertically by DELTA lines. | 1747 | "Resize other windows when WINDOW is resized vertically by DELTA lines. |
| 1747 | Optional argument HORIZONTAL non-nil means resize other windows | 1748 | Optional argument HORIZONTAL non-nil means resize other windows |
| 1748 | when WINDOW is resized horizontally by DELTA columns. WINDOW | 1749 | when WINDOW is resized horizontally by DELTA columns. WINDOW |
| @@ -1814,17 +1815,19 @@ preferably only resize windows adjacent to EDGE." | |||
| 1814 | (if (zerop this-delta) | 1815 | (if (zerop this-delta) |
| 1815 | ;; We haven't got anything from WINDOW's siblings but we | 1816 | ;; We haven't got anything from WINDOW's siblings but we |
| 1816 | ;; must update the normal sizes to respect other-delta. | 1817 | ;; must update the normal sizes to respect other-delta. |
| 1817 | (resize-subwindows-normal | 1818 | (window--resize-subwindows-normal |
| 1818 | parent horizontal window this-delta trail other-delta) | 1819 | parent horizontal window this-delta trail other-delta) |
| 1819 | ;; We did get something from WINDOW's siblings which means | 1820 | ;; We did get something from WINDOW's siblings which means |
| 1820 | ;; we have to resize their subwindows. | 1821 | ;; we have to resize their subwindows. |
| 1821 | (unless (eq (resize-subwindows parent (- this-delta) horizontal | 1822 | (unless (eq (window--resize-subwindows |
| 1822 | window ignore trail edge) | 1823 | parent (- this-delta) horizontal |
| 1823 | ;; `resize-subwindows' returning 'normalized, | 1824 | window ignore trail edge) |
| 1824 | ;; means it has set the normal sizes already. | 1825 | ;; If `window--resize-subwindows' returns |
| 1826 | ;; 'normalized, this means it has set the | ||
| 1827 | ;; normal sizes already. | ||
| 1825 | 'normalized) | 1828 | 'normalized) |
| 1826 | ;; Set the normal sizes. | 1829 | ;; Set the normal sizes. |
| 1827 | (resize-subwindows-normal | 1830 | (window--resize-subwindows-normal |
| 1828 | parent horizontal window this-delta trail other-delta)) | 1831 | parent horizontal window this-delta trail other-delta)) |
| 1829 | ;; Set DELTA to what we still have to get from ancestor | 1832 | ;; Set DELTA to what we still have to get from ancestor |
| 1830 | ;; windows. | 1833 | ;; windows. |
| @@ -1835,14 +1838,15 @@ preferably only resize windows adjacent to EDGE." | |||
| 1835 | (set-window-new-total parent delta 'add) | 1838 | (set-window-new-total parent delta 'add) |
| 1836 | (while sub | 1839 | (while sub |
| 1837 | (unless (eq sub window) | 1840 | (unless (eq sub window) |
| 1838 | (resize-this-window sub delta horizontal ignore t)) | 1841 | (window--resize-this-window sub delta horizontal ignore t)) |
| 1839 | (setq sub (window-right sub)))) | 1842 | (setq sub (window-right sub)))) |
| 1840 | 1843 | ||
| 1841 | (unless (zerop delta) | 1844 | (unless (zerop delta) |
| 1842 | ;; "Go up." | 1845 | ;; "Go up." |
| 1843 | (resize-other-windows parent delta horizontal ignore trail edge))))) | 1846 | (window--resize-siblings |
| 1847 | parent delta horizontal ignore trail edge))))) | ||
| 1844 | 1848 | ||
| 1845 | (defun resize-this-window (window delta &optional horizontal ignore add trail edge) | 1849 | (defun window--resize-this-window (window delta &optional horizontal ignore add trail edge) |
| 1846 | "Resize WINDOW vertically by DELTA lines. | 1850 | "Resize WINDOW vertically by DELTA lines. |
| 1847 | Optional argument HORIZONTAL non-nil means resize WINDOW | 1851 | Optional argument HORIZONTAL non-nil means resize WINDOW |
| 1848 | horizontally by DELTA columns. | 1852 | horizontally by DELTA columns. |
| @@ -1879,14 +1883,16 @@ actually take effect." | |||
| 1879 | ((window-iso-combined-p sub horizontal) | 1883 | ((window-iso-combined-p sub horizontal) |
| 1880 | ;; In an iso-combination resize subwindows according to their | 1884 | ;; In an iso-combination resize subwindows according to their |
| 1881 | ;; normal sizes. | 1885 | ;; normal sizes. |
| 1882 | (resize-subwindows window delta horizontal nil ignore trail edge)) | 1886 | (window--resize-subwindows |
| 1887 | window delta horizontal nil ignore trail edge)) | ||
| 1883 | ;; In an ortho-combination resize each subwindow by DELTA. | 1888 | ;; In an ortho-combination resize each subwindow by DELTA. |
| 1884 | (t | 1889 | (t |
| 1885 | (while sub | 1890 | (while sub |
| 1886 | (resize-this-window sub delta horizontal ignore t trail edge) | 1891 | (window--resize-this-window |
| 1892 | sub delta horizontal ignore t trail edge) | ||
| 1887 | (setq sub (window-right sub))))))) | 1893 | (setq sub (window-right sub))))))) |
| 1888 | 1894 | ||
| 1889 | (defun resize-root-window (window delta horizontal ignore) | 1895 | (defun window--resize-root-window (window delta horizontal ignore) |
| 1890 | "Resize root window WINDOW vertically by DELTA lines. | 1896 | "Resize root window WINDOW vertically by DELTA lines. |
| 1891 | HORIZONTAL non-nil means resize root window WINDOW horizontally | 1897 | HORIZONTAL non-nil means resize root window WINDOW horizontally |
| 1892 | by DELTA columns. | 1898 | by DELTA columns. |
| @@ -1898,10 +1904,10 @@ This function is only called by the frame resizing routines. It | |||
| 1898 | resizes windows proportionally and never deletes any windows." | 1904 | resizes windows proportionally and never deletes any windows." |
| 1899 | (when (and (windowp window) (numberp delta) | 1905 | (when (and (windowp window) (numberp delta) |
| 1900 | (window-sizable-p window delta horizontal ignore)) | 1906 | (window-sizable-p window delta horizontal ignore)) |
| 1901 | (window-resize-reset (window-frame window) horizontal) | 1907 | (window--resize-reset (window-frame window) horizontal) |
| 1902 | (resize-this-window window delta horizontal ignore t))) | 1908 | (window--resize-this-window window delta horizontal ignore t))) |
| 1903 | 1909 | ||
| 1904 | (defun resize-root-window-vertically (window delta) | 1910 | (defun window--resize-root-window-vertically (window delta) |
| 1905 | "Resize root window WINDOW vertically by DELTA lines. | 1911 | "Resize root window WINDOW vertically by DELTA lines. |
| 1906 | If DELTA is less than zero and we can't shrink WINDOW by DELTA | 1912 | If DELTA is less than zero and we can't shrink WINDOW by DELTA |
| 1907 | lines, shrink it as much as possible. If DELTA is greater than | 1913 | lines, shrink it as much as possible. If DELTA is greater than |
| @@ -1922,7 +1928,7 @@ any windows." | |||
| 1922 | (unless (window-sizable window delta) | 1928 | (unless (window-sizable window delta) |
| 1923 | (setq ignore t)))) | 1929 | (setq ignore t)))) |
| 1924 | 1930 | ||
| 1925 | (window-resize-reset (window-frame window)) | 1931 | (window--resize-reset (window-frame window)) |
| 1926 | ;; Ideally, we would resize just the last window in a combination | 1932 | ;; Ideally, we would resize just the last window in a combination |
| 1927 | ;; but that's not feasible for the following reason: If we grow | 1933 | ;; but that's not feasible for the following reason: If we grow |
| 1928 | ;; the minibuffer window and the last window cannot be shrunk any | 1934 | ;; the minibuffer window and the last window cannot be shrunk any |
| @@ -1932,7 +1938,7 @@ any windows." | |||
| 1932 | ;; So, in practice, we'd need a history variable to record how to | 1938 | ;; So, in practice, we'd need a history variable to record how to |
| 1933 | ;; proceed. But I'm not sure how such a variable could work with | 1939 | ;; proceed. But I'm not sure how such a variable could work with |
| 1934 | ;; repeated minibuffer window growing steps. | 1940 | ;; repeated minibuffer window growing steps. |
| 1935 | (resize-this-window window delta nil ignore t) | 1941 | (window--resize-this-window window delta nil ignore t) |
| 1936 | delta))) | 1942 | delta))) |
| 1937 | 1943 | ||
| 1938 | (defun adjust-window-trailing-edge (window delta &optional horizontal) | 1944 | (defun adjust-window-trailing-edge (window delta &optional horizontal) |
| @@ -1944,7 +1950,7 @@ If DELTA is greater zero, then move the edge downwards or to the | |||
| 1944 | right. If DELTA is less than zero, move the edge upwards or to | 1950 | right. If DELTA is less than zero, move the edge upwards or to |
| 1945 | the left. If the edge can't be moved by DELTA lines or columns, | 1951 | the left. If the edge can't be moved by DELTA lines or columns, |
| 1946 | move it as far as possible in the desired direction." | 1952 | move it as far as possible in the desired direction." |
| 1947 | (setq window (normalize-any-window window)) | 1953 | (setq window (window-normalize-any-window window)) |
| 1948 | (let ((frame (window-frame window)) | 1954 | (let ((frame (window-frame window)) |
| 1949 | (right window) | 1955 | (right window) |
| 1950 | left this-delta min-delta max-delta failed) | 1956 | left this-delta min-delta max-delta failed) |
| @@ -1955,7 +1961,7 @@ move it as far as possible in the desired direction." | |||
| 1955 | (cond | 1961 | (cond |
| 1956 | ((and (not right) (not horizontal) (not resize-mini-windows) | 1962 | ((and (not right) (not horizontal) (not resize-mini-windows) |
| 1957 | (eq (window-frame (minibuffer-window frame)) frame)) | 1963 | (eq (window-frame (minibuffer-window frame)) frame)) |
| 1958 | (resize-mini-window (minibuffer-window frame) (- delta))) | 1964 | (window--resize-mini-window (minibuffer-window frame) (- delta))) |
| 1959 | ((or (not (setq left right)) (not (setq right (window-right right)))) | 1965 | ((or (not (setq left right)) (not (setq right (window-right right)))) |
| 1960 | (if horizontal | 1966 | (if horizontal |
| 1961 | (error "No window on the right of this one") | 1967 | (error "No window on the right of this one") |
| @@ -2000,17 +2006,17 @@ move it as far as possible in the desired direction." | |||
| 2000 | (setq delta (min max-delta (- min-delta)))) | 2006 | (setq delta (min max-delta (- min-delta)))) |
| 2001 | (unless (zerop delta) | 2007 | (unless (zerop delta) |
| 2002 | ;; Start resizing. | 2008 | ;; Start resizing. |
| 2003 | (window-resize-reset frame horizontal) | 2009 | (window--resize-reset frame horizontal) |
| 2004 | ;; Try to enlarge LEFT first. | 2010 | ;; Try to enlarge LEFT first. |
| 2005 | (setq this-delta (window-resizable left delta horizontal)) | 2011 | (setq this-delta (window-resizable left delta horizontal)) |
| 2006 | (unless (zerop this-delta) | 2012 | (unless (zerop this-delta) |
| 2007 | (resize-this-window | 2013 | (window--resize-this-window |
| 2008 | left this-delta horizontal nil t 'before | 2014 | left this-delta horizontal nil t 'before |
| 2009 | (if horizontal | 2015 | (if horizontal |
| 2010 | (+ (window-left-column left) (window-total-size left t)) | 2016 | (+ (window-left-column left) (window-total-size left t)) |
| 2011 | (+ (window-top-line left) (window-total-size left))))) | 2017 | (+ (window-top-line left) (window-total-size left))))) |
| 2012 | ;; Shrink windows on right of LEFT. | 2018 | ;; Shrink windows on right of LEFT. |
| 2013 | (resize-other-windows | 2019 | (window--resize-siblings |
| 2014 | left delta horizontal nil 'after | 2020 | left delta horizontal nil 'after |
| 2015 | (if horizontal | 2021 | (if horizontal |
| 2016 | (window-left-column right) | 2022 | (window-left-column right) |
| @@ -2023,17 +2029,17 @@ move it as far as possible in the desired direction." | |||
| 2023 | (setq delta (max (- max-delta) min-delta))) | 2029 | (setq delta (max (- max-delta) min-delta))) |
| 2024 | (unless (zerop delta) | 2030 | (unless (zerop delta) |
| 2025 | ;; Start resizing. | 2031 | ;; Start resizing. |
| 2026 | (window-resize-reset frame horizontal) | 2032 | (window--resize-reset frame horizontal) |
| 2027 | ;; Try to enlarge RIGHT. | 2033 | ;; Try to enlarge RIGHT. |
| 2028 | (setq this-delta (window-resizable right (- delta) horizontal)) | 2034 | (setq this-delta (window-resizable right (- delta) horizontal)) |
| 2029 | (unless (zerop this-delta) | 2035 | (unless (zerop this-delta) |
| 2030 | (resize-this-window | 2036 | (window--resize-this-window |
| 2031 | right this-delta horizontal nil t 'after | 2037 | right this-delta horizontal nil t 'after |
| 2032 | (if horizontal | 2038 | (if horizontal |
| 2033 | (window-left-column right) | 2039 | (window-left-column right) |
| 2034 | (window-top-line right)))) | 2040 | (window-top-line right)))) |
| 2035 | ;; Shrink windows on left of RIGHT. | 2041 | ;; Shrink windows on left of RIGHT. |
| 2036 | (resize-other-windows | 2042 | (window--resize-siblings |
| 2037 | right (- delta) horizontal nil 'before | 2043 | right (- delta) horizontal nil 'before |
| 2038 | (if horizontal | 2044 | (if horizontal |
| 2039 | (+ (window-left-column left) (window-total-size left t)) | 2045 | (+ (window-left-column left) (window-total-size left t)) |
| @@ -2091,7 +2097,7 @@ Return nil." | |||
| 2091 | Make WINDOW as large as possible without deleting any windows. | 2097 | Make WINDOW as large as possible without deleting any windows. |
| 2092 | WINDOW can be any window and defaults to the selected window." | 2098 | WINDOW can be any window and defaults to the selected window." |
| 2093 | (interactive) | 2099 | (interactive) |
| 2094 | (setq window (normalize-any-window window)) | 2100 | (setq window (window-normalize-any-window window)) |
| 2095 | (window-resize window (window-max-delta window)) | 2101 | (window-resize window (window-max-delta window)) |
| 2096 | (window-resize window (window-max-delta window t) t)) | 2102 | (window-resize window (window-max-delta window t) t)) |
| 2097 | 2103 | ||
| @@ -2100,7 +2106,7 @@ WINDOW can be any window and defaults to the selected window." | |||
| 2100 | Make WINDOW as small as possible without deleting any windows. | 2106 | Make WINDOW as small as possible without deleting any windows. |
| 2101 | WINDOW can be any window and defaults to the selected window." | 2107 | WINDOW can be any window and defaults to the selected window." |
| 2102 | (interactive) | 2108 | (interactive) |
| 2103 | (setq window (normalize-any-window window)) | 2109 | (setq window (window-normalize-any-window window)) |
| 2104 | (window-resize window (- (window-min-delta window))) | 2110 | (window-resize window (- (window-min-delta window))) |
| 2105 | (window-resize window (- (window-min-delta window t)) t)) | 2111 | (window-resize window (- (window-min-delta window t)) t)) |
| 2106 | 2112 | ||
| @@ -2146,7 +2152,7 @@ and the rest of the elements are the subwindows in the split. | |||
| 2146 | Each of the subwindows may again be a window or a list | 2152 | Each of the subwindows may again be a window or a list |
| 2147 | representing a window split, and so on. EDGES is a list \(LEFT | 2153 | representing a window split, and so on. EDGES is a list \(LEFT |
| 2148 | TOP RIGHT BOTTOM) as returned by `window-edges'." | 2154 | TOP RIGHT BOTTOM) as returned by `window-edges'." |
| 2149 | (setq frame (normalize-live-frame frame)) | 2155 | (setq frame (window-normalize-frame frame)) |
| 2150 | (window-tree-1 (frame-root-window frame) t)) | 2156 | (window-tree-1 (frame-root-window frame) t)) |
| 2151 | 2157 | ||
| 2152 | (defun other-window (count &optional all-frames) | 2158 | (defun other-window (count &optional all-frames) |
| @@ -2278,7 +2284,7 @@ variable are `switch-to-prev-buffer', `delete-windows-on', | |||
| 2278 | "Return t if WINDOW can be safely deleted from its frame. | 2284 | "Return t if WINDOW can be safely deleted from its frame. |
| 2279 | Return `frame' if deleting WINDOW should delete its frame | 2285 | Return `frame' if deleting WINDOW should delete its frame |
| 2280 | instead." | 2286 | instead." |
| 2281 | (setq window (normalize-any-window window)) | 2287 | (setq window (window-normalize-any-window window)) |
| 2282 | (unless ignore-window-parameters | 2288 | (unless ignore-window-parameters |
| 2283 | ;; Handle atomicity. | 2289 | ;; Handle atomicity. |
| 2284 | (when (window-parameter window 'window-atom) | 2290 | (when (window-parameter window 'window-atom) |
| @@ -2336,7 +2342,7 @@ Otherwise, if WINDOW is part of an atomic window, call | |||
| 2336 | argument. If WINDOW is the only window on its frame or the last | 2342 | argument. If WINDOW is the only window on its frame or the last |
| 2337 | non-side window, signal an error." | 2343 | non-side window, signal an error." |
| 2338 | (interactive) | 2344 | (interactive) |
| 2339 | (setq window (normalize-any-window window)) | 2345 | (setq window (window-normalize-any-window window)) |
| 2340 | (let* ((frame (window-frame window)) | 2346 | (let* ((frame (window-frame window)) |
| 2341 | (function (window-parameter window 'delete-window)) | 2347 | (function (window-parameter window 'delete-window)) |
| 2342 | (parent (window-parent window)) | 2348 | (parent (window-parent window)) |
| @@ -2371,21 +2377,21 @@ non-side window, signal an error." | |||
| 2371 | ;; Emacs 23 preferably gives WINDOW's space to its left | 2377 | ;; Emacs 23 preferably gives WINDOW's space to its left |
| 2372 | ;; sibling. | 2378 | ;; sibling. |
| 2373 | (sibling (or (window-left window) (window-right window)))) | 2379 | (sibling (or (window-left window) (window-right window)))) |
| 2374 | (window-resize-reset frame horizontal) | 2380 | (window--resize-reset frame horizontal) |
| 2375 | (cond | 2381 | (cond |
| 2376 | ((and (not (window-splits window)) | 2382 | ((and (not (window-splits window)) |
| 2377 | sibling (window-sizable-p sibling size)) | 2383 | sibling (window-sizable-p sibling size)) |
| 2378 | ;; Resize WINDOW's sibling. | 2384 | ;; Resize WINDOW's sibling. |
| 2379 | (resize-this-window sibling size horizontal nil t) | 2385 | (window--resize-this-window sibling size horizontal nil t) |
| 2380 | (set-window-new-normal | 2386 | (set-window-new-normal |
| 2381 | sibling (+ (window-normal-size sibling horizontal) | 2387 | sibling (+ (window-normal-size sibling horizontal) |
| 2382 | (window-normal-size window horizontal)))) | 2388 | (window-normal-size window horizontal)))) |
| 2383 | ((window-resizable-p window (- size) horizontal nil nil nil t) | 2389 | ((window-resizable-p window (- size) horizontal nil nil nil t) |
| 2384 | ;; Can do without resizing fixed-size windows. | 2390 | ;; Can do without resizing fixed-size windows. |
| 2385 | (resize-other-windows window (- size) horizontal)) | 2391 | (window--resize-siblings window (- size) horizontal)) |
| 2386 | (t | 2392 | (t |
| 2387 | ;; Can't do without resizing fixed-size windows. | 2393 | ;; Can't do without resizing fixed-size windows. |
| 2388 | (resize-other-windows window (- size) horizontal t))) | 2394 | (window--resize-siblings window (- size) horizontal t))) |
| 2389 | ;; Actually delete WINDOW. | 2395 | ;; Actually delete WINDOW. |
| 2390 | (delete-window-internal window) | 2396 | (delete-window-internal window) |
| 2391 | (when (and frame-selected | 2397 | (when (and frame-selected |
| @@ -2417,7 +2423,7 @@ WINDOW is a non-side window, make WINDOW the only non-side window | |||
| 2417 | on the frame. Side windows are not deleted. If WINDOW is a side | 2423 | on the frame. Side windows are not deleted. If WINDOW is a side |
| 2418 | window signal an error." | 2424 | window signal an error." |
| 2419 | (interactive) | 2425 | (interactive) |
| 2420 | (setq window (normalize-any-window window)) | 2426 | (setq window (window-normalize-any-window window)) |
| 2421 | (let* ((frame (window-frame window)) | 2427 | (let* ((frame (window-frame window)) |
| 2422 | (function (window-parameter window 'delete-other-windows)) | 2428 | (function (window-parameter window 'delete-other-windows)) |
| 2423 | (window-side (window-parameter window 'window-side)) | 2429 | (window-side (window-parameter window 'window-side)) |
| @@ -2499,7 +2505,7 @@ This may be a useful alternative binding for \\[delete-other-windows] | |||
| 2499 | (defun record-window-buffer (&optional window) | 2505 | (defun record-window-buffer (&optional window) |
| 2500 | "Record WINDOW's buffer. | 2506 | "Record WINDOW's buffer. |
| 2501 | WINDOW must be a live window and defaults to the selected one." | 2507 | WINDOW must be a live window and defaults to the selected one." |
| 2502 | (let* ((window (normalize-live-window window)) | 2508 | (let* ((window (window-normalize-live-window window)) |
| 2503 | (buffer (window-buffer window)) | 2509 | (buffer (window-buffer window)) |
| 2504 | (entry (assq buffer (window-prev-buffers window)))) | 2510 | (entry (assq buffer (window-prev-buffers window)))) |
| 2505 | ;; Reset WINDOW's next buffers. If needed, they are resurrected by | 2511 | ;; Reset WINDOW's next buffers. If needed, they are resurrected by |
| @@ -2535,7 +2541,7 @@ WINDOW must be a live window and defaults to the selected one." | |||
| 2535 | WINDOW must be a live window and defaults to the selected one. | 2541 | WINDOW must be a live window and defaults to the selected one. |
| 2536 | BUFFER must be a live buffer and defaults to the buffer of | 2542 | BUFFER must be a live buffer and defaults to the buffer of |
| 2537 | WINDOW." | 2543 | WINDOW." |
| 2538 | (let* ((window (normalize-live-window window)) | 2544 | (let* ((window (window-normalize-live-window window)) |
| 2539 | (buffer (or buffer (window-buffer window)))) | 2545 | (buffer (or buffer (window-buffer window)))) |
| 2540 | (set-window-prev-buffers | 2546 | (set-window-prev-buffers |
| 2541 | window (assq-delete-all buffer (window-prev-buffers window))) | 2547 | window (assq-delete-all buffer (window-prev-buffers window))) |
| @@ -2570,7 +2576,7 @@ Optional argument BURY-OR-KILL non-nil means the buffer currently | |||
| 2570 | shown in WINDOW is about to be buried or killed and consequently | 2576 | shown in WINDOW is about to be buried or killed and consequently |
| 2571 | shall not be switched to in future invocations of this command." | 2577 | shall not be switched to in future invocations of this command." |
| 2572 | (interactive) | 2578 | (interactive) |
| 2573 | (let* ((window (normalize-live-window window)) | 2579 | (let* ((window (window-normalize-live-window window)) |
| 2574 | (old-buffer (window-buffer window)) | 2580 | (old-buffer (window-buffer window)) |
| 2575 | ;; Save this since it's destroyed by `set-window-buffer'. | 2581 | ;; Save this since it's destroyed by `set-window-buffer'. |
| 2576 | (next-buffers (window-next-buffers window)) | 2582 | (next-buffers (window-next-buffers window)) |
| @@ -2672,7 +2678,7 @@ shall not be switched to in future invocations of this command." | |||
| 2672 | "In WINDOW switch to next buffer. | 2678 | "In WINDOW switch to next buffer. |
| 2673 | WINDOW must be a live window and defaults to the selected one." | 2679 | WINDOW must be a live window and defaults to the selected one." |
| 2674 | (interactive) | 2680 | (interactive) |
| 2675 | (let* ((window (normalize-live-window window)) | 2681 | (let* ((window (window-normalize-live-window window)) |
| 2676 | (old-buffer (window-buffer window)) | 2682 | (old-buffer (window-buffer window)) |
| 2677 | (next-buffers (window-next-buffers window)) | 2683 | (next-buffers (window-next-buffers window)) |
| 2678 | new-buffer entry killed-buffers visible) | 2684 | new-buffer entry killed-buffers visible) |
| @@ -2786,7 +2792,7 @@ current buffer. Also, if BUFFER-OR-NAME is nil or omitted, | |||
| 2786 | remove the current buffer from the selected window if it is | 2792 | remove the current buffer from the selected window if it is |
| 2787 | displayed there." | 2793 | displayed there." |
| 2788 | (interactive) | 2794 | (interactive) |
| 2789 | (let* ((buffer (normalize-live-buffer buffer-or-name))) | 2795 | (let* ((buffer (window-normalize-buffer buffer-or-name))) |
| 2790 | ;; If `buffer-or-name' is not on the selected frame we unrecord it | 2796 | ;; If `buffer-or-name' is not on the selected frame we unrecord it |
| 2791 | ;; although it's not "here" (call it a feature). | 2797 | ;; although it's not "here" (call it a feature). |
| 2792 | (unrecord-buffer buffer) | 2798 | (unrecord-buffer buffer) |
| @@ -2843,7 +2849,7 @@ When a window showing BUFFER-OR-NAME is dedicated and the only | |||
| 2843 | window of its frame, that frame is deleted when there are other | 2849 | window of its frame, that frame is deleted when there are other |
| 2844 | frames left." | 2850 | frames left." |
| 2845 | (interactive "BDelete windows on (buffer):\nP") | 2851 | (interactive "BDelete windows on (buffer):\nP") |
| 2846 | (let ((buffer (normalize-live-buffer buffer-or-name)) | 2852 | (let ((buffer (window-normalize-buffer buffer-or-name)) |
| 2847 | ;; Handle the "inverted" meaning of the FRAME argument wrt other | 2853 | ;; Handle the "inverted" meaning of the FRAME argument wrt other |
| 2848 | ;; `window-list-1' based function. | 2854 | ;; `window-list-1' based function. |
| 2849 | (all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame)))) | 2855 | (all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame)))) |
| @@ -2877,7 +2883,7 @@ left, some other buffer is displayed in that window. | |||
| 2877 | 2883 | ||
| 2878 | This function removes the buffer denoted by BUFFER-OR-NAME from | 2884 | This function removes the buffer denoted by BUFFER-OR-NAME from |
| 2879 | all window-local buffer lists." | 2885 | all window-local buffer lists." |
| 2880 | (let ((buffer (normalize-live-buffer buffer-or-name))) | 2886 | (let ((buffer (window-normalize-buffer buffer-or-name))) |
| 2881 | (dolist (window (window-list-1 nil nil t)) | 2887 | (dolist (window (window-list-1 nil nil t)) |
| 2882 | (if (eq (window-buffer window) buffer) | 2888 | (if (eq (window-buffer window) buffer) |
| 2883 | (let ((deletable (window-deletable-p window))) | 2889 | (let ((deletable (window-deletable-p window))) |
| @@ -2910,7 +2916,7 @@ Optional argument KILL non-nil means in addition kill WINDOW's | |||
| 2910 | buffer. If KILL is nil, put WINDOW's buffer at the end of the | 2916 | buffer. If KILL is nil, put WINDOW's buffer at the end of the |
| 2911 | buffer list. Interactively, KILL is the prefix argument." | 2917 | buffer list. Interactively, KILL is the prefix argument." |
| 2912 | (interactive "i\nP") | 2918 | (interactive "i\nP") |
| 2913 | (setq window (normalize-live-window window)) | 2919 | (setq window (window-normalize-live-window window)) |
| 2914 | (let ((buffer (window-buffer window)) | 2920 | (let ((buffer (window-buffer window)) |
| 2915 | (quit-restore (window-parameter window 'quit-restore)) | 2921 | (quit-restore (window-parameter window 'quit-restore)) |
| 2916 | deletable resize) | 2922 | deletable resize) |
| @@ -3014,7 +3020,7 @@ window, these properties as well as the buffer displayed in the | |||
| 3014 | new window are inherited from the window selected on WINDOW's | 3020 | new window are inherited from the window selected on WINDOW's |
| 3015 | frame. The selected window is not changed by this function." | 3021 | frame. The selected window is not changed by this function." |
| 3016 | (interactive "i") | 3022 | (interactive "i") |
| 3017 | (setq window (normalize-any-window window)) | 3023 | (setq window (window-normalize-any-window window)) |
| 3018 | (let* ((side (cond | 3024 | (let* ((side (cond |
| 3019 | ((not side) 'below) | 3025 | ((not side) 'below) |
| 3020 | ((memq side '(below above right left)) side) | 3026 | ((memq side '(below above right left)) side) |
| @@ -3141,7 +3147,7 @@ frame. The selected window is not changed by this function." | |||
| 3141 | ;; SIZE specification violates minimum size restrictions. | 3147 | ;; SIZE specification violates minimum size restrictions. |
| 3142 | (error "Window %s too small for splitting" window))) | 3148 | (error "Window %s too small for splitting" window))) |
| 3143 | 3149 | ||
| 3144 | (window-resize-reset frame horizontal) | 3150 | (window--resize-reset frame horizontal) |
| 3145 | 3151 | ||
| 3146 | (setq new-parent | 3152 | (setq new-parent |
| 3147 | ;; Make new-parent non-nil if we need a new parent window; | 3153 | ;; Make new-parent non-nil if we need a new parent window; |
| @@ -3162,7 +3168,7 @@ frame. The selected window is not changed by this function." | |||
| 3162 | ;; we won't be able to return space to those windows when we | 3168 | ;; we won't be able to return space to those windows when we |
| 3163 | ;; delete the one we create here. Hence we do not go up. | 3169 | ;; delete the one we create here. Hence we do not go up. |
| 3164 | (progn | 3170 | (progn |
| 3165 | (resize-subwindows parent (- new-size) horizontal) | 3171 | (window--resize-subwindows parent (- new-size) horizontal) |
| 3166 | (let* ((normal (- 1.0 new-normal)) | 3172 | (let* ((normal (- 1.0 new-normal)) |
| 3167 | (sub (window-child parent))) | 3173 | (sub (window-child parent))) |
| 3168 | (while sub | 3174 | (while sub |
| @@ -3171,7 +3177,7 @@ frame. The selected window is not changed by this function." | |||
| 3171 | (setq sub (window-right sub))))) | 3177 | (setq sub (window-right sub))))) |
| 3172 | ;; Get entire space from WINDOW. | 3178 | ;; Get entire space from WINDOW. |
| 3173 | (set-window-new-total window (- old-size new-size)) | 3179 | (set-window-new-total window (- old-size new-size)) |
| 3174 | (resize-this-window window (- new-size) horizontal) | 3180 | (window--resize-this-window window (- new-size) horizontal) |
| 3175 | (set-window-new-normal | 3181 | (set-window-new-normal |
| 3176 | window (- (if new-parent 1.0 (window-normal-size window horizontal)) | 3182 | window (- (if new-parent 1.0 (window-normal-size window horizontal)) |
| 3177 | new-normal))) | 3183 | new-normal))) |
| @@ -3287,8 +3293,8 @@ The selected window remains selected. Return the new window." | |||
| 3287 | ;;; Balancing windows. | 3293 | ;;; Balancing windows. |
| 3288 | 3294 | ||
| 3289 | ;; The following routine uses the recycled code from an old version of | 3295 | ;; The following routine uses the recycled code from an old version of |
| 3290 | ;; `resize-subwindows'. It's not very pretty, but coding it the way the | 3296 | ;; `window--resize-subwindows'. It's not very pretty, but coding it the way the |
| 3291 | ;; new `resize-subwindows' code does would hardly make it any shorter or | 3297 | ;; new `window--resize-subwindows' code does would hardly make it any shorter or |
| 3292 | ;; more readable (FWIW we'd need three loops - one to calculate the | 3298 | ;; more readable (FWIW we'd need three loops - one to calculate the |
| 3293 | ;; minimum sizes per window, one to enlarge or shrink windows until the | 3299 | ;; minimum sizes per window, one to enlarge or shrink windows until the |
| 3294 | ;; new parent-size matches, and one where we shrink the largest/enlarge | 3300 | ;; new parent-size matches, and one where we shrink the largest/enlarge |
| @@ -3317,7 +3323,7 @@ WINDOW must be an iso-combination." | |||
| 3317 | (setq sub first) | 3323 | (setq sub first) |
| 3318 | (while (and sub (not failed)) | 3324 | (while (and sub (not failed)) |
| 3319 | ;; Ignore subwindows that should be ignored or are stuck. | 3325 | ;; Ignore subwindows that should be ignored or are stuck. |
| 3320 | (unless (resize-subwindows-skip-p sub) | 3326 | (unless (window--resize-subwindows-skip-p sub) |
| 3321 | (setq found t) | 3327 | (setq found t) |
| 3322 | (setq sub-total (window-total-size sub horizontal)) | 3328 | (setq sub-total (window-total-size sub horizontal)) |
| 3323 | (setq sub-delta (- size sub-total)) | 3329 | (setq sub-delta (- size sub-total)) |
| @@ -3338,7 +3344,7 @@ WINDOW must be an iso-combination." | |||
| 3338 | ;; (column) until `rest' is zero. | 3344 | ;; (column) until `rest' is zero. |
| 3339 | (setq sub first) | 3345 | (setq sub first) |
| 3340 | (while (and sub (> rest 0)) | 3346 | (while (and sub (> rest 0)) |
| 3341 | (unless (resize-subwindows-skip-p window) | 3347 | (unless (window--resize-subwindows-skip-p window) |
| 3342 | (set-window-new-total sub 1 t) | 3348 | (set-window-new-total sub 1 t) |
| 3343 | (setq rest (1- rest))) | 3349 | (setq rest (1- rest))) |
| 3344 | (setq sub (window-right sub))) | 3350 | (setq sub (window-right sub))) |
| @@ -3396,11 +3402,11 @@ window." | |||
| 3396 | (error "Not a window or frame %s" window-or-frame)))) | 3402 | (error "Not a window or frame %s" window-or-frame)))) |
| 3397 | (frame (window-frame window))) | 3403 | (frame (window-frame window))) |
| 3398 | ;; Balance vertically. | 3404 | ;; Balance vertically. |
| 3399 | (window-resize-reset (window-frame window)) | 3405 | (window--resize-reset (window-frame window)) |
| 3400 | (balance-windows-1 window) | 3406 | (balance-windows-1 window) |
| 3401 | (window-resize-apply frame) | 3407 | (window-resize-apply frame) |
| 3402 | ;; Balance horizontally. | 3408 | ;; Balance horizontally. |
| 3403 | (window-resize-reset (window-frame window) t) | 3409 | (window--resize-reset (window-frame window) t) |
| 3404 | (balance-windows-1 window t) | 3410 | (balance-windows-1 window t) |
| 3405 | (window-resize-apply frame t))) | 3411 | (window-resize-apply frame t))) |
| 3406 | 3412 | ||
| @@ -3767,7 +3773,7 @@ Optional argument IGNORE non-nil means ignore minimum window | |||
| 3767 | sizes and fixed size restrictions. IGNORE equal `safe' means | 3773 | sizes and fixed size restrictions. IGNORE equal `safe' means |
| 3768 | subwindows can get as small as `window-safe-min-height' and | 3774 | subwindows can get as small as `window-safe-min-height' and |
| 3769 | `window-safe-min-width'." | 3775 | `window-safe-min-width'." |
| 3770 | (setq window (normalize-live-window window)) | 3776 | (setq window (window-normalize-live-window window)) |
| 3771 | (let* ((frame (window-frame window)) | 3777 | (let* ((frame (window-frame window)) |
| 3772 | (head (car state)) | 3778 | (head (car state)) |
| 3773 | ;; We check here (1) whether the total sizes of root window of | 3779 | ;; We check here (1) whether the total sizes of root window of |
| @@ -3898,7 +3904,7 @@ match occurs in one of the following three cases: | |||
| 3898 | Display specifiers are either symbols, cons cells, or lists. | 3904 | Display specifiers are either symbols, cons cells, or lists. |
| 3899 | Five specifiers have been reserved to indicate the basic method | 3905 | Five specifiers have been reserved to indicate the basic method |
| 3900 | for displaying the buffer: `reuse-window', `pop-up-window', | 3906 | for displaying the buffer: `reuse-window', `pop-up-window', |
| 3901 | `pop-up-frame', `use-side-window', and `fun-with-args'. | 3907 | `pop-up-frame', `use-side-window', and `function'. |
| 3902 | 3908 | ||
| 3903 | A list whose car is the symbol `reuse-window' indicates that an | 3909 | A list whose car is the symbol `reuse-window' indicates that an |
| 3904 | existing window shall be reused for displaying the buffer. The | 3910 | existing window shall be reused for displaying the buffer. The |
| @@ -4088,7 +4094,7 @@ The following specifiers are useful in connection with the | |||
| 4088 | `pop-up-window-min-height', `pop-up-window-min-width', | 4094 | `pop-up-window-min-height', `pop-up-window-min-width', |
| 4089 | `pop-up-window-set-height' and `pop-up-window-set-width'. | 4095 | `pop-up-window-set-height' and `pop-up-window-set-width'. |
| 4090 | 4096 | ||
| 4091 | A list whose car is the symbol `fun-with-args' specifies that the | 4097 | A list whose car is the symbol `function' specifies that the |
| 4092 | function specified in the second element of the list is | 4098 | function specified in the second element of the list is |
| 4093 | responsible for displaying the buffer. `display-buffer' calls | 4099 | responsible for displaying the buffer. `display-buffer' calls |
| 4094 | this function with the buffer as first argument and the remaining | 4100 | this function with the buffer as first argument and the remaining |
| @@ -4514,18 +4520,18 @@ using the location specifiers `same-window' or `other-frame'." | |||
| 4514 | ;; Function with argument specifiers. | 4520 | ;; Function with argument specifiers. |
| 4515 | (list | 4521 | (list |
| 4516 | :tag "Function with arguments" | 4522 | :tag "Function with arguments" |
| 4517 | :value (fun-with-args (fun-with-args 'ignore)) | 4523 | :value (function (function 'ignore)) |
| 4518 | :format "%t\n%v" | 4524 | :format "%t\n%v" |
| 4519 | :inline t | 4525 | :inline t |
| 4520 | ;; For customization purposes only. | 4526 | ;; For customization purposes only. |
| 4521 | (const :format "" fun-with-args) | 4527 | (const :format "" function) |
| 4522 | (set | 4528 | (set |
| 4523 | :format "%v" | 4529 | :format "%v" |
| 4524 | :inline t | 4530 | :inline t |
| 4525 | (list | 4531 | (list |
| 4526 | :format "%v" | 4532 | :format "%v" |
| 4527 | :value (fun-with-args 'ignore) | 4533 | :value (function 'ignore) |
| 4528 | (const :format "" fun-with-args) | 4534 | (const :format "" function) |
| 4529 | (function :tag "Function" :format "%t: %v\n" :size 25) | 4535 | (function :tag "Function" :format "%t: %v\n" :size 25) |
| 4530 | (list | 4536 | (list |
| 4531 | :format "%v" | 4537 | :format "%v" |
| @@ -4736,8 +4742,8 @@ Return WINDOW. | |||
| 4736 | 4742 | ||
| 4737 | SPECIFIERS must be a list of buffer display specifiers, see the | 4743 | SPECIFIERS must be a list of buffer display specifiers, see the |
| 4738 | documentation of `display-buffer-alist' for a description." | 4744 | documentation of `display-buffer-alist' for a description." |
| 4739 | (setq buffer (normalize-live-buffer buffer)) | 4745 | (setq buffer (window-normalize-buffer buffer)) |
| 4740 | (setq window (normalize-live-window window)) | 4746 | (setq window (window-normalize-live-window window)) |
| 4741 | (let* ((old-frame (selected-frame)) | 4747 | (let* ((old-frame (selected-frame)) |
| 4742 | (new-frame (window-frame window)) | 4748 | (new-frame (window-frame window)) |
| 4743 | (dedicated (cdr (assq 'dedicated specifiers))) | 4749 | (dedicated (cdr (assq 'dedicated specifiers))) |
| @@ -5287,7 +5293,7 @@ SPECIFIERS must be a list of buffer display specifiers." | |||
| 5287 | (set-window-parameter window 'window-slot slot)) | 5293 | (set-window-parameter window 'window-slot slot)) |
| 5288 | (display-buffer-in-window buffer window specifiers))))) | 5294 | (display-buffer-in-window buffer window specifiers))))) |
| 5289 | 5295 | ||
| 5290 | (defun normalize-buffer-to-display (buffer-or-name) | 5296 | (defun window-normalize-buffer-to-display (buffer-or-name) |
| 5291 | "Normalize BUFFER-OR-NAME argument for buffer display functions. | 5297 | "Normalize BUFFER-OR-NAME argument for buffer display functions. |
| 5292 | If BUFFER-OR-NAME is nil, return the curent buffer. Else, if a | 5298 | If BUFFER-OR-NAME is nil, return the curent buffer. Else, if a |
| 5293 | buffer specified by BUFFER-OR-NAME exists, return that buffer. | 5299 | buffer specified by BUFFER-OR-NAME exists, return that buffer. |
| @@ -5313,7 +5319,7 @@ Optional argument LABEL is like the same argument of | |||
| 5313 | 5319 | ||
| 5314 | The calculation of the return value is exclusively based on the | 5320 | The calculation of the return value is exclusively based on the |
| 5315 | user preferences expressed in `display-buffer-alist'." | 5321 | user preferences expressed in `display-buffer-alist'." |
| 5316 | (let* ((buffer (normalize-live-buffer buffer-or-name)) | 5322 | (let* ((buffer (window-normalize-buffer buffer-or-name)) |
| 5317 | (list (display-buffer-normalize-alist (buffer-name buffer) label)) | 5323 | (list (display-buffer-normalize-alist (buffer-name buffer) label)) |
| 5318 | (value (assq 'other-window-means-other-frame | 5324 | (value (assq 'other-window-means-other-frame |
| 5319 | (or (car list) (cdr list))))) | 5325 | (or (car list) (cdr list))))) |
| @@ -5364,7 +5370,7 @@ use other-frame for other-window." | |||
| 5364 | ;; `special-display-function'. | 5370 | ;; `special-display-function'. |
| 5365 | (setq pars (with-no-warnings | 5371 | (setq pars (with-no-warnings |
| 5366 | (special-display-p buffer-name)))) | 5372 | (special-display-p buffer-name)))) |
| 5367 | (list (list 'fun-with-args | 5373 | (list (list 'function |
| 5368 | (with-no-warnings special-display-function) | 5374 | (with-no-warnings special-display-function) |
| 5369 | (when (listp pars) pars))) | 5375 | (when (listp pars) pars))) |
| 5370 | ;; Pop up another frame. | 5376 | ;; Pop up another frame. |
| @@ -5393,7 +5399,7 @@ BUFFER-OR-NAME is the buffer to display. This routine provides a | |||
| 5393 | compatibility layer for the now obsolete Emacs 23 buffer display | 5399 | compatibility layer for the now obsolete Emacs 23 buffer display |
| 5394 | options." | 5400 | options." |
| 5395 | (with-no-warnings | 5401 | (with-no-warnings |
| 5396 | (let* ((buffer (normalize-live-buffer buffer-or-name)) | 5402 | (let* ((buffer (window-normalize-buffer buffer-or-name)) |
| 5397 | (buffer-name (buffer-name buffer)) | 5403 | (buffer-name (buffer-name buffer)) |
| 5398 | (use-pop-up-frames | 5404 | (use-pop-up-frames |
| 5399 | (or (and (eq pop-up-frames 'graphic-only) | 5405 | (or (and (eq pop-up-frames 'graphic-only) |
| @@ -5473,7 +5479,7 @@ options." | |||
| 5473 | (let ((pars (special-display-p buffer-name))) | 5479 | (let ((pars (special-display-p buffer-name))) |
| 5474 | (when pars | 5480 | (when pars |
| 5475 | (setq specifiers | 5481 | (setq specifiers |
| 5476 | (cons (list 'fun-with-args special-display-function | 5482 | (cons (list 'function special-display-function |
| 5477 | (when (listp pars) pars)) | 5483 | (when (listp pars) pars)) |
| 5478 | specifiers))))) | 5484 | specifiers))))) |
| 5479 | 5485 | ||
| @@ -5615,7 +5621,7 @@ specifiers: | |||
| 5615 | (defun display-buffer-frame (&optional frame) | 5621 | (defun display-buffer-frame (&optional frame) |
| 5616 | "Return FRAME if it is live and not a minibuffer-only frame. | 5622 | "Return FRAME if it is live and not a minibuffer-only frame. |
| 5617 | Return the value of `last-nonminibuffer-frame' otherwise." | 5623 | Return the value of `last-nonminibuffer-frame' otherwise." |
| 5618 | (setq frame (normalize-live-frame frame)) | 5624 | (setq frame (window-normalize-frame frame)) |
| 5619 | (if (and (frame-live-p frame) | 5625 | (if (and (frame-live-p frame) |
| 5620 | ;; A not very nice way to get that information. | 5626 | ;; A not very nice way to get that information. |
| 5621 | (not (window-minibuffer-p (frame-root-window frame)))) | 5627 | (not (window-minibuffer-p (frame-root-window frame)))) |
| @@ -5688,7 +5694,7 @@ The result must be a list of valid buffer display specifiers. If | |||
| 5688 | `display-buffer-function' is non-nil, call it with the buffer and | 5694 | `display-buffer-function' is non-nil, call it with the buffer and |
| 5689 | this list as arguments." | 5695 | this list as arguments." |
| 5690 | (interactive "BDisplay buffer:\nP") | 5696 | (interactive "BDisplay buffer:\nP") |
| 5691 | (let* ((buffer (normalize-buffer-to-display buffer-or-name)) | 5697 | (let* ((buffer (window-normalize-buffer-to-display buffer-or-name)) |
| 5692 | (buffer-name (buffer-name buffer)) | 5698 | (buffer-name (buffer-name buffer)) |
| 5693 | (normalized | 5699 | (normalized |
| 5694 | ;; Normalize specifiers. | 5700 | ;; Normalize specifiers. |
| @@ -5722,7 +5728,7 @@ this list as arguments." | |||
| 5722 | ((eq method 'use-side-window) | 5728 | ((eq method 'use-side-window) |
| 5723 | (display-buffer-in-side-window | 5729 | (display-buffer-in-side-window |
| 5724 | buffer (nth 1 specifier) (nth 2 specifier) normalized)) | 5730 | buffer (nth 1 specifier) (nth 2 specifier) normalized)) |
| 5725 | ((eq method 'fun-with-args) | 5731 | ((eq method 'function) |
| 5726 | (apply (nth 1 specifier) buffer (nth 2 specifier)))))) | 5732 | (apply (nth 1 specifier) buffer (nth 2 specifier)))))) |
| 5727 | 5733 | ||
| 5728 | ;; If we don't have a window yet, try a fallback method. All | 5734 | ;; If we don't have a window yet, try a fallback method. All |
| @@ -5820,7 +5826,7 @@ This uses the function `display-buffer' as a subroutine; see the | |||
| 5820 | documentations of `display-buffer' and `display-buffer-alist' for | 5826 | documentations of `display-buffer' and `display-buffer-alist' for |
| 5821 | additional information." | 5827 | additional information." |
| 5822 | (interactive "BPop to buffer:\nP") | 5828 | (interactive "BPop to buffer:\nP") |
| 5823 | (let ((buffer (normalize-buffer-to-display buffer-or-name)) | 5829 | (let ((buffer (window-normalize-buffer-to-display buffer-or-name)) |
| 5824 | (old-window (selected-window)) | 5830 | (old-window (selected-window)) |
| 5825 | (old-frame (selected-frame)) | 5831 | (old-frame (selected-frame)) |
| 5826 | new-window new-frame) | 5832 | new-window new-frame) |
| @@ -5902,7 +5908,7 @@ from the list of completions and default values." | |||
| 5902 | (read-buffer prompt (other-buffer (current-buffer)) | 5908 | (read-buffer prompt (other-buffer (current-buffer)) |
| 5903 | (confirm-nonexistent-file-or-buffer))))) | 5909 | (confirm-nonexistent-file-or-buffer))))) |
| 5904 | 5910 | ||
| 5905 | (defun normalize-buffer-to-switch-to (buffer-or-name) | 5911 | (defun window-normalize-buffer-to-switch-to (buffer-or-name) |
| 5906 | "Normalize BUFFER-OR-NAME argument of buffer switching functions. | 5912 | "Normalize BUFFER-OR-NAME argument of buffer switching functions. |
| 5907 | If BUFFER-OR-NAME is nil, return the buffer returned by | 5913 | If BUFFER-OR-NAME is nil, return the buffer returned by |
| 5908 | `other-buffer'. Else, if a buffer specified by BUFFER-OR-NAME | 5914 | `other-buffer'. Else, if a buffer specified by BUFFER-OR-NAME |
| @@ -5937,7 +5943,7 @@ This function is intended for interactive use only. Lisp | |||
| 5937 | functions should call `pop-to-buffer-same-window' instead." | 5943 | functions should call `pop-to-buffer-same-window' instead." |
| 5938 | (interactive | 5944 | (interactive |
| 5939 | (list (read-buffer-to-switch "Switch to buffer: "))) | 5945 | (list (read-buffer-to-switch "Switch to buffer: "))) |
| 5940 | (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) | 5946 | (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name))) |
| 5941 | (if (and (or (window-minibuffer-p) (eq (window-dedicated-p) t)) | 5947 | (if (and (or (window-minibuffer-p) (eq (window-dedicated-p) t)) |
| 5942 | (not (eq buffer (window-buffer)))) | 5948 | (not (eq buffer (window-buffer)))) |
| 5943 | ;; Cannot switch to another buffer in a minibuffer or strongly | 5949 | ;; Cannot switch to another buffer in a minibuffer or strongly |
| @@ -5963,7 +5969,7 @@ This function is intended for interactive use only. Lisp | |||
| 5963 | functions should call `pop-to-buffer-same-frame' instead." | 5969 | functions should call `pop-to-buffer-same-frame' instead." |
| 5964 | (interactive | 5970 | (interactive |
| 5965 | (list (read-buffer-to-switch "Switch to buffer in other window: "))) | 5971 | (list (read-buffer-to-switch "Switch to buffer in other window: "))) |
| 5966 | (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) | 5972 | (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name))) |
| 5967 | (pop-to-buffer buffer 'same-frame norecord))) | 5973 | (pop-to-buffer buffer 'same-frame norecord))) |
| 5968 | 5974 | ||
| 5969 | (defun switch-to-buffer-other-window (buffer-or-name &optional norecord) | 5975 | (defun switch-to-buffer-other-window (buffer-or-name &optional norecord) |
| @@ -5977,7 +5983,7 @@ This function is intended for interactive use only. Lisp | |||
| 5977 | functions should call `pop-to-buffer-other-window' instead." | 5983 | functions should call `pop-to-buffer-other-window' instead." |
| 5978 | (interactive | 5984 | (interactive |
| 5979 | (list (read-buffer-to-switch "Switch to buffer in other window: "))) | 5985 | (list (read-buffer-to-switch "Switch to buffer in other window: "))) |
| 5980 | (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) | 5986 | (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name))) |
| 5981 | (pop-to-buffer buffer 'other-window norecord))) | 5987 | (pop-to-buffer buffer 'other-window norecord))) |
| 5982 | 5988 | ||
| 5983 | (defun switch-to-buffer-other-window-same-frame (buffer-or-name &optional norecord) | 5989 | (defun switch-to-buffer-other-window-same-frame (buffer-or-name &optional norecord) |
| @@ -5991,7 +5997,7 @@ functions should call `pop-to-buffer-other-window-same-frame' | |||
| 5991 | instead." | 5997 | instead." |
| 5992 | (interactive | 5998 | (interactive |
| 5993 | (list (read-buffer-to-switch "Switch to buffer in other window: "))) | 5999 | (list (read-buffer-to-switch "Switch to buffer in other window: "))) |
| 5994 | (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) | 6000 | (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name))) |
| 5995 | (pop-to-buffer buffer 'same-frame-other-window norecord))) | 6001 | (pop-to-buffer buffer 'same-frame-other-window norecord))) |
| 5996 | 6002 | ||
| 5997 | (defun switch-to-buffer-other-frame (buffer-or-name &optional norecord) | 6003 | (defun switch-to-buffer-other-frame (buffer-or-name &optional norecord) |
| @@ -6004,7 +6010,7 @@ This function is intended for interactive use only. Lisp | |||
| 6004 | functions should call `pop-to-buffer-other-frame' instead." | 6010 | functions should call `pop-to-buffer-other-frame' instead." |
| 6005 | (interactive | 6011 | (interactive |
| 6006 | (list (read-buffer-to-switch "Switch to buffer in other frame: "))) | 6012 | (list (read-buffer-to-switch "Switch to buffer in other frame: "))) |
| 6007 | (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) | 6013 | (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name))) |
| 6008 | (pop-to-buffer buffer 'other-frame norecord))) | 6014 | (pop-to-buffer buffer 'other-frame norecord))) |
| 6009 | 6015 | ||
| 6010 | ;;; Obsolete definitions of `display-buffer' below. | 6016 | ;;; Obsolete definitions of `display-buffer' below. |
| @@ -6657,8 +6663,8 @@ value of `display-buffer-alist'." | |||
| 6657 | (display-buffer-alist-add | 6663 | (display-buffer-alist-add |
| 6658 | `((regexp . ,entry)) | 6664 | `((regexp . ,entry)) |
| 6659 | (list | 6665 | (list |
| 6660 | 'fun-with-args | 6666 | 'function |
| 6661 | (list 'fun-with-args special-display-function | 6667 | (list 'function special-display-function |
| 6662 | special-display-frame-alist)) | 6668 | special-display-frame-alist)) |
| 6663 | no-custom)) | 6669 | no-custom)) |
| 6664 | ((consp entry) | 6670 | ((consp entry) |
| @@ -6670,9 +6676,9 @@ value of `display-buffer-alist'." | |||
| 6670 | (display-buffer-alist-add | 6676 | (display-buffer-alist-add |
| 6671 | `((name . ,name)) | 6677 | `((name . ,name)) |
| 6672 | (list | 6678 | (list |
| 6673 | 'fun-with-args | 6679 | 'function |
| 6674 | ;; Weary. | 6680 | ;; Weary. |
| 6675 | (list 'fun-with-args (car rest) (cadr rest))) | 6681 | (list 'function (car rest) (cadr rest))) |
| 6676 | no-custom)) | 6682 | no-custom)) |
| 6677 | ((listp rest) | 6683 | ((listp rest) |
| 6678 | ;; A list of parameters. | 6684 | ;; A list of parameters. |
| @@ -6691,8 +6697,8 @@ value of `display-buffer-alist'." | |||
| 6691 | (display-buffer-alist-add | 6697 | (display-buffer-alist-add |
| 6692 | `((name . ,name)) | 6698 | `((name . ,name)) |
| 6693 | (list | 6699 | (list |
| 6694 | 'fun-with-args | 6700 | 'function |
| 6695 | (list 'fun-with-args special-display-function | 6701 | (list 'function special-display-function |
| 6696 | special-display-frame-alist)) | 6702 | special-display-frame-alist)) |
| 6697 | no-custom))))))))) | 6703 | no-custom))))))))) |
| 6698 | 6704 | ||
| @@ -6704,8 +6710,8 @@ value of `display-buffer-alist'." | |||
| 6704 | (display-buffer-alist-add | 6710 | (display-buffer-alist-add |
| 6705 | `((name . ,entry)) | 6711 | `((name . ,entry)) |
| 6706 | (list | 6712 | (list |
| 6707 | 'fun-with-args | 6713 | 'function |
| 6708 | (list 'fun-with-args special-display-function | 6714 | (list 'function special-display-function |
| 6709 | special-display-frame-alist)) | 6715 | special-display-frame-alist)) |
| 6710 | no-custom)) | 6716 | no-custom)) |
| 6711 | ((consp entry) | 6717 | ((consp entry) |
| @@ -6717,9 +6723,9 @@ value of `display-buffer-alist'." | |||
| 6717 | (display-buffer-alist-add | 6723 | (display-buffer-alist-add |
| 6718 | `((name . ,name)) | 6724 | `((name . ,name)) |
| 6719 | (list | 6725 | (list |
| 6720 | 'fun-with-args | 6726 | 'function |
| 6721 | ;; Weary. | 6727 | ;; Weary. |
| 6722 | (list 'fun-with-args (car rest) (cadr rest))) | 6728 | (list 'function (car rest) (cadr rest))) |
| 6723 | no-custom)) | 6729 | no-custom)) |
| 6724 | ((listp rest) | 6730 | ((listp rest) |
| 6725 | ;; A list of parameters. | 6731 | ;; A list of parameters. |
| @@ -6738,8 +6744,8 @@ value of `display-buffer-alist'." | |||
| 6738 | (display-buffer-alist-add | 6744 | (display-buffer-alist-add |
| 6739 | `((name . ,name)) | 6745 | `((name . ,name)) |
| 6740 | (list | 6746 | (list |
| 6741 | 'fun-with-args | 6747 | 'function |
| 6742 | (list 'fun-with-args special-display-function | 6748 | (list 'function special-display-function |
| 6743 | special-display-frame-alist)) | 6749 | special-display-frame-alist)) |
| 6744 | no-custom))))))))) | 6750 | no-custom))))))))) |
| 6745 | 6751 | ||
| @@ -6805,7 +6811,7 @@ Note that the current implementation of this function cannot | |||
| 6805 | always set the height exactly, but attempts to be conservative, | 6811 | always set the height exactly, but attempts to be conservative, |
| 6806 | by allocating more lines than are actually needed in the case | 6812 | by allocating more lines than are actually needed in the case |
| 6807 | where some error may be present." | 6813 | where some error may be present." |
| 6808 | (setq window (normalize-live-window window)) | 6814 | (setq window (window-normalize-live-window window)) |
| 6809 | (let ((delta (- height (window-text-height window)))) | 6815 | (let ((delta (- height (window-text-height window)))) |
| 6810 | (unless (zerop delta) | 6816 | (unless (zerop delta) |
| 6811 | ;; Setting window-min-height to a value like 1 can lead to very | 6817 | ;; Setting window-min-height to a value like 1 can lead to very |
| @@ -6901,7 +6907,7 @@ WINDOW was scrolled." | |||
| 6901 | (interactive) | 6907 | (interactive) |
| 6902 | ;; Do all the work in WINDOW and its buffer and restore the selected | 6908 | ;; Do all the work in WINDOW and its buffer and restore the selected |
| 6903 | ;; window and the current buffer when we're done. | 6909 | ;; window and the current buffer when we're done. |
| 6904 | (setq window (normalize-live-window window)) | 6910 | (setq window (window-normalize-live-window window)) |
| 6905 | ;; Can't resize a full height or fixed-size window. | 6911 | ;; Can't resize a full height or fixed-size window. |
| 6906 | (unless (or (window-size-fixed-p window) | 6912 | (unless (or (window-size-fixed-p window) |
| 6907 | (window-full-height-p window)) | 6913 | (window-full-height-p window)) |
| @@ -7013,7 +7019,7 @@ window, or if the window is the only window of its frame. | |||
| 7013 | 7019 | ||
| 7014 | Return non-nil if the window was shrunk, nil otherwise." | 7020 | Return non-nil if the window was shrunk, nil otherwise." |
| 7015 | (interactive) | 7021 | (interactive) |
| 7016 | (setq window (normalize-live-window window)) | 7022 | (setq window (window-normalize-live-window window)) |
| 7017 | ;; Make sure that WINDOW is vertically combined and `point-min' is | 7023 | ;; Make sure that WINDOW is vertically combined and `point-min' is |
| 7018 | ;; visible (for whatever reason that's needed). The remaining issues | 7024 | ;; visible (for whatever reason that's needed). The remaining issues |
| 7019 | ;; should be taken care of by `fit-window-to-buffer'. | 7025 | ;; should be taken care of by `fit-window-to-buffer'. |
diff --git a/src/ChangeLog b/src/ChangeLog index 1e537f3872e..000843f6c80 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-06-29 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.c (resize_root_window, grow_mini_window) | ||
| 4 | (shrink_mini_window): Rename Qresize_root_window to | ||
| 5 | Qwindow_resize_root_window and Qresize_root_window_vertically to | ||
| 6 | Qwindow_resize_root_window_vertically. | ||
| 7 | |||
| 1 | 2011-06-28 Paul Eggert <eggert@cs.ucla.edu> | 8 | 2011-06-28 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 9 | ||
| 3 | * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var. | 10 | * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var. |
diff --git a/src/window.c b/src/window.c index 6656796b350..dfd43ba07bf 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -54,7 +54,7 @@ Lisp_Object Qwindowp, Qwindow_live_p; | |||
| 54 | static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; | 54 | static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; |
| 55 | static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; | 55 | static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; |
| 56 | static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; | 56 | static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; |
| 57 | static Lisp_Object Qresize_root_window, Qresize_root_window_vertically; | 57 | static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; |
| 58 | static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; | 58 | static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; |
| 59 | static Lisp_Object Qsafe, Qabove, Qbelow; | 59 | static Lisp_Object Qsafe, Qabove, Qbelow; |
| 60 | static Lisp_Object Qauto_buffer_name; | 60 | static Lisp_Object Qauto_buffer_name; |
| @@ -2576,7 +2576,7 @@ selected frame and no others. */) | |||
| 2576 | static Lisp_Object | 2576 | static Lisp_Object |
| 2577 | resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal, Lisp_Object ignore) | 2577 | resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal, Lisp_Object ignore) |
| 2578 | { | 2578 | { |
| 2579 | return call4 (Qresize_root_window, window, delta, horizontal, ignore); | 2579 | return call4 (Qwindow_resize_root_window, window, delta, horizontal, ignore); |
| 2580 | } | 2580 | } |
| 2581 | 2581 | ||
| 2582 | 2582 | ||
| @@ -4073,7 +4073,8 @@ grow_mini_window (struct window *w, int delta) | |||
| 4073 | 4073 | ||
| 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 (Qwindow_resize_root_window_vertically, |
| 4077 | root, make_number (- delta)); | ||
| 4077 | if (INTEGERP (value) && window_resize_check (r, 0)) | 4078 | if (INTEGERP (value) && window_resize_check (r, 0)) |
| 4078 | { | 4079 | { |
| 4079 | BLOCK_INPUT; | 4080 | BLOCK_INPUT; |
| @@ -4107,7 +4108,7 @@ shrink_mini_window (struct window *w) | |||
| 4107 | { | 4108 | { |
| 4108 | root = FRAME_ROOT_WINDOW (f); | 4109 | root = FRAME_ROOT_WINDOW (f); |
| 4109 | r = XWINDOW (root); | 4110 | r = XWINDOW (root); |
| 4110 | value = call2 (Qresize_root_window_vertically, | 4111 | value = call2 (Qwindow_resize_root_window_vertically, |
| 4111 | root, make_number (size - 1)); | 4112 | root, make_number (size - 1)); |
| 4112 | if (INTEGERP (value) && window_resize_check (r, 0)) | 4113 | if (INTEGERP (value) && window_resize_check (r, 0)) |
| 4113 | { | 4114 | { |
| @@ -6454,8 +6455,8 @@ syms_of_window (void) | |||
| 6454 | DEFSYM (Qwindow_live_p, "window-live-p"); | 6455 | DEFSYM (Qwindow_live_p, "window-live-p"); |
| 6455 | DEFSYM (Qwindow_deletable_p, "window-deletable-p"); | 6456 | DEFSYM (Qwindow_deletable_p, "window-deletable-p"); |
| 6456 | DEFSYM (Qdelete_window, "delete-window"); | 6457 | DEFSYM (Qdelete_window, "delete-window"); |
| 6457 | DEFSYM (Qresize_root_window, "resize-root-window"); | 6458 | DEFSYM (Qwindow_resize_root_window, "window--resize-root-window"); |
| 6458 | DEFSYM (Qresize_root_window_vertically, "resize-root-window-vertically"); | 6459 | DEFSYM (Qwindow_resize_root_window_vertically, "window--resize-root-window-vertically"); |
| 6459 | DEFSYM (Qsafe, "safe"); | 6460 | DEFSYM (Qsafe, "safe"); |
| 6460 | DEFSYM (Qdisplay_buffer, "display-buffer"); | 6461 | DEFSYM (Qdisplay_buffer, "display-buffer"); |
| 6461 | DEFSYM (Qreplace_buffer_in_windows, "replace-buffer-in-windows"); | 6462 | DEFSYM (Qreplace_buffer_in_windows, "replace-buffer-in-windows"); |