diff options
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/window.el | 44 |
2 files changed, 25 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07cd69590ad..0e617e9c66d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -3,7 +3,9 @@ | |||
| 3 | * window.el (windows-with-parameter): Remove unused function. | 3 | * window.el (windows-with-parameter): Remove unused function. |
| 4 | (windows-at-side): Rename to window-at-side-list. | 4 | (windows-at-side): Rename to window-at-side-list. |
| 5 | (window-check, window-atom-check, window-atom-check-1) | 5 | (window-check, window-atom-check, window-atom-check-1) |
| 6 | (window-side-check): Prefix with "window--". | 6 | (window-side-check, window-size-ignore, window-size-fixed-1) |
| 7 | (window-in-direction-2): Prefix with "window--". | ||
| 8 | (window-tree-1): Rename to window--subtree, fix doc-string. | ||
| 7 | 9 | ||
| 8 | 2011-11-11 Glenn Morris <rgm@gnu.org> | 10 | 2011-11-11 Glenn Morris <rgm@gnu.org> |
| 9 | 11 | ||
diff --git a/lisp/window.el b/lisp/window.el index 4bbead969ac..41b397730d1 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -508,7 +508,7 @@ unless it has no other choice \(like when deleting a neighboring | |||
| 508 | window).") | 508 | window).") |
| 509 | (make-variable-buffer-local 'window-size-fixed) | 509 | (make-variable-buffer-local 'window-size-fixed) |
| 510 | 510 | ||
| 511 | (defun window-size-ignore (window ignore) | 511 | (defun window--size-ignore (window ignore) |
| 512 | "Return non-nil if IGNORE says to ignore size restrictions for WINDOW." | 512 | "Return non-nil if IGNORE says to ignore size restrictions for WINDOW." |
| 513 | (if (window-valid-p ignore) (eq window ignore) ignore)) | 513 | (if (window-valid-p ignore) (eq window ignore) ignore)) |
| 514 | 514 | ||
| @@ -549,7 +549,7 @@ restrictions for that window only." | |||
| 549 | value) | 549 | value) |
| 550 | (with-current-buffer (window-buffer window) | 550 | (with-current-buffer (window-buffer window) |
| 551 | (cond | 551 | (cond |
| 552 | ((and (not (window-size-ignore window ignore)) | 552 | ((and (not (window--size-ignore window ignore)) |
| 553 | (window-size-fixed-p window horizontal)) | 553 | (window-size-fixed-p window horizontal)) |
| 554 | ;; The minimum size of a fixed size window is its size. | 554 | ;; The minimum size of a fixed size window is its size. |
| 555 | (window-total-size window horizontal)) | 555 | (window-total-size window horizontal)) |
| @@ -578,7 +578,7 @@ restrictions for that window only." | |||
| 578 | (ceiling (or (frame-parameter frame 'scroll-bar-width) 14) | 578 | (ceiling (or (frame-parameter frame 'scroll-bar-width) 14) |
| 579 | (frame-char-width))) | 579 | (frame-char-width))) |
| 580 | (t 0))) | 580 | (t 0))) |
| 581 | (if (and (not (window-size-ignore window ignore)) | 581 | (if (and (not (window--size-ignore window ignore)) |
| 582 | (numberp window-min-width)) | 582 | (numberp window-min-width)) |
| 583 | window-min-width | 583 | window-min-width |
| 584 | 0)))) | 584 | 0)))) |
| @@ -588,7 +588,7 @@ restrictions for that window only." | |||
| 588 | (max (+ window-safe-min-height | 588 | (max (+ window-safe-min-height |
| 589 | (if header-line-format 1 0) | 589 | (if header-line-format 1 0) |
| 590 | (if mode-line-format 1 0)) | 590 | (if mode-line-format 1 0)) |
| 591 | (if (and (not (window-size-ignore window ignore)) | 591 | (if (and (not (window--size-ignore window ignore)) |
| 592 | (numberp window-min-height)) | 592 | (numberp window-min-height)) |
| 593 | window-min-height | 593 | window-min-height |
| 594 | 0)))))))) | 594 | 0)))))))) |
| @@ -625,7 +625,7 @@ restrictions for that window only." | |||
| 625 | (max (- (window-min-size window horizontal ignore) | 625 | (max (- (window-min-size window horizontal ignore) |
| 626 | (window-total-size window horizontal)) | 626 | (window-total-size window horizontal)) |
| 627 | delta)) | 627 | delta)) |
| 628 | ((window-size-ignore window ignore) | 628 | ((window--size-ignore window ignore) |
| 629 | delta) | 629 | delta) |
| 630 | ((> delta 0) | 630 | ((> delta 0) |
| 631 | (if (window-size-fixed-p window horizontal) | 631 | (if (window-size-fixed-p window horizontal) |
| @@ -642,7 +642,7 @@ doc-string of `window-sizable'." | |||
| 642 | (>= (window-sizable window delta horizontal ignore) delta) | 642 | (>= (window-sizable window delta horizontal ignore) delta) |
| 643 | (<= (window-sizable window delta horizontal ignore) delta))) | 643 | (<= (window-sizable window delta horizontal ignore) delta))) |
| 644 | 644 | ||
| 645 | (defun window-size-fixed-1 (window horizontal) | 645 | (defun window--size-fixed-1 (window horizontal) |
| 646 | "Internal function for `window-size-fixed-p'." | 646 | "Internal function for `window-size-fixed-p'." |
| 647 | (let ((sub (window-child window))) | 647 | (let ((sub (window-child window))) |
| 648 | (catch 'fixed | 648 | (catch 'fixed |
| @@ -653,7 +653,7 @@ doc-string of `window-sizable'." | |||
| 653 | ;; windows are fixed-size. | 653 | ;; windows are fixed-size. |
| 654 | (progn | 654 | (progn |
| 655 | (while sub | 655 | (while sub |
| 656 | (unless (window-size-fixed-1 sub horizontal) | 656 | (unless (window--size-fixed-1 sub horizontal) |
| 657 | ;; We found a non-fixed-size child window, so | 657 | ;; We found a non-fixed-size child window, so |
| 658 | ;; WINDOW's size is not fixed. | 658 | ;; WINDOW's size is not fixed. |
| 659 | (throw 'fixed nil)) | 659 | (throw 'fixed nil)) |
| @@ -664,7 +664,7 @@ doc-string of `window-sizable'." | |||
| 664 | ;; An ortho-combination is fixed-size if at least one of its | 664 | ;; An ortho-combination is fixed-size if at least one of its |
| 665 | ;; child windows is fixed-size. | 665 | ;; child windows is fixed-size. |
| 666 | (while sub | 666 | (while sub |
| 667 | (when (window-size-fixed-1 sub horizontal) | 667 | (when (window--size-fixed-1 sub horizontal) |
| 668 | ;; We found a fixed-size child window, so WINDOW's size | 668 | ;; We found a fixed-size child window, so WINDOW's size |
| 669 | ;; is fixed. | 669 | ;; is fixed. |
| 670 | (throw 'fixed t)) | 670 | (throw 'fixed t)) |
| @@ -684,7 +684,7 @@ non-nil if WINDOW's width is fixed. | |||
| 684 | If this function returns nil, this does not necessarily mean that | 684 | If this function returns nil, this does not necessarily mean that |
| 685 | WINDOW can be resized in the desired direction. The function | 685 | WINDOW can be resized in the desired direction. The function |
| 686 | `window-resizable' can tell that." | 686 | `window-resizable' can tell that." |
| 687 | (window-size-fixed-1 | 687 | (window--size-fixed-1 |
| 688 | (window-normalize-window window) horizontal)) | 688 | (window-normalize-window window) horizontal)) |
| 689 | 689 | ||
| 690 | (defun window-min-delta-1 (window delta &optional horizontal ignore trail noup) | 690 | (defun window-min-delta-1 (window delta &optional horizontal ignore trail noup) |
| @@ -706,7 +706,7 @@ WINDOW can be resized in the desired direction. The function | |||
| 706 | ((eq sub window) | 706 | ((eq sub window) |
| 707 | (setq skip (eq trail 'before))) | 707 | (setq skip (eq trail 'before))) |
| 708 | (skip) | 708 | (skip) |
| 709 | ((and (not (window-size-ignore window ignore)) | 709 | ((and (not (window--size-ignore window ignore)) |
| 710 | (window-size-fixed-p sub horizontal))) | 710 | (window-size-fixed-p sub horizontal))) |
| 711 | (t | 711 | (t |
| 712 | ;; We found a non-fixed-size child window. | 712 | ;; We found a non-fixed-size child window. |
| @@ -795,7 +795,7 @@ at least one other window can be enlarged appropriately." | |||
| 795 | ;; child window is fixed-size. | 795 | ;; child window is fixed-size. |
| 796 | (while sub | 796 | (while sub |
| 797 | (when (and (not (eq sub window)) | 797 | (when (and (not (eq sub window)) |
| 798 | (not (window-size-ignore sub ignore)) | 798 | (not (window--size-ignore sub ignore)) |
| 799 | (window-size-fixed-p sub horizontal)) | 799 | (window-size-fixed-p sub horizontal)) |
| 800 | (throw 'fixed delta)) | 800 | (throw 'fixed delta)) |
| 801 | (setq sub (window-right sub)))) | 801 | (setq sub (window-right sub)))) |
| @@ -834,7 +834,7 @@ Optional argument NODOWN non-nil means do not check whether | |||
| 834 | WINDOW itself \(and its child windows) can be enlarged; check | 834 | WINDOW itself \(and its child windows) can be enlarged; check |
| 835 | only whether other windows can be shrunk appropriately." | 835 | only whether other windows can be shrunk appropriately." |
| 836 | (setq window (window-normalize-window window)) | 836 | (setq window (window-normalize-window window)) |
| 837 | (if (and (not (window-size-ignore window ignore)) | 837 | (if (and (not (window--size-ignore window ignore)) |
| 838 | (not nodown) (window-size-fixed-p window horizontal)) | 838 | (not nodown) (window-size-fixed-p window horizontal)) |
| 839 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed | 839 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed |
| 840 | ;; size. | 840 | ;; size. |
| @@ -1098,7 +1098,7 @@ SIDE can be any of the symbols `left', `top', `right' or | |||
| 1098 | frame) | 1098 | frame) |
| 1099 | (nreverse windows))) | 1099 | (nreverse windows))) |
| 1100 | 1100 | ||
| 1101 | (defun window-in-direction-2 (window posn &optional horizontal) | 1101 | (defun window--in-direction-2 (window posn &optional horizontal) |
| 1102 | "Support function for `window-in-direction'." | 1102 | "Support function for `window-in-direction'." |
| 1103 | (if horizontal | 1103 | (if horizontal |
| 1104 | (let ((top (window-top-line window))) | 1104 | (let ((top (window-top-line window))) |
| @@ -1168,7 +1168,7 @@ IGNORE, when non-nil means a window can be returned even if its | |||
| 1168 | ;; W is to the left or right of WINDOW but does not | 1168 | ;; W is to the left or right of WINDOW but does not |
| 1169 | ;; cover POSN. | 1169 | ;; cover POSN. |
| 1170 | (setq best-diff-2-new | 1170 | (setq best-diff-2-new |
| 1171 | (window-in-direction-2 w posn hor)) | 1171 | (window--in-direction-2 w posn hor)) |
| 1172 | (or (< best-diff-2-new best-diff-2) | 1172 | (or (< best-diff-2-new best-diff-2) |
| 1173 | (and (= best-diff-2-new best-diff-2) | 1173 | (and (= best-diff-2-new best-diff-2) |
| 1174 | (if (eq direction 'left) | 1174 | (if (eq direction 'left) |
| @@ -1193,7 +1193,7 @@ IGNORE, when non-nil means a window can be returned even if its | |||
| 1193 | (and (eq direction 'below) (<= last w-top))) | 1193 | (and (eq direction 'below) (<= last w-top))) |
| 1194 | ;; W is above or below WINDOW but does not cover POSN. | 1194 | ;; W is above or below WINDOW but does not cover POSN. |
| 1195 | (setq best-diff-2-new | 1195 | (setq best-diff-2-new |
| 1196 | (window-in-direction-2 w posn hor)) | 1196 | (window--in-direction-2 w posn hor)) |
| 1197 | (or (< best-diff-2-new best-diff-2) | 1197 | (or (< best-diff-2-new best-diff-2) |
| 1198 | (and (= best-diff-2-new best-diff-2) | 1198 | (and (= best-diff-2-new best-diff-2) |
| 1199 | (if (eq direction 'above) | 1199 | (if (eq direction 'above) |
| @@ -1822,7 +1822,7 @@ preferably only resize windows adjacent to EDGE." | |||
| 1822 | ;; Make sure this sibling is left alone when | 1822 | ;; Make sure this sibling is left alone when |
| 1823 | ;; resizing its siblings. | 1823 | ;; resizing its siblings. |
| 1824 | (set-window-new-normal sub 'ignore)) | 1824 | (set-window-new-normal sub 'ignore)) |
| 1825 | ((or (window-size-ignore sub ignore) | 1825 | ((or (window--size-ignore sub ignore) |
| 1826 | (not (window-size-fixed-p sub horizontal))) | 1826 | (not (window-size-fixed-p sub horizontal))) |
| 1827 | ;; Set this-delta to t to signal that we found a sibling | 1827 | ;; Set this-delta to t to signal that we found a sibling |
| 1828 | ;; of WINDOW whose size is not fixed. | 1828 | ;; of WINDOW whose size is not fixed. |
| @@ -2154,9 +2154,9 @@ WINDOW can be any window and defaults to the selected window." | |||
| 2154 | "Return non-nil if WINDOW is the root window of its frame." | 2154 | "Return non-nil if WINDOW is the root window of its frame." |
| 2155 | (eq window (frame-root-window window))) | 2155 | (eq window (frame-root-window window))) |
| 2156 | 2156 | ||
| 2157 | (defun window-tree-1 (window &optional next) | 2157 | (defun window--subtree (window &optional next) |
| 2158 | "Return window tree rooted at WINDOW. | 2158 | "Return window subtree rooted at WINDOW. |
| 2159 | Optional argument NEXT non-nil means include windows right | 2159 | Optional argument NEXT non-nil means include WINDOW's right |
| 2160 | siblings in the return value. | 2160 | siblings in the return value. |
| 2161 | 2161 | ||
| 2162 | See the documentation of `window-tree' for a description of the | 2162 | See the documentation of `window-tree' for a description of the |
| @@ -2168,10 +2168,10 @@ return value." | |||
| 2168 | (cond | 2168 | (cond |
| 2169 | ((window-top-child window) | 2169 | ((window-top-child window) |
| 2170 | (cons t (cons (window-edges window) | 2170 | (cons t (cons (window-edges window) |
| 2171 | (window-tree-1 (window-top-child window) t)))) | 2171 | (window--subtree (window-top-child window) t)))) |
| 2172 | ((window-left-child window) | 2172 | ((window-left-child window) |
| 2173 | (cons nil (cons (window-edges window) | 2173 | (cons nil (cons (window-edges window) |
| 2174 | (window-tree-1 (window-left-child window) t)))) | 2174 | (window--subtree (window-left-child window) t)))) |
| 2175 | (t window)) | 2175 | (t window)) |
| 2176 | list)) | 2176 | list)) |
| 2177 | (setq window (when next (window-next-sibling window)))) | 2177 | (setq window (when next (window-next-sibling window)))) |
| @@ -2193,7 +2193,7 @@ Each of the child windows may again be a window or a list | |||
| 2193 | representing a window split, and so on. EDGES is a list \(LEFT | 2193 | representing a window split, and so on. EDGES is a list \(LEFT |
| 2194 | TOP RIGHT BOTTOM) as returned by `window-edges'." | 2194 | TOP RIGHT BOTTOM) as returned by `window-edges'." |
| 2195 | (setq frame (window-normalize-frame frame)) | 2195 | (setq frame (window-normalize-frame frame)) |
| 2196 | (window-tree-1 (frame-root-window frame) t)) | 2196 | (window--subtree (frame-root-window frame) t)) |
| 2197 | 2197 | ||
| 2198 | (defun other-window (count &optional all-frames) | 2198 | (defun other-window (count &optional all-frames) |
| 2199 | "Select another window in cyclic ordering of windows. | 2199 | "Select another window in cyclic ordering of windows. |