aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2012-04-20 09:27:11 +0300
committerEli Zaretskii2012-04-20 09:27:11 +0300
commit2116e93c7c258d37d56bfe2334708368217ae0fd (patch)
treeeb8a1c4e86f0c2069547407dd7263cbae5a29988
parent5db6195faa9205a5c3cfde134cc312d3d3b95b46 (diff)
downloademacs-2116e93c7c258d37d56bfe2334708368217ae0fd.tar.gz
emacs-2116e93c7c258d37d56bfe2334708368217ae0fd.zip
Doc fixes in window.el functions.
lisp/window.el (window-min-size, window-sizable, window-min-delta) (window-max-delta, window--resizable, window-resizable) (window-total-size, window-full-height-p, window-full-width-p) (window-in-direction, window--resize-mini-window, window-resize) (window--resize-child-windows-normal) (window--resize-child-windows, window--resize-siblings) (window--resize-this-window, adjust-window-trailing-edge) (enlarge-window, shrink-window): Doc fixes.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/window.el137
2 files changed, 85 insertions, 63 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1ce5e7fceea..cbdeb23b4e2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12012-04-20 Eli Zaretskii <eliz@gnu.org>
2
3 * window.el (window-min-size, window-sizable, window-min-delta)
4 (window-max-delta, window--resizable, window-resizable)
5 (window-total-size, window-full-height-p, window-full-width-p)
6 (window-in-direction, window--resize-mini-window, window-resize)
7 (window--resize-child-windows-normal)
8 (window--resize-child-windows, window--resize-siblings)
9 (window--resize-this-window, adjust-window-trailing-edge)
10 (enlarge-window, shrink-window):
11
12012-04-19 Chong Yidong <cyd@gnu.org> 122012-04-19 Chong Yidong <cyd@gnu.org>
2 13
3 * progmodes/gdb-mi.el (gdb-inferior-io--maybe-delete-pty): New 14 * progmodes/gdb-mi.el (gdb-inferior-io--maybe-delete-pty): New
diff --git a/lisp/window.el b/lisp/window.el
index c9e2469b0d2..28abec42680 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -514,17 +514,19 @@ window).")
514 (if (window-valid-p ignore) (eq window ignore) ignore)) 514 (if (window-valid-p ignore) (eq window ignore) ignore))
515 515
516(defun window-min-size (&optional window horizontal ignore) 516(defun window-min-size (&optional window horizontal ignore)
517 "Return the minimum number of lines of WINDOW. 517 "Return the minimum size of WINDOW.
518WINDOW can be an arbitrary window and defaults to the selected 518WINDOW can be an arbitrary window and defaults to the selected
519one. Optional argument HORIZONTAL non-nil means return the 519one. Optional argument HORIZONTAL non-nil means return the
520minimum number of columns of WINDOW. 520minimum number of columns of WINDOW; otherwise return the minimum
521number of WINDOW's lines.
521 522
522Optional argument IGNORE non-nil means ignore any restrictions 523Optional argument IGNORE, if non-nil, means ignore restrictions
523imposed by fixed size windows, `window-min-height' or 524imposed by fixed size windows, `window-min-height' or
524`window-min-width' settings. IGNORE equal `safe' means live 525`window-min-width' settings. If IGNORE equals `safe', live
525windows may get as small as `window-safe-min-height' lines and 526windows may get as small as `window-safe-min-height' lines and
526`window-safe-min-width' columns. IGNORE a window means ignore 527`window-safe-min-width' columns. If IGNORE is a window, ignore
527restrictions for that window only." 528restrictions for that window only. Any other non-nil value
529means ignore all of the above restrictions for all windows."
528 (window--min-size-1 530 (window--min-size-1
529 (window-normalize-window window) horizontal ignore)) 531 (window-normalize-window window) horizontal ignore))
530 532
@@ -614,12 +616,13 @@ columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
614return the minimum value in the range DELTA..0 by which WINDOW 616return the minimum value in the range DELTA..0 by which WINDOW
615can be shrunk. 617can be shrunk.
616 618
617Optional argument IGNORE non-nil means ignore any restrictions 619Optional argument IGNORE non-nil means ignore restrictions
618imposed by fixed size windows, `window-min-height' or 620imposed by fixed size windows, `window-min-height' or
619`window-min-width' settings. IGNORE equal `safe' means live 621`window-min-width' settings. If IGNORE equals `safe', live
620windows may get as small as `window-safe-min-height' lines and 622windows may get as small as `window-safe-min-height' lines and
621`window-safe-min-width' columns. IGNORE any window means ignore 623`window-safe-min-width' columns. If IGNORE is a window, ignore
622restrictions for that window only." 624restrictions for that window only. Any other non-nil value means
625ignore all of the above restrictions for all windows."
623 (setq window (window-normalize-window window)) 626 (setq window (window-normalize-window window))
624 (cond 627 (cond
625 ((< delta 0) 628 ((< delta 0)
@@ -734,20 +737,21 @@ window. Return zero if WINDOW cannot be shrunk.
734Optional argument HORIZONTAL non-nil means return number of 737Optional argument HORIZONTAL non-nil means return number of
735columns by which WINDOW can be shrunk. 738columns by which WINDOW can be shrunk.
736 739
737Optional argument IGNORE non-nil means ignore any restrictions 740Optional argument IGNORE non-nil means ignore restrictions
738imposed by fixed size windows, `window-min-height' or 741imposed by fixed size windows, `window-min-height' or
739`window-min-width' settings. IGNORE a window means ignore 742`window-min-width' settings. If IGNORE is a window, ignore
740restrictions for that window only. IGNORE equal `safe' means 743restrictions for that window only. If IGNORE equals `safe',
741live windows may get as small as `window-safe-min-height' lines 744live windows may get as small as `window-safe-min-height' lines
742and `window-safe-min-width' columns. 745and `window-safe-min-width' columns. Any other non-nil value
746means ignore all of the above restrictions for all windows.
743 747
744Optional argument TRAIL `before' means only windows to the left 748Optional argument TRAIL restricts the windows that can be enlarged.
745of or above WINDOW can be enlarged. Optional argument TRAIL 749If its value is `before', only windows to the left of or above WINDOW
746`after' means only windows to the right of or below WINDOW can be 750can be enlarged. If it is `after', only windows to the right of or
747enlarged. 751below WINDOW can be enlarged.
748 752
749Optional argument NOUP non-nil means don't go up in the window 753Optional argument NOUP non-nil means don't go up in the window
750tree but try to enlarge windows within WINDOW's combination only. 754tree, but try to enlarge windows within WINDOW's combination only.
751 755
752Optional argument NODOWN non-nil means don't check whether WINDOW 756Optional argument NODOWN non-nil means don't check whether WINDOW
753itself (and its child windows) can be shrunk; check only whether 757itself (and its child windows) can be shrunk; check only whether
@@ -808,24 +812,25 @@ at least one other window can be enlarged appropriately."
808 (window--max-delta-1 parent delta horizontal ignore trail)))))) 812 (window--max-delta-1 parent delta horizontal ignore trail))))))
809 813
810(defun window-max-delta (&optional window horizontal ignore trail noup nodown) 814(defun window-max-delta (&optional window horizontal ignore trail noup nodown)
811 "Return maximum number of lines WINDOW by which WINDOW can be enlarged. 815 "Return maximum number of lines by which WINDOW can be enlarged.
812WINDOW can be an arbitrary window and defaults to the selected 816WINDOW can be an arbitrary window and defaults to the selected
813window. The return value is zero if WINDOW cannot be enlarged. 817window. The return value is zero if WINDOW cannot be enlarged.
814 818
815Optional argument HORIZONTAL non-nil means return maximum number 819Optional argument HORIZONTAL non-nil means return maximum number
816of columns by which WINDOW can be enlarged. 820of columns by which WINDOW can be enlarged.
817 821
818Optional argument IGNORE non-nil means ignore any restrictions 822Optional argument IGNORE non-nil means ignore restrictions
819imposed by fixed size windows, `window-min-height' or 823imposed by fixed size windows, `window-min-height' or
820`window-min-width' settings. IGNORE a window means ignore 824`window-min-width' settings. If IGNORE is a window, ignore
821restrictions for that window only. IGNORE equal `safe' means 825restrictions for that window only. If IGNORE equals `safe',
822live windows may get as small as `window-safe-min-height' lines 826live windows may get as small as `window-safe-min-height' lines
823and `window-safe-min-width' columns. 827and `window-safe-min-width' columns. Any other non-nil value means
828ignore all of the above restrictions for all windows.
824 829
825Optional argument TRAIL `before' means only windows to the left 830Optional argument TRAIL restricts the windows that can be enlarged.
826of or below WINDOW can be shrunk. Optional argument TRAIL 831If its value is `before', only windows to the left of or above WINDOW
827`after' means only windows to the right of or above WINDOW can be 832can be enlarged. If it is `after', only windows to the right of or
828shrunk. 833below WINDOW can be enlarged.
829 834
830Optional argument NOUP non-nil means don't go up in the window 835Optional argument NOUP non-nil means don't go up in the window
831tree but try to obtain the entire space from windows within 836tree but try to obtain the entire space from windows within
@@ -860,12 +865,13 @@ columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
860return the minimum value in the range DELTA..0 that can be used 865return the minimum value in the range DELTA..0 that can be used
861for shrinking WINDOW. 866for shrinking WINDOW.
862 867
863Optional argument IGNORE non-nil means ignore any restrictions 868Optional argument IGNORE non-nil means ignore restrictions
864imposed by fixed size windows, `window-min-height' or 869imposed by fixed size windows, `window-min-height' or
865`window-min-width' settings. IGNORE a window means ignore 870`window-min-width' settings. If IGNORE is a window, ignore
866restrictions for that window only. IGNORE equal `safe' means 871restrictions for that window only. If IGNORE equals `safe',
867live windows may get as small as `window-safe-min-height' lines 872live windows may get as small as `window-safe-min-height' lines
868and `window-safe-min-width' columns. 873and `window-safe-min-width' columns. Any other non-nil value
874means ignore all of the above restrictions for all windows.
869 875
870Optional argument TRAIL `before' means only windows to the left 876Optional argument TRAIL `before' means only windows to the left
871of or below WINDOW can be shrunk. Optional argument TRAIL 877of or below WINDOW can be shrunk. Optional argument TRAIL
@@ -916,17 +922,18 @@ columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
916return the minimum value in the range DELTA..0 that can be used 922return the minimum value in the range DELTA..0 that can be used
917for shrinking WINDOW. 923for shrinking WINDOW.
918 924
919Optional argument IGNORE non-nil means ignore any restrictions 925Optional argument IGNORE non-nil means ignore restrictions
920imposed by fixed size windows, `window-min-height' or 926imposed by fixed size windows, `window-min-height' or
921`window-min-width' settings. IGNORE a window means ignore 927`window-min-width' settings. If IGNORE is a window, ignore
922restrictions for that window only. IGNORE equal `safe' means 928restrictions for that window only. If IGNORE equals `safe',
923live windows may get as small as `window-safe-min-height' lines 929live windows may get as small as `window-safe-min-height' lines
924and `window-safe-min-width' columns." 930and `window-safe-min-width' columns. Any other non-nil value
931means ignore all of the above restrictions for all windows."
925 (setq window (window-normalize-window window)) 932 (setq window (window-normalize-window window))
926 (window--resizable window delta horizontal ignore)) 933 (window--resizable window delta horizontal ignore))
927 934
928(defun window-total-size (&optional window horizontal) 935(defun window-total-size (&optional window horizontal)
929 "Return the total height or width of window WINDOW. 936 "Return the total height or width of WINDOW.
930If WINDOW is omitted or nil, it defaults to the selected window. 937If WINDOW is omitted or nil, it defaults to the selected window.
931 938
932If HORIZONTAL is omitted or nil, return the total height of 939If HORIZONTAL is omitted or nil, return the total height of
@@ -941,7 +948,7 @@ the total width, in columns, like `window-total-width'."
941 948
942;; See discussion in bug#4543. 949;; See discussion in bug#4543.
943(defun window-full-height-p (&optional window) 950(defun window-full-height-p (&optional window)
944 "Return t if WINDOW is as high as the containing frame. 951 "Return t if WINDOW is as high as its containing frame.
945More precisely, return t if and only if the total height of 952More precisely, return t if and only if the total height of
946WINDOW equals the total height of the root window of WINDOW's 953WINDOW equals the total height of the root window of WINDOW's
947frame. WINDOW can be any window and defaults to the selected 954frame. WINDOW can be any window and defaults to the selected
@@ -951,7 +958,7 @@ one."
951 (window-total-size (frame-root-window window)))) 958 (window-total-size (frame-root-window window))))
952 959
953(defun window-full-width-p (&optional window) 960(defun window-full-width-p (&optional window)
954 "Return t if WINDOW is as wide as the containing frame. 961 "Return t if WINDOW is as wide as its containing frame.
955More precisely, return t if and only if the total width of WINDOW 962More precisely, return t if and only if the total width of WINDOW
956equals the total width of the root window of WINDOW's frame. 963equals the total width of the root window of WINDOW's frame.
957WINDOW can be any window and defaults to the selected one." 964WINDOW can be any window and defaults to the selected one."
@@ -1115,7 +1122,7 @@ SIDE can be any of the symbols `left', `top', `right' or
1115 "Return window in DIRECTION as seen from WINDOW. 1122 "Return window in DIRECTION as seen from WINDOW.
1116DIRECTION must be one of `above', `below', `left' or `right'. 1123DIRECTION must be one of `above', `below', `left' or `right'.
1117WINDOW must be a live window and defaults to the selected one. 1124WINDOW must be a live window and defaults to the selected one.
1118IGNORE, when non-nil means a window can be returned even if its 1125IGNORE non-nil means a window can be returned even if its
1119`no-other-window' parameter is non-nil." 1126`no-other-window' parameter is non-nil."
1120 (setq window (window-normalize-window window t)) 1127 (setq window (window-normalize-window window t))
1121 (unless (memq direction '(above below left right)) 1128 (unless (memq direction '(above below left right))
@@ -1420,7 +1427,7 @@ windows."
1420(defun window--resize-mini-window (window delta) 1427(defun window--resize-mini-window (window delta)
1421 "Resize minibuffer window WINDOW by DELTA lines. 1428 "Resize minibuffer window WINDOW by DELTA lines.
1422If WINDOW cannot be resized by DELTA lines make it as large (or 1429If WINDOW cannot be resized by DELTA lines make it as large (or
1423as small) as possible but don't signal an error." 1430as small) as possible, but don't signal an error."
1424 (when (window-minibuffer-p window) 1431 (when (window-minibuffer-p window)
1425 (let* ((frame (window-frame window)) 1432 (let* ((frame (window-frame window))
1426 (root (frame-root-window frame)) 1433 (root (frame-root-window frame))
@@ -1461,12 +1468,13 @@ horizontally by DELTA columns. In this case a positive DELTA
1461means enlarge WINDOW by DELTA columns. DELTA negative means 1468means enlarge WINDOW by DELTA columns. DELTA negative means
1462WINDOW shall be shrunk by -DELTA columns. 1469WINDOW shall be shrunk by -DELTA columns.
1463 1470
1464Optional argument IGNORE non-nil means ignore any restrictions 1471Optional argument IGNORE non-nil means ignore restrictions
1465imposed by fixed size windows, `window-min-height' or 1472imposed by fixed size windows, `window-min-height' or
1466`window-min-width' settings. IGNORE any window means ignore 1473`window-min-width' settings. If IGNORE is a window, ignore
1467restrictions for that window only. IGNORE equal `safe' means 1474restrictions for that window only. If IGNORE equals `safe',
1468live windows may get as small as `window-safe-min-height' lines 1475live windows may get as small as `window-safe-min-height' lines
1469and `window-safe-min-width' columns. 1476and `window-safe-min-width' columns. Any other non-nil value
1477means ignore all of the above restrictions for all windows.
1470 1478
1471This function resizes other windows proportionally and never 1479This function resizes other windows proportionally and never
1472deletes any windows. If you want to move only the low (right) 1480deletes any windows. If you want to move only the low (right)
@@ -1516,9 +1524,9 @@ HORIZONTAL non-nil means set the new normal width of these
1516windows. WINDOW specifies a child window of PARENT that has been 1524windows. WINDOW specifies a child window of PARENT that has been
1517resized by THIS-DELTA lines (columns). 1525resized by THIS-DELTA lines (columns).
1518 1526
1519Optional argument TRAIL either 'before or 'after means set values 1527Optional argument TRAIL either `before' or `after' means set values
1520for windows before or after WINDOW only. Optional argument 1528only for windows before or after WINDOW. Optional argument
1521OTHER-DELTA a number specifies that this many lines (columns) 1529OTHER-DELTA, a number, specifies that this many lines (columns)
1522have been obtained from (or returned to) an ancestor window of 1530have been obtained from (or returned to) an ancestor window of
1523PARENT in order to resize WINDOW." 1531PARENT in order to resize WINDOW."
1524 (let* ((delta-normal 1532 (let* ((delta-normal
@@ -1618,12 +1626,13 @@ be a horizontally combined internal window.
1618WINDOW, if specified, must denote a child window of PARENT that 1626WINDOW, if specified, must denote a child window of PARENT that
1619is resized by DELTA lines. 1627is resized by DELTA lines.
1620 1628
1621Optional argument IGNORE non-nil means ignore any restrictions 1629Optional argument IGNORE non-nil means ignore restrictions
1622imposed by fixed size windows, `window-min-height' or 1630imposed by fixed size windows, `window-min-height' or
1623`window-min-width' settings. IGNORE equal `safe' means live 1631`window-min-width' settings. If IGNORE equals `safe', live
1624windows may get as small as `window-safe-min-height' lines and 1632windows may get as small as `window-safe-min-height' lines and
1625`window-safe-min-width' columns. IGNORE any window means ignore 1633`window-safe-min-width' columns. If IGNORE is a window, ignore
1626restrictions for that window only. 1634restrictions for that window only. Any other non-nil value means
1635ignore all of the above restrictions for all windows.
1627 1636
1628Optional arguments TRAIL and EDGE, when non-nil, restrict the set 1637Optional arguments TRAIL and EDGE, when non-nil, restrict the set
1629of windows that shall be resized. If TRAIL equals `before', 1638of windows that shall be resized. If TRAIL equals `before',
@@ -1790,12 +1799,13 @@ Optional argument HORIZONTAL non-nil means resize other windows
1790when WINDOW is resized horizontally by DELTA columns. WINDOW 1799when WINDOW is resized horizontally by DELTA columns. WINDOW
1791itself is not resized by this function. 1800itself is not resized by this function.
1792 1801
1793Optional argument IGNORE non-nil means ignore any restrictions 1802Optional argument IGNORE non-nil means ignore restrictions
1794imposed by fixed size windows, `window-min-height' or 1803imposed by fixed size windows, `window-min-height' or
1795`window-min-width' settings. IGNORE equal `safe' means live 1804`window-min-width' settings. If IGNORE equals `safe', live
1796windows may get as small as `window-safe-min-height' lines and 1805windows may get as small as `window-safe-min-height' lines and
1797`window-safe-min-width' columns. IGNORE any window means ignore 1806`window-safe-min-width' columns. If IGNORE is a window, ignore
1798restrictions for that window only. 1807restrictions for that window only. Any other non-nil value means
1808ignore all of the above restrictions for all windows.
1799 1809
1800Optional arguments TRAIL and EDGE, when non-nil, refine the set 1810Optional arguments TRAIL and EDGE, when non-nil, refine the set
1801of windows that shall be resized. If TRAIL equals `before', 1811of windows that shall be resized. If TRAIL equals `before',
@@ -1891,12 +1901,13 @@ preferably only resize windows adjacent to EDGE."
1891Optional argument HORIZONTAL non-nil means resize WINDOW 1901Optional argument HORIZONTAL non-nil means resize WINDOW
1892horizontally by DELTA columns. 1902horizontally by DELTA columns.
1893 1903
1894Optional argument IGNORE non-nil means ignore any restrictions 1904Optional argument IGNORE non-nil means ignore restrictions
1895imposed by fixed size windows, `window-min-height' or 1905imposed by fixed size windows, `window-min-height' or
1896`window-min-width' settings. IGNORE equal `safe' means live 1906`window-min-width' settings. If IGNORE equals `safe', live
1897windows may get as small as `window-safe-min-height' lines and 1907windows may get as small as `window-safe-min-height' lines and
1898`window-safe-min-width' columns. IGNORE any window means ignore 1908`window-safe-min-width' columns. If IGNORE is a window, ignore
1899restrictions for that window only. 1909restrictions for that window only. Any other non-nil value
1910means ignore all of the above restrictions for all windows.
1900 1911
1901Optional argument ADD non-nil means add DELTA to the new total 1912Optional argument ADD non-nil means add DELTA to the new total
1902size of WINDOW. 1913size of WINDOW.
@@ -1986,7 +1997,7 @@ any windows."
1986Optional argument HORIZONTAL non-nil means move WINDOW's right 1997Optional argument HORIZONTAL non-nil means move WINDOW's right
1987edge by DELTA columns. WINDOW defaults to the selected window. 1998edge by DELTA columns. WINDOW defaults to the selected window.
1988 1999
1989If DELTA is greater zero, then move the edge downwards or to the 2000If DELTA is greater than zero, move the edge downwards or to the
1990right. If DELTA is less than zero, move the edge upwards or to 2001right. If DELTA is less than zero, move the edge upwards or to
1991the left. If the edge can't be moved by DELTA lines or columns, 2002the left. If the edge can't be moved by DELTA lines or columns,
1992move it as far as possible in the desired direction." 2003move it as far as possible in the desired direction."
@@ -2091,7 +2102,7 @@ move it as far as possible in the desired direction."
2091 (error "Failed adjusting window %s" window))))))) 2102 (error "Failed adjusting window %s" window)))))))
2092 2103
2093(defun enlarge-window (delta &optional horizontal) 2104(defun enlarge-window (delta &optional horizontal)
2094 "Make selected window DELTA lines taller. 2105 "Make the selected window DELTA lines taller.
2095Interactively, if no argument is given, make the selected window 2106Interactively, if no argument is given, make the selected window
2096one line taller. If optional argument HORIZONTAL is non-nil, 2107one line taller. If optional argument HORIZONTAL is non-nil,
2097make selected window wider by DELTA columns. If DELTA is 2108make selected window wider by DELTA columns. If DELTA is
@@ -2112,7 +2123,7 @@ Return nil."
2112 horizontal)))) 2123 horizontal))))
2113 2124
2114(defun shrink-window (delta &optional horizontal) 2125(defun shrink-window (delta &optional horizontal)
2115 "Make selected window DELTA lines smaller. 2126 "Make the selected window DELTA lines smaller.
2116Interactively, if no argument is given, make the selected window 2127Interactively, if no argument is given, make the selected window
2117one line smaller. If optional argument HORIZONTAL is non-nil, 2128one line smaller. If optional argument HORIZONTAL is non-nil,
2118make selected window narrower by DELTA columns. If DELTA is 2129make selected window narrower by DELTA columns. If DELTA is