diff options
| author | Martin Rudalics | 2011-11-19 11:53:05 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2011-11-19 11:53:05 +0100 |
| commit | c56cad4ac04ca0da464926f826e7d2fa246fa3eb (patch) | |
| tree | 123738ebd29cba936303b783dd1791650749070f | |
| parent | 5396468298b0122469e0b41da8f49860d99a2b51 (diff) | |
| download | emacs-c56cad4ac04ca0da464926f826e7d2fa246fa3eb.tar.gz emacs-c56cad4ac04ca0da464926f826e7d2fa246fa3eb.zip | |
Prefix a few more internal functions with "window--".
* window.el (window-max-delta-1, window-min-delta-1)
(window-min-size-1, window-state-get-1, window-state-put-1)
(window-state-put-2): Use "window--" prefix.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/window.el | 50 |
2 files changed, 31 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 69e5d5571d2..e033fbd608a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-11-19 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (window-max-delta-1, window-min-delta-1) | ||
| 4 | (window-min-size-1, window-state-get-1, window-state-put-1) | ||
| 5 | (window-state-put-2): Use "window--" prefix. | ||
| 6 | |||
| 1 | 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * emacs-lisp/smie.el: Improve warnings and conflict detection. | 9 | * emacs-lisp/smie.el: Improve warnings and conflict detection. |
diff --git a/lisp/window.el b/lisp/window.el index 10c6adc04e4..019a1904ac7 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -524,10 +524,10 @@ imposed by fixed size windows, `window-min-height' or | |||
| 524 | windows may get as small as `window-safe-min-height' lines and | 524 | windows may get as small as `window-safe-min-height' lines and |
| 525 | `window-safe-min-width' columns. IGNORE a window means ignore | 525 | `window-safe-min-width' columns. IGNORE a window means ignore |
| 526 | restrictions for that window only." | 526 | restrictions for that window only." |
| 527 | (window-min-size-1 | 527 | (window--min-size-1 |
| 528 | (window-normalize-window window) horizontal ignore)) | 528 | (window-normalize-window window) horizontal ignore)) |
| 529 | 529 | ||
| 530 | (defun window-min-size-1 (window horizontal ignore) | 530 | (defun window--min-size-1 (window horizontal ignore) |
| 531 | "Internal function of `window-min-size'." | 531 | "Internal function of `window-min-size'." |
| 532 | (let ((sub (window-child window))) | 532 | (let ((sub (window-child window))) |
| 533 | (if sub | 533 | (if sub |
| @@ -538,13 +538,13 @@ restrictions for that window only." | |||
| 538 | ;; the minimum sizes of its child windows. | 538 | ;; the minimum sizes of its child windows. |
| 539 | (while sub | 539 | (while sub |
| 540 | (setq value (+ value | 540 | (setq value (+ value |
| 541 | (window-min-size-1 sub horizontal ignore))) | 541 | (window--min-size-1 sub horizontal ignore))) |
| 542 | (setq sub (window-right sub))) | 542 | (setq sub (window-right sub))) |
| 543 | ;; The minimum size of an ortho-combination is the maximum of | 543 | ;; The minimum size of an ortho-combination is the maximum of |
| 544 | ;; the minimum sizes of its child windows. | 544 | ;; the minimum sizes of its child windows. |
| 545 | (while sub | 545 | (while sub |
| 546 | (setq value (max value | 546 | (setq value (max value |
| 547 | (window-min-size-1 sub horizontal ignore))) | 547 | (window--min-size-1 sub horizontal ignore))) |
| 548 | (setq sub (window-right sub)))) | 548 | (setq sub (window-right sub)))) |
| 549 | value) | 549 | value) |
| 550 | (with-current-buffer (window-buffer window) | 550 | (with-current-buffer (window-buffer window) |
| @@ -687,7 +687,7 @@ WINDOW can be resized in the desired direction. The function | |||
| 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) |
| 691 | "Internal function for `window-min-delta'." | 691 | "Internal function for `window-min-delta'." |
| 692 | (if (not (window-parent window)) | 692 | (if (not (window-parent window)) |
| 693 | ;; If we can't go up, return zero. | 693 | ;; If we can't go up, return zero. |
| @@ -723,7 +723,7 @@ WINDOW can be resized in the desired direction. The function | |||
| 723 | (setq sub (window-right sub)))) | 723 | (setq sub (window-right sub)))) |
| 724 | (if noup | 724 | (if noup |
| 725 | delta | 725 | delta |
| 726 | (window-min-delta-1 parent delta horizontal ignore trail)))))) | 726 | (window--min-delta-1 parent delta horizontal ignore trail)))))) |
| 727 | 727 | ||
| 728 | (defun window-min-delta (&optional window horizontal ignore trail noup nodown) | 728 | (defun window-min-delta (&optional window horizontal ignore trail noup nodown) |
| 729 | "Return number of lines by which WINDOW can be shrunk. | 729 | "Return number of lines by which WINDOW can be shrunk. |
| @@ -757,7 +757,7 @@ at least one other window can be enlarged appropriately." | |||
| 757 | (cond | 757 | (cond |
| 758 | (nodown | 758 | (nodown |
| 759 | ;; If NODOWN is t, try to recover the entire size of WINDOW. | 759 | ;; If NODOWN is t, try to recover the entire size of WINDOW. |
| 760 | (window-min-delta-1 window size horizontal ignore trail noup)) | 760 | (window--min-delta-1 window size horizontal ignore trail noup)) |
| 761 | ((= size minimum) | 761 | ((= size minimum) |
| 762 | ;; If NODOWN is nil and WINDOW's size is already at its minimum, | 762 | ;; If NODOWN is nil and WINDOW's size is already at its minimum, |
| 763 | ;; there's nothing to recover. | 763 | ;; there's nothing to recover. |
| @@ -765,10 +765,10 @@ at least one other window can be enlarged appropriately." | |||
| 765 | (t | 765 | (t |
| 766 | ;; Otherwise, try to recover whatever WINDOW is larger than its | 766 | ;; Otherwise, try to recover whatever WINDOW is larger than its |
| 767 | ;; minimum size. | 767 | ;; minimum size. |
| 768 | (window-min-delta-1 | 768 | (window--min-delta-1 |
| 769 | window (- size minimum) horizontal ignore trail noup))))) | 769 | window (- size minimum) horizontal ignore trail noup))))) |
| 770 | 770 | ||
| 771 | (defun window-max-delta-1 (window delta &optional horizontal ignore trail noup) | 771 | (defun window--max-delta-1 (window delta &optional horizontal ignore trail noup) |
| 772 | "Internal function of `window-max-delta'." | 772 | "Internal function of `window-max-delta'." |
| 773 | (if (not (window-parent window)) | 773 | (if (not (window-parent window)) |
| 774 | ;; Can't go up. Return DELTA. | 774 | ;; Can't go up. Return DELTA. |
| @@ -804,7 +804,7 @@ at least one other window can be enlarged appropriately." | |||
| 804 | delta | 804 | delta |
| 805 | ;; Else try with parent of WINDOW, passing the DELTA we | 805 | ;; Else try with parent of WINDOW, passing the DELTA we |
| 806 | ;; recovered so far. | 806 | ;; recovered so far. |
| 807 | (window-max-delta-1 parent delta horizontal ignore trail)))))) | 807 | (window--max-delta-1 parent delta horizontal ignore trail)))))) |
| 808 | 808 | ||
| 809 | (defun window-max-delta (&optional window horizontal ignore trail noup nodown) | 809 | (defun window-max-delta (&optional window horizontal ignore trail noup nodown) |
| 810 | "Return maximum number of lines WINDOW by which WINDOW can be enlarged. | 810 | "Return maximum number of lines WINDOW by which WINDOW can be enlarged. |
| @@ -840,7 +840,7 @@ only whether other windows can be shrunk appropriately." | |||
| 840 | ;; size. | 840 | ;; size. |
| 841 | 0 | 841 | 0 |
| 842 | ;; WINDOW has no fixed size. | 842 | ;; WINDOW has no fixed size. |
| 843 | (window-max-delta-1 window 0 horizontal ignore trail noup))) | 843 | (window--max-delta-1 window 0 horizontal ignore trail noup))) |
| 844 | 844 | ||
| 845 | ;; Make NOUP also inhibit the min-size check. | 845 | ;; Make NOUP also inhibit the min-size check. |
| 846 | (defun window--resizable (window delta &optional horizontal ignore trail noup nodown) | 846 | (defun window--resizable (window delta &optional horizontal ignore trail noup nodown) |
| @@ -2039,8 +2039,8 @@ move it as far as possible in the desired direction." | |||
| 2039 | ;; two windows we want to resize. | 2039 | ;; two windows we want to resize. |
| 2040 | (cond | 2040 | (cond |
| 2041 | ((> delta 0) | 2041 | ((> delta 0) |
| 2042 | (setq max-delta (window-max-delta-1 left 0 horizontal nil 'after)) | 2042 | (setq max-delta (window--max-delta-1 left 0 horizontal nil 'after)) |
| 2043 | (setq min-delta (window-min-delta-1 right (- delta) horizontal nil 'before)) | 2043 | (setq min-delta (window--min-delta-1 right (- delta) horizontal nil 'before)) |
| 2044 | (when (or (< max-delta delta) (> min-delta (- delta))) | 2044 | (when (or (< max-delta delta) (> min-delta (- delta))) |
| 2045 | ;; We can't get the whole DELTA - move as far as possible. | 2045 | ;; We can't get the whole DELTA - move as far as possible. |
| 2046 | (setq delta (min max-delta (- min-delta)))) | 2046 | (setq delta (min max-delta (- min-delta)))) |
| @@ -2062,8 +2062,8 @@ move it as far as possible in the desired direction." | |||
| 2062 | (window-left-column right) | 2062 | (window-left-column right) |
| 2063 | (window-top-line right))))) | 2063 | (window-top-line right))))) |
| 2064 | ((< delta 0) | 2064 | ((< delta 0) |
| 2065 | (setq max-delta (window-max-delta-1 right 0 horizontal nil 'before)) | 2065 | (setq max-delta (window--max-delta-1 right 0 horizontal nil 'before)) |
| 2066 | (setq min-delta (window-min-delta-1 left delta horizontal nil 'after)) | 2066 | (setq min-delta (window--min-delta-1 left delta horizontal nil 'after)) |
| 2067 | (when (or (< max-delta (- delta)) (> min-delta delta)) | 2067 | (when (or (< max-delta (- delta)) (> min-delta delta)) |
| 2068 | ;; We can't get the whole DELTA - move as far as possible. | 2068 | ;; We can't get the whole DELTA - move as far as possible. |
| 2069 | (setq delta (max (- max-delta) min-delta))) | 2069 | (setq delta (max (- max-delta) min-delta))) |
| @@ -3570,7 +3570,7 @@ specific buffers." | |||
| 3570 | (defvar window-state-ignored-parameters '(quit-restore) | 3570 | (defvar window-state-ignored-parameters '(quit-restore) |
| 3571 | "List of window parameters ignored by `window-state-get'.") | 3571 | "List of window parameters ignored by `window-state-get'.") |
| 3572 | 3572 | ||
| 3573 | (defun window-state-get-1 (window &optional markers) | 3573 | (defun window--state-get-1 (window &optional markers) |
| 3574 | "Helper function for `window-state-get'." | 3574 | "Helper function for `window-state-get'." |
| 3575 | (let* ((type | 3575 | (let* ((type |
| 3576 | (cond | 3576 | (cond |
| @@ -3625,7 +3625,7 @@ specific buffers." | |||
| 3625 | (let (list) | 3625 | (let (list) |
| 3626 | (setq window (window-child window)) | 3626 | (setq window (window-child window)) |
| 3627 | (while window | 3627 | (while window |
| 3628 | (setq list (cons (window-state-get-1 window markers) list)) | 3628 | (setq list (cons (window--state-get-1 window markers) list)) |
| 3629 | (setq window (window-right window))) | 3629 | (setq window (window-right window))) |
| 3630 | (nreverse list))))) | 3630 | (nreverse list))))) |
| 3631 | (append head tail))) | 3631 | (append head tail))) |
| @@ -3664,12 +3664,12 @@ value can be also stored on disk and read back in a new session." | |||
| 3664 | ;; These are probably not needed. | 3664 | ;; These are probably not needed. |
| 3665 | ,@(when (window-size-fixed-p window) `((fixed-height . t))) | 3665 | ,@(when (window-size-fixed-p window) `((fixed-height . t))) |
| 3666 | ,@(when (window-size-fixed-p window t) `((fixed-width . t)))) | 3666 | ,@(when (window-size-fixed-p window t) `((fixed-width . t)))) |
| 3667 | (window-state-get-1 window markers))) | 3667 | (window--state-get-1 window markers))) |
| 3668 | 3668 | ||
| 3669 | (defvar window-state-put-list nil | 3669 | (defvar window-state-put-list nil |
| 3670 | "Helper variable for `window-state-put'.") | 3670 | "Helper variable for `window-state-put'.") |
| 3671 | 3671 | ||
| 3672 | (defun window-state-put-1 (state &optional window ignore totals) | 3672 | (defun window--state-put-1 (state &optional window ignore totals) |
| 3673 | "Helper function for `window-state-put'." | 3673 | "Helper function for `window-state-put'." |
| 3674 | (let ((type (car state))) | 3674 | (let ((type (car state))) |
| 3675 | (setq state (cdr state)) | 3675 | (setq state (cdr state)) |
| @@ -3689,7 +3689,7 @@ value can be also stored on disk and read back in a new session." | |||
| 3689 | ;; real window that we want to fill with what we find here. | 3689 | ;; real window that we want to fill with what we find here. |
| 3690 | (when (memq (car item) '(leaf vc hc)) | 3690 | (when (memq (car item) '(leaf vc hc)) |
| 3691 | (if (assq 'last item) | 3691 | (if (assq 'last item) |
| 3692 | ;; The last child window. Below `window-state-put-1' | 3692 | ;; The last child window. Below `window--state-put-1' |
| 3693 | ;; will put into it whatever ITEM has in store. | 3693 | ;; will put into it whatever ITEM has in store. |
| 3694 | (setq new nil) | 3694 | (setq new nil) |
| 3695 | ;; Not the last child window, prepare for splitting | 3695 | ;; Not the last child window, prepare for splitting |
| @@ -3730,11 +3730,11 @@ value can be also stored on disk and read back in a new session." | |||
| 3730 | 3730 | ||
| 3731 | ;; Now process the current window (either the one we've just | 3731 | ;; Now process the current window (either the one we've just |
| 3732 | ;; split or the last child of its parent). | 3732 | ;; split or the last child of its parent). |
| 3733 | (window-state-put-1 item window ignore totals) | 3733 | (window--state-put-1 item window ignore totals) |
| 3734 | ;; Continue with the last window split off. | 3734 | ;; Continue with the last window split off. |
| 3735 | (setq window new)))))))) | 3735 | (setq window new)))))))) |
| 3736 | 3736 | ||
| 3737 | (defun window-state-put-2 (ignore) | 3737 | (defun window--state-put-2 (ignore) |
| 3738 | "Helper function for `window-state-put'." | 3738 | "Helper function for `window-state-put'." |
| 3739 | (dolist (item window-state-put-list) | 3739 | (dolist (item window-state-put-list) |
| 3740 | (let ((window (car item)) | 3740 | (let ((window (car item)) |
| @@ -3860,11 +3860,11 @@ windows can get as small as `window-safe-min-height' and | |||
| 3860 | ;; Work on the windows of a temporary buffer to make sure that | 3860 | ;; Work on the windows of a temporary buffer to make sure that |
| 3861 | ;; splitting proceeds regardless of any buffer local values of | 3861 | ;; splitting proceeds regardless of any buffer local values of |
| 3862 | ;; `window-size-fixed'. Release that buffer after the buffers of | 3862 | ;; `window-size-fixed'. Release that buffer after the buffers of |
| 3863 | ;; all live windows have been set by `window-state-put-2'. | 3863 | ;; all live windows have been set by `window--state-put-2'. |
| 3864 | (with-temp-buffer | 3864 | (with-temp-buffer |
| 3865 | (set-window-buffer window (current-buffer)) | 3865 | (set-window-buffer window (current-buffer)) |
| 3866 | (window-state-put-1 state window nil totals) | 3866 | (window--state-put-1 state window nil totals) |
| 3867 | (window-state-put-2 ignore)) | 3867 | (window--state-put-2 ignore)) |
| 3868 | (window--check frame)))) | 3868 | (window--check frame)))) |
| 3869 | 3869 | ||
| 3870 | (defun display-buffer-record-window (type window buffer) | 3870 | (defun display-buffer-record-window (type window buffer) |