diff options
| author | Chong Yidong | 2011-11-19 19:11:38 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-11-19 19:11:38 +0800 |
| commit | 7bf54975caf75e4ad83d8cc2eb62709cf5598022 (patch) | |
| tree | d7bebe193f182fa76fd8377f3be07dc8c16bcbac | |
| parent | df05a53c61885a7d11265e36723742c12ab1a061 (diff) | |
| download | emacs-7bf54975caf75e4ad83d8cc2eb62709cf5598022.tar.gz emacs-7bf54975caf75e4ad83d8cc2eb62709cf5598022.zip | |
More updates to Window chapter of Lisp manual.
* doc/lispref/windows.texi (Splitting Windows): Clarify role of window
parameters in split-window. Shorten the example.
(Deleting Windows): Rewrite intro to handle internal windows. Fix
delete-windows-on doc.
(Selecting Windows): Copyedits.
| -rw-r--r-- | doc/lispref/ChangeLog | 8 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 478 |
2 files changed, 209 insertions, 277 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 0fa50492481..232ddff6d3f 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-11-19 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * windows.texi (Splitting Windows): Clarify role of window | ||
| 4 | parameters in split-window. Shorten the example. | ||
| 5 | (Deleting Windows): Rewrite intro to handle internal windows. Fix | ||
| 6 | delete-windows-on doc. | ||
| 7 | (Selecting Windows): Copyedits. | ||
| 8 | |||
| 1 | 2011-11-17 Martin Rudalics <rudalics@gmx.at> | 9 | 2011-11-17 Martin Rudalics <rudalics@gmx.at> |
| 2 | 10 | ||
| 3 | * windows.texi (Resizing Windows, Splitting Windows) | 11 | * windows.texi (Resizing Windows, Splitting Windows) |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 8c99a06909b..4e67fa6d740 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -110,6 +110,7 @@ including for the case where @var{object} is a deleted window. | |||
| 110 | @end defun | 110 | @end defun |
| 111 | 111 | ||
| 112 | @cindex selected window | 112 | @cindex selected window |
| 113 | @cindex window selected within a frame | ||
| 113 | In each frame, at any time, exactly one Emacs window is designated | 114 | In each frame, at any time, exactly one Emacs window is designated |
| 114 | as @dfn{selected within the frame}. For the selected frame, that | 115 | as @dfn{selected within the frame}. For the selected frame, that |
| 115 | window is called the @dfn{selected window}---the one in which most | 116 | window is called the @dfn{selected window}---the one in which most |
| @@ -774,22 +775,24 @@ properties from it, including margins and scroll bars. If | |||
| 774 | @var{window} is an internal window, the new window inherits the | 775 | @var{window} is an internal window, the new window inherits the |
| 775 | properties of the window selected within @var{window}'s frame. | 776 | properties of the window selected within @var{window}'s frame. |
| 776 | 777 | ||
| 777 | If the variable @code{ignore-window-parameters} is non-@code{nil} | 778 | The behavior of this function may be altered by the window parameters |
| 778 | (@pxref{Window Parameters}), this function ignores window parameters. | 779 | of @var{window}, so long as the variable |
| 779 | Otherwise, it consults the @code{split-window} parameter of | 780 | @code{ignore-window-parameters} is non-@code{nil}. If the value of |
| 780 | @var{window}; if this is @code{t}, it splits the window disregarding | 781 | the @code{split-window} window parameter is @code{t}, this function |
| 781 | any other window parameters. If the @code{split-window} parameter | 782 | ignores all other window parameters. Otherwise, if the value of the |
| 782 | specifies a function, that function is called with the arguments | 783 | @code{split-window} window parameter is a function, that function is |
| 783 | @var{window}, @var{size}, and @var{side} to split @var{window}, in | 784 | called with the arguments @var{window}, @var{size}, and @var{side}, in |
| 784 | lieu of the usual action of @code{split-window}. | 785 | lieu of the usual action of @code{split-window}. Otherwise, this |
| 786 | function obeys the @code{window-atom} or @code{window-side} window | ||
| 787 | parameter, if any. @xref{Window Parameters}. | ||
| 785 | @end deffn | 788 | @end deffn |
| 786 | 789 | ||
| 787 | As an example, we show a combination of @code{split-window} calls | 790 | As an example, here is a sequence of @code{split-window} calls that |
| 788 | that yields the window configuration discussed in @ref{Windows and | 791 | yields the window configuration discussed in @ref{Windows and Frames}. |
| 789 | Frames}. This example demonstrates splitting a live window as well as | 792 | This example demonstrates splitting a live window as well as splitting |
| 790 | splitting an internal window. We begin with a frame containing a | 793 | an internal window. We begin with a frame containing a single window |
| 791 | single window (a live root window), which we denote by @var{W4}. | 794 | (a live root window), which we denote by @var{W4}. Calling |
| 792 | Calling @code{(split-window W3)} yields this window configuration: | 795 | @code{(split-window W3)} yields this window configuration: |
| 793 | 796 | ||
| 794 | @smallexample | 797 | @smallexample |
| 795 | @group | 798 | @group |
| @@ -841,9 +844,6 @@ A new live window @var{W2} is created, to the left of the internal | |||
| 841 | window @var{W3}. A new internal window @var{W1} is created, becoming | 844 | window @var{W3}. A new internal window @var{W1} is created, becoming |
| 842 | the new root window. | 845 | the new root window. |
| 843 | 846 | ||
| 844 | The following two options can be used to modify the operation of | ||
| 845 | @code{split-window}. | ||
| 846 | |||
| 847 | @defopt window-combination-resize | 847 | @defopt window-combination-resize |
| 848 | If this variable is @code{nil}, @code{split-window} can only split a | 848 | If this variable is @code{nil}, @code{split-window} can only split a |
| 849 | window (denoted by @var{window}) if @var{window}'s screen area is | 849 | window (denoted by @var{window}) if @var{window}'s screen area is |
| @@ -854,18 +854,17 @@ If this variable is non-@code{nil}, @code{split-window} tries to | |||
| 854 | resize all windows that are part of the same combination as | 854 | resize all windows that are part of the same combination as |
| 855 | @var{window}, in order to accommodate the new window. In particular, | 855 | @var{window}, in order to accommodate the new window. In particular, |
| 856 | this may allow @code{split-window} to succeed even if @var{window} is | 856 | this may allow @code{split-window} to succeed even if @var{window} is |
| 857 | a fixed-size window or too small to ordinarily split. | 857 | a fixed-size window or too small to ordinarily split. Furthermore, |
| 858 | 858 | subsequently resizing or deleting @var{window} may resize all other | |
| 859 | Also if this variable is non-@code{nil}, subsequent resizing and | 859 | windows in its combination. |
| 860 | deleting @var{window} will usually affect @emph{all} windows in | ||
| 861 | @var{window}'s combination. | ||
| 862 | 860 | ||
| 863 | The setting of this variable has no effect if | 861 | This variable has no effect if @code{window-combination-limit} is |
| 864 | @code{window-combination-limit} (see below) is non-@code{nil}. | 862 | non-@code{nil} (see below). |
| 865 | @end defopt | 863 | @end defopt |
| 866 | 864 | ||
| 867 | To illustrate the use of @code{window-combination-resize} consider the | 865 | To illustrate the effect of @code{window-combination-resize}, |
| 868 | following window configuration: | 866 | consider the following window configuration: |
| 867 | |||
| 869 | @smallexample | 868 | @smallexample |
| 870 | @group | 869 | @group |
| 871 | ______________________________________ | 870 | ______________________________________ |
| @@ -886,9 +885,10 @@ following window configuration: | |||
| 886 | @end group | 885 | @end group |
| 887 | @end smallexample | 886 | @end smallexample |
| 888 | 887 | ||
| 889 | Splitting window @code{W3} with @code{window-combination-resize} | 888 | @noindent |
| 890 | @code{nil} produces a configuration where the size of @code{W2} remains | 889 | If @code{window-combination-resize} is @code{nil}, splitting window |
| 891 | unchanged: | 890 | @code{W3} leaves the size of @code{W2} unchanged: |
| 891 | |||
| 892 | @smallexample | 892 | @smallexample |
| 893 | @group | 893 | @group |
| 894 | ______________________________________ | 894 | ______________________________________ |
| @@ -909,8 +909,11 @@ unchanged: | |||
| 909 | @end group | 909 | @end group |
| 910 | @end smallexample | 910 | @end smallexample |
| 911 | 911 | ||
| 912 | Splitting @code{W3} with @code{window-combination-resize} non-@code{nil} | 912 | @noindent |
| 913 | instead steals the space for @code{W4} from both @code{W2} and @code{W3}: | 913 | If @code{window-combination-resize} is non-@code{nil}, splitting |
| 914 | @code{W3} instead leaves all three live windows with approximately the | ||
| 915 | same height: | ||
| 916 | |||
| 914 | @smallexample | 917 | @smallexample |
| 915 | @group | 918 | @group |
| 916 | ______________________________________ | 919 | ______________________________________ |
| @@ -932,53 +935,51 @@ instead steals the space for @code{W4} from both @code{W2} and @code{W3}: | |||
| 932 | @end smallexample | 935 | @end smallexample |
| 933 | 936 | ||
| 934 | @defopt window-combination-limit | 937 | @defopt window-combination-limit |
| 935 | If this variable is @code{nil}, @code{split-window} creates a new parent | 938 | If the value of this variable is @code{t}, the @code{split-window} |
| 936 | window if and only if the old window has no parent window or shall be | 939 | function always creates a new internal window. If the value is |
| 937 | split orthogonally to the combination it is part of. If this variable | 940 | @code{nil}, the new live window is allowed to share the existing |
| 938 | is @code{t}, @code{split-window} always creates a new parent window. If | 941 | parent window, if one exists, provided the split occurs in the same |
| 939 | this variable is always @code{t}, a frame's window tree is a binary tree | 942 | direction as the existing window combination (otherwise, a new |
| 940 | so every window but the frame's root window has exactly one sibling. | 943 | internal window is created anyway). The default is @code{nil}. Other |
| 941 | Other values are reserved for future use. | 944 | values are reserved for future use. |
| 942 | 945 | ||
| 943 | The value of this variable is also assigned to the combination-limit | 946 | Thus, if the value is always @code{t}, each window tree is a binary |
| 944 | status of the new parent window. The combination-limit status of any | 947 | tree: each window except the root window has exactly one sibling. |
| 945 | window can be retrieved via the function @code{window-combination-limit} | 948 | |
| 946 | and altered by the function @code{set-window-combination-limit}, see | 949 | Furthermore, @code{split-window} calls |
| 947 | below. | 950 | @code{set-window-combination-limit} on the newly-created internal |
| 951 | window, recording the current value of this variable. This affects | ||
| 952 | how the window tree is rearranged when the child windows are deleted | ||
| 953 | (see below). | ||
| 948 | @end defopt | 954 | @end defopt |
| 949 | 955 | ||
| 950 | @defun window-combination-limit &optional window | 956 | @cindex window combination limit |
| 951 | This function returns the combination-limit status of @var{window}. The | 957 | @defun set-window-combination-limit window status |
| 952 | argument @var{window} can be any window and defaults to the selected | 958 | This functions sets the @dfn{combination limit} of the window |
| 953 | one. Note, however, that the combination-limit status is currently | 959 | @var{window} to @var{status}. This value can be retrieved via the |
| 954 | meaningful for internal windows only. | 960 | function @code{window-combination-limit}. See below for its effects; |
| 955 | 961 | note that it is only meaningful for internal windows. The | |
| 956 | @cindex combination-limit status | 962 | @code{split-window} function automatically calls this function, |
| 957 | The @dfn{combination-limit status} of a window specifies whether that | 963 | passing the value of the variable @code{window-combination-limit} as |
| 958 | window may be removed and its child windows recombined with that | 964 | @var{status}. |
| 959 | window's siblings when such a sibling's child window is deleted. The | 965 | @end defun |
| 960 | combination-limit status is initially assigned by @code{split-window} | 966 | |
| 961 | from the current value of the variable @code{window-combination-limit} | 967 | @defun window-combination-limit window |
| 962 | (see above) and can be reset by the function | 968 | This function returns the combination limit for @var{window}. |
| 963 | @code{set-window-combination-limit} (see below). | 969 | |
| 964 | 970 | The combination limit is meaningful only for an internal window. If | |
| 965 | If the return value is @code{nil}, child windows of @var{window} may be | 971 | it is @code{nil}, then Emacs is allowed to automatically delete |
| 966 | recombined with @var{window}'s siblings when a window gets deleted. A | 972 | @var{window}, in response to a window deletion, in order to group the |
| 967 | return value of @code{nil} means that child windows of @var{window} are | 973 | child windows of @var{window} with the child windows of one of its |
| 968 | never (re-)combined with @var{window}'s siblings in such a case. | 974 | siblings to form a new window combination. If the combination limit |
| 969 | @end defun | 975 | is @code{t}, the child windows of @var{window} are never automatically |
| 970 | 976 | re-combined with its siblings'. | |
| 971 | @defun set-window-combination-limit window &optional status | 977 | @end defun |
| 972 | This functions sets the combination-limit status (see above) of | 978 | |
| 973 | @var{window} to @var{status}. The argument @var{window} can be any | 979 | To illustrate the effect of @code{window-combination-limit}, |
| 974 | window and defaults to the selected one. Note that setting the | 980 | consider the following configuration (throughout this example, we will |
| 975 | combination-limit status is meaningful for internal windows only. The | 981 | assume that @code{window-combination-resize} is @code{nil}): |
| 976 | return value is @var{status}. | 982 | |
| 977 | @end defun | ||
| 978 | |||
| 979 | To illustrate the use of @code{window-combination-limit} consider the | ||
| 980 | following configuration (throughout the following examples we shall | ||
| 981 | assume that @code{window-combination-resize} invariantly is @code{nil}). | ||
| 982 | @smallexample | 983 | @smallexample |
| 983 | @group | 984 | @group |
| 984 | ______________________________________ | 985 | ______________________________________ |
| @@ -999,31 +1000,10 @@ assume that @code{window-combination-resize} invariantly is @code{nil}). | |||
| 999 | @end group | 1000 | @end group |
| 1000 | @end smallexample | 1001 | @end smallexample |
| 1001 | 1002 | ||
| 1002 | Splitting @code{W2} into two windows above each other with | 1003 | @noindent |
| 1003 | @code{window-combination-limit} equal @code{nil} will get you a | 1004 | If @code{window-combination-limit} is @code{nil}, splitting @code{W2} |
| 1004 | configuration like: | 1005 | into two windows, one above the other, yields |
| 1005 | @smallexample | ||
| 1006 | @group | ||
| 1007 | ______________________________________ | ||
| 1008 | | ____________________________________ | | ||
| 1009 | || || | ||
| 1010 | || || | ||
| 1011 | ||_________________W2_________________|| | ||
| 1012 | | ____________________________________ | | ||
| 1013 | || || | ||
| 1014 | || || | ||
| 1015 | ||_________________W4_________________|| | ||
| 1016 | | ____________________________________ | | ||
| 1017 | || || | ||
| 1018 | || || | ||
| 1019 | ||_________________W3_________________|| | ||
| 1020 | |__________________W1__________________| | ||
| 1021 | |||
| 1022 | @end group | ||
| 1023 | @end smallexample | ||
| 1024 | 1006 | ||
| 1025 | If you now enlarge window @code{W4}, Emacs steals the necessary space | ||
| 1026 | from window @code{W3} resulting in a configuration like: | ||
| 1027 | @smallexample | 1007 | @smallexample |
| 1028 | @group | 1008 | @group |
| 1029 | ______________________________________ | 1009 | ______________________________________ |
| @@ -1034,43 +1014,24 @@ from window @code{W3} resulting in a configuration like: | |||
| 1034 | | ____________________________________ | | 1014 | | ____________________________________ | |
| 1035 | || || | 1015 | || || |
| 1036 | || || | 1016 | || || |
| 1037 | || || | ||
| 1038 | ||_________________W4_________________|| | 1017 | ||_________________W4_________________|| |
| 1039 | | ____________________________________ | | 1018 | | ____________________________________ | |
| 1040 | || || | 1019 | || || |
| 1020 | || || | ||
| 1041 | ||_________________W3_________________|| | 1021 | ||_________________W3_________________|| |
| 1042 | |__________________W1__________________| | 1022 | |__________________W1__________________| |
| 1043 | 1023 | ||
| 1044 | @end group | 1024 | @end group |
| 1045 | @end smallexample | 1025 | @end smallexample |
| 1046 | 1026 | ||
| 1047 | Deleting window @code{W4}, will return its space to @code{W2} as | 1027 | @noindent |
| 1048 | follows: | 1028 | The newly-created window, @code{W4}, shares the same internal window |
| 1049 | @smallexample | 1029 | @code{W1}. If @code{W4} is resized, it is allowed to resize the other |
| 1050 | @group | 1030 | live window, @code{W3}. |
| 1051 | ______________________________________ | ||
| 1052 | | ____________________________________ | | ||
| 1053 | || || | ||
| 1054 | || || | ||
| 1055 | || || | ||
| 1056 | || || | ||
| 1057 | || || | ||
| 1058 | || || | ||
| 1059 | || || | ||
| 1060 | ||_________________W2_________________|| | ||
| 1061 | | ____________________________________ | | ||
| 1062 | || || | ||
| 1063 | ||_________________W3_________________|| | ||
| 1064 | |__________________W1__________________| | ||
| 1065 | 1031 | ||
| 1066 | @end group | 1032 | If @code{window-combination-limit} is @code{t}, splitting @code{W2} |
| 1067 | @end smallexample | 1033 | in the initial configuration would instead have produced this: |
| 1068 | 1034 | ||
| 1069 | Hence, with respect to the initial configuration, window @code{W2} has | ||
| 1070 | grown at the expense of window @code{W3}. If, however, in the initial | ||
| 1071 | configuration you had split @code{W2} with | ||
| 1072 | @code{window-combination-limit} bound to @code{t}, a new internal window | ||
| 1073 | @code{W5} would have been created as depicted below. | ||
| 1074 | @smallexample | 1035 | @smallexample |
| 1075 | @group | 1036 | @group |
| 1076 | ______________________________________ | 1037 | ______________________________________ |
| @@ -1091,143 +1052,110 @@ configuration you had split @code{W2} with | |||
| 1091 | @end group | 1052 | @end group |
| 1092 | @end smallexample | 1053 | @end smallexample |
| 1093 | 1054 | ||
| 1094 | Enlarging @code{W4} would now have stolen the necessary space from | 1055 | @noindent |
| 1095 | @code{W2} instead of @code{W3} as | 1056 | A new internal window @code{W5} has been created; its children are |
| 1096 | @smallexample | 1057 | @code{W2} and the new live window @code{W4}. Now, @code{W2} is the |
| 1097 | @group | 1058 | only sibling of @code{W4}, so resizing @code{W4} will resize |
| 1098 | ______________________________________ | 1059 | @code{W2}, leaving @code{W3} unaffected. |
| 1099 | | ____________________________________ | | ||
| 1100 | || __________________________________ || | ||
| 1101 | |||________________W2________________||| | ||
| 1102 | || __________________________________ || | ||
| 1103 | ||| ||| | ||
| 1104 | ||| ||| | ||
| 1105 | |||________________W4________________||| | ||
| 1106 | ||_________________W5_________________|| | ||
| 1107 | | ____________________________________ | | ||
| 1108 | || || | ||
| 1109 | || || | ||
| 1110 | ||_________________W3_________________|| | ||
| 1111 | |__________________W1__________________| | ||
| 1112 | |||
| 1113 | @end group | ||
| 1114 | @end smallexample | ||
| 1115 | 1060 | ||
| 1116 | and the subsequent deletion of @code{W4} would have restored the initial | 1061 | For interactive use, Emacs provides two commands which always split |
| 1117 | configuration. | 1062 | the selected window. These call @code{split-window} internally. |
| 1118 | 1063 | ||
| 1119 | For interactive use, Emacs provides two commands which always split the | 1064 | @deffn Command split-window-right &optional size |
| 1120 | selected window. | 1065 | This function splits the selected window into two side-by-side |
| 1066 | windows, putting the selected window on the left. If @var{size} is | ||
| 1067 | positive, the left window gets @var{size} columns; if @var{size} is | ||
| 1068 | negative, the right window gets @minus{}@var{size} columns. | ||
| 1069 | @end deffn | ||
| 1121 | 1070 | ||
| 1122 | @deffn Command split-window-below &optional size | 1071 | @deffn Command split-window-below &optional size |
| 1123 | This function splits the selected window into two windows, one above the | 1072 | This function splits the selected window into two windows, one above |
| 1124 | other, leaving the upper of the two windows selected, with @var{size} | 1073 | the other, leaving the upper window selected. If @var{size} is |
| 1125 | lines. (If @var{size} is negative, then the lower of the two windows | 1074 | positive, the upper window gets @var{size} lines; if @var{size} is |
| 1126 | gets @minus{}@var{size} lines and the upper window gets the rest, but | 1075 | negative, the lower window gets @minus{}@var{size} lines. |
| 1127 | the upper window is still the one selected.) However, if | ||
| 1128 | @code{split-window-keep-point} (see below) is @code{nil}, then either | ||
| 1129 | window can be selected. | ||
| 1130 | |||
| 1131 | In other respects, this function is similar to @code{split-window}. | ||
| 1132 | In particular, the upper window is the original one and the return value | ||
| 1133 | is the new, lower window. | ||
| 1134 | @end deffn | 1076 | @end deffn |
| 1135 | 1077 | ||
| 1136 | @defopt split-window-keep-point | 1078 | @defopt split-window-keep-point |
| 1137 | If this variable is non-@code{nil} (the default), then | 1079 | If the value of this variable is non-@code{nil} (the default), |
| 1138 | @code{split-window-below} behaves as described above. | 1080 | @code{split-window-below} behaves as described above. |
| 1139 | 1081 | ||
| 1140 | If it is @code{nil}, then @code{split-window-below} adjusts point | 1082 | If it is @code{nil}, @code{split-window-below} adjusts point in each |
| 1141 | in each of the two windows to avoid scrolling. (This is useful on | 1083 | of the two windows to minimize redisplay. (This is useful on slow |
| 1142 | slow terminals.) It selects whichever window contains the screen line | 1084 | terminals.) It selects whichever window contains the screen line that |
| 1143 | that point was previously on. Other functions are not affected by | 1085 | point was previously on. Note that this only affects |
| 1144 | this variable. | 1086 | @code{split-window-below}, not the lower-level @code{split-window} |
| 1087 | function. | ||
| 1145 | @end defopt | 1088 | @end defopt |
| 1146 | 1089 | ||
| 1147 | @deffn Command split-window-right &optional size | ||
| 1148 | This function splits the selected window into two windows | ||
| 1149 | side-by-side, leaving the selected window on the left with @var{size} | ||
| 1150 | columns. If @var{size} is negative, the rightmost window gets | ||
| 1151 | @minus{}@var{size} columns, but the leftmost window still remains | ||
| 1152 | selected. | ||
| 1153 | @end deffn | ||
| 1154 | |||
| 1155 | |||
| 1156 | @node Deleting Windows | 1090 | @node Deleting Windows |
| 1157 | @section Deleting Windows | 1091 | @section Deleting Windows |
| 1158 | @cindex deleting windows | 1092 | @cindex deleting windows |
| 1159 | 1093 | ||
| 1160 | A window remains visible on its frame unless you @dfn{delete} it by | 1094 | @dfn{Deleting} a window removes it from the frame's window tree. If |
| 1161 | calling certain functions that delete windows. A deleted window cannot | 1095 | the window is a live window, it disappears from the screen. If the |
| 1162 | appear on the screen, but continues to exist as a Lisp object until | 1096 | window is an internal window, its child windows are deleted too. |
| 1163 | there are no references to it. There is no way to cancel the deletion | 1097 | |
| 1164 | of a window aside from restoring a saved window configuration | 1098 | Even after a window is deleted, it continues to exist as a Lisp |
| 1165 | (@pxref{Window Configurations}). Restoring a window configuration also | 1099 | object, until there are no more references to it. Window deletion can |
| 1166 | deletes any windows that aren't part of that configuration. Erroneous | 1100 | be reversed, by restoring a saved window configuration (@pxref{Window |
| 1167 | information may result from using a deleted window as if it were live. | 1101 | Configurations}). |
| 1168 | 1102 | ||
| 1169 | @deffn Command delete-window &optional window | 1103 | @deffn Command delete-window &optional window |
| 1170 | This function removes @var{window} from display and returns @code{nil}. | 1104 | This function removes @var{window} from display and returns |
| 1171 | The argument @var{window} can denote any window and defaults to the | 1105 | @code{nil}. If @var{window} is omitted or @code{nil}, it defaults to |
| 1172 | selected one. An error is signaled if @var{window} is the only window | 1106 | the selected window. If deleting the window would leave no more |
| 1173 | on its frame. Hence @var{window} must have at least one sibling window | 1107 | windows in the window tree (e.g. if it is the only live window in the |
| 1174 | (@pxref{Windows and Frames}) in order to get deleted. If @var{window} | 1108 | frame), an error is signaled. |
| 1175 | is the selected window on its frame, this function selects the most | 1109 | |
| 1176 | recently selected live window on that frame instead. | 1110 | By default, the space taken up by @var{window} is given to one of its |
| 1177 | 1111 | adjacent sibling windows, if any. However, if the variable | |
| 1178 | If the variable @code{ignore-window-parameters} (@pxref{Window | 1112 | @code{window-combination-resize} is non-@code{nil}, the space is |
| 1179 | Parameters}) is non-@code{nil}, this function ignores all parameters of | 1113 | proportionally distributed among any remaining windows in the window |
| 1180 | @var{window}. Otherwise, if the @code{delete-window} parameter of | 1114 | combination. @xref{Splitting Windows}. |
| 1181 | @var{window} is @code{t}, it deletes the window disregarding other | 1115 | |
| 1182 | window parameters. If the @code{delete-window} parameter specifies a | 1116 | The behavior of this function may be altered by the window parameters |
| 1183 | function, that function is called with @var{window} as its sole | 1117 | of @var{window}, so long as the variable |
| 1184 | argument. | 1118 | @code{ignore-window-parameters} is non-@code{nil}. If the value of |
| 1185 | 1119 | the @code{delete-window} window parameter is @code{t}, this function | |
| 1186 | If @code{window-combination-resize} (@pxref{Splitting Windows}) is | 1120 | ignores all other window parameters. Otherwise, if the value of the |
| 1187 | @code{nil}, the space @var{window} took up is given to its left sibling | 1121 | @code{delete-window} window parameter is a function, that function is |
| 1188 | if such a window exists and to its right sibling otherwise. If | 1122 | called with the argument @var{window}, in lieu of the usual action of |
| 1189 | @code{window-combination-resize} is non-@code{nil}, the space of | 1123 | @code{delete-window}. Otherwise, this function obeys the |
| 1190 | @var{window} is proportionally distributed among the remaining windows | 1124 | @code{window-atom} or @code{window-side} window parameter, if any. |
| 1191 | in the same combination. | 1125 | @xref{Window Parameters}. |
| 1192 | @end deffn | 1126 | @end deffn |
| 1193 | 1127 | ||
| 1194 | @deffn Command delete-other-windows &optional window | 1128 | @deffn Command delete-other-windows &optional window |
| 1195 | This function makes @var{window} fill its frame and returns @code{nil}. | 1129 | This function makes @var{window} fill its frame, by deleting other |
| 1196 | The argument @var{window} can denote an arbitrary window and defaults to | 1130 | windows as necessary. If @var{window} is omitted or @code{nil}, it |
| 1197 | the selected one. Upon exit, @var{window} will be the selected window | 1131 | defaults to the selected window. The return value is @code{nil}. |
| 1198 | on its frame. | 1132 | |
| 1199 | 1133 | The behavior of this function may be altered by the window parameters | |
| 1200 | If the variable @code{ignore-window-parameters} (@pxref{Window | 1134 | of @var{window}, so long as the variable |
| 1201 | Parameters}) is non-@code{nil}, this function ignores all parameters of | 1135 | @code{ignore-window-parameters} is non-@code{nil}. If the value of |
| 1202 | @var{window}. Otherwise, if the @code{delete-other-windows} parameter | 1136 | the @code{delete-other-windows} window parameter is @code{t}, this |
| 1203 | of @var{window} equals @code{t}, it deletes all other windows | 1137 | function ignores all other window parameters. Otherwise, if the value |
| 1204 | disregarding any remaining window parameters. If the | 1138 | of the @code{delete-other-windows} window parameter is a function, |
| 1205 | @code{delete-other-windows} parameter of @var{window} specifies a | 1139 | that function is called with the argument @var{window}, in lieu of the |
| 1206 | function, it calls that function with @var{window} as its sole argument. | 1140 | usual action of @code{delete-other-windows}. Otherwise, this function |
| 1141 | obeys the @code{window-atom} or @code{window-side} window parameter, | ||
| 1142 | if any. @xref{Window Parameters}. | ||
| 1207 | @end deffn | 1143 | @end deffn |
| 1208 | 1144 | ||
| 1209 | @deffn Command delete-windows-on &optional buffer-or-name frame | 1145 | @deffn Command delete-windows-on &optional buffer-or-name frame |
| 1210 | This function deletes all windows showing @var{buffer-or-name}. If | 1146 | This function deletes all windows showing @var{buffer-or-name}, by |
| 1211 | there are no windows showing @var{buffer-or-name}, it does nothing. | 1147 | calling @code{delete-window} on those windows. @var{buffer-or-name} |
| 1212 | The optional argument @var{buffer-or-name} may be a buffer or the name | 1148 | should be a buffer, or the name of a buffer; if omitted or @code{nil}, |
| 1213 | of an existing buffer and defaults to the current buffer. Invoking | 1149 | it defaults to the current buffer. If there are no windows showing |
| 1214 | this command on a minibuffer signals an error. | 1150 | the specified buffer, this function does nothing. If the specified |
| 1215 | 1151 | buffer is a minibuffer, an error is signaled. | |
| 1216 | The function @code{delete-windows-on} operates by calling | 1152 | |
| 1217 | @code{delete-window} for each window showing @var{buffer-or-name}. If a | 1153 | If there is a dedicated window showing the buffer, and that window is |
| 1218 | frame has several windows showing different buffers, then those showing | 1154 | the only one on its frame, this function also deletes that frame if it |
| 1219 | @var{buffer-or-name} are removed, and the other windows expand to fill | 1155 | is not the only frame on the terminal. |
| 1220 | the space. | 1156 | |
| 1221 | 1157 | The optional argument @var{frame} specifies which frames to operate | |
| 1222 | If all windows in some frame are showing @var{buffer-or-name} (including | 1158 | on: |
| 1223 | the case where there is only one window), then that frame is deleted | ||
| 1224 | provided there are other frames left. | ||
| 1225 | |||
| 1226 | The optional argument @var{frame} specifies which frames to operate on. | ||
| 1227 | This function does not use it in quite the same way as the other | ||
| 1228 | functions which scan all live windows (@pxref{Cyclic Window Ordering}); | ||
| 1229 | specifically, the values @code{t} and @code{nil} have the opposite of | ||
| 1230 | their meanings in the other functions. Here are the full details: | ||
| 1231 | 1159 | ||
| 1232 | @itemize @bullet | 1160 | @itemize @bullet |
| 1233 | @item @code{nil} | 1161 | @item @code{nil} |
| @@ -1241,34 +1169,37 @@ means operate on all visible or iconified frames. | |||
| 1241 | @item A frame | 1169 | @item A frame |
| 1242 | means operate on that frame. | 1170 | means operate on that frame. |
| 1243 | @end itemize | 1171 | @end itemize |
| 1244 | @end deffn | ||
| 1245 | 1172 | ||
| 1173 | Note that this argument does not have the same meaning as in other | ||
| 1174 | functions which scan all live windows (@pxref{Cyclic Window | ||
| 1175 | Ordering}). Specifically, the values @code{t} and @code{nil} have the | ||
| 1176 | opposite of their meanings in those other functions. | ||
| 1177 | @end deffn | ||
| 1246 | 1178 | ||
| 1247 | @node Selecting Windows | 1179 | @node Selecting Windows |
| 1248 | @section Selecting Windows | 1180 | @section Selecting Windows |
| 1249 | @cindex selecting a window | 1181 | @cindex selecting a window |
| 1250 | 1182 | ||
| 1251 | @defun select-window window &optional norecord | 1183 | @defun select-window window &optional norecord |
| 1252 | This function makes @var{window} the selected window, see @ref{Basic | 1184 | This function makes @var{window} the selected window, as well as the |
| 1253 | Windows}. Unless @var{window} already is the selected window, this also | 1185 | window selected within its frame (@pxref{Basic Windows}). |
| 1254 | makes @var{window}'s buffer (@pxref{Buffers and Windows}) the current | 1186 | @var{window} must be a live winow. Unless @var{window} already is the |
| 1255 | buffer. Moreover, the cursor for selected windows will be displayed in | 1187 | selected window, its buffer becomes the current buffer (@pxref{Buffers |
| 1256 | @var{window} after the next redisplay. This function returns | 1188 | and Windows}). The return value is @var{window}. |
| 1257 | @var{window}. | ||
| 1258 | 1189 | ||
| 1259 | Normally, @var{window}'s selected buffer is moved to the front of the | 1190 | By default, this function also moves @var{window}'s selected buffer to |
| 1260 | buffer list (@pxref{The Buffer List}) and @var{window} becomes the most | 1191 | the front of the buffer list (@pxref{The Buffer List}), and makes |
| 1261 | recently selected window. But if the optional argument @var{norecord} | 1192 | @var{window} the most recently selected window. However, if the |
| 1262 | is non-@code{nil}, the buffer list remains unchanged and @var{window} | 1193 | optional argument @var{norecord} is non-@code{nil}, these additional |
| 1263 | does not become the most recently selected one. | 1194 | actions are omitted. |
| 1264 | @end defun | 1195 | @end defun |
| 1265 | 1196 | ||
| 1266 | @cindex most recently selected windows | 1197 | @cindex most recently selected windows |
| 1267 | The sequence of calls to @code{select-window} with a non-@code{nil} | 1198 | The sequence of calls to @code{select-window} with a non-@code{nil} |
| 1268 | @var{norecord} argument determines an ordering of windows by their | 1199 | @var{norecord} argument determines an ordering of windows by their |
| 1269 | selection time. The function @code{get-lru-window} can be used to | 1200 | selection time. The function @code{get-lru-window} can be used to |
| 1270 | retrieve the least recently selected live window in this ordering, see | 1201 | retrieve the least recently selected live window (@pxref{Cyclic Window |
| 1271 | @ref{Cyclic Window Ordering}. | 1202 | Ordering}). |
| 1272 | 1203 | ||
| 1273 | @defmac save-selected-window forms@dots{} | 1204 | @defmac save-selected-window forms@dots{} |
| 1274 | This macro records the selected frame, as well as the selected window | 1205 | This macro records the selected frame, as well as the selected window |
| @@ -1300,33 +1231,26 @@ The order of recently selected windows and the buffer list are not | |||
| 1300 | changed by this macro. | 1231 | changed by this macro. |
| 1301 | @end defmac | 1232 | @end defmac |
| 1302 | 1233 | ||
| 1303 | @cindex frame selected window | 1234 | @defun frame-selected-window &optional frame |
| 1304 | @cindex window selected within frame | 1235 | This function returns the window on @var{frame} that is selected |
| 1305 | Earlier (@pxref{Basic Windows}) we mentioned that at any time, exactly | 1236 | within that frame. @var{frame} should be a live frame; if omitted or |
| 1306 | one window on any frame is selected within the frame. The significance | 1237 | @code{nil}, it defaults to the selected frame. |
| 1307 | of this designation is that selecting the frame also selects this | ||
| 1308 | window. Conversely, selecting a window for Emacs with | ||
| 1309 | @code{select-window} also makes that window selected within its frame. | ||
| 1310 | |||
| 1311 | @defun frame-selected-window &optional frame | ||
| 1312 | This function returns the window on @var{frame} that is selected within | ||
| 1313 | @var{frame}. The optional argument @var{frame} must denote a live frame | ||
| 1314 | and defaults to the selected one. | ||
| 1315 | @end defun | 1238 | @end defun |
| 1316 | 1239 | ||
| 1317 | @defun set-frame-selected-window frame window &optional norecord | 1240 | @defun set-frame-selected-window frame window &optional norecord |
| 1318 | This function sets the selected window of frame @var{frame} to | 1241 | This function makes @code{window} the window selected within the frame |
| 1319 | @var{window}. The argument @var{frame} must denote a live frame and | 1242 | @var{frame}. @var{frame} should be a live frame; if omitted or |
| 1320 | defaults to the selected one. If @var{frame} is the selected frame, | 1243 | @code{nil}, it defaults to the selected frame. @var{window} should be |
| 1321 | this also makes @var{window} the selected window. The argument | 1244 | a live window; if omitted or @code{nil}, it defaults to the selected |
| 1322 | @var{window} must denote a live window. This function returns | 1245 | window. |
| 1323 | @var{window}. | ||
| 1324 | 1246 | ||
| 1325 | Optional argument @var{norecord} non-@code{nil} means to neither change | 1247 | If @var{frame} is the selected frame, this makes @var{window} the |
| 1326 | the list of most recently selected windows (@pxref{Selecting Windows}) | 1248 | selected window. |
| 1327 | nor the buffer list (@pxref{The Buffer List}). | ||
| 1328 | @end defun | ||
| 1329 | 1249 | ||
| 1250 | If the optional argument @var{norecord} is non-@code{nil}, this | ||
| 1251 | function does not alter the list of most recently selected windows, | ||
| 1252 | nor the buffer list. | ||
| 1253 | @end defun | ||
| 1330 | 1254 | ||
| 1331 | @node Cyclic Window Ordering | 1255 | @node Cyclic Window Ordering |
| 1332 | @section Cyclic Ordering of Windows | 1256 | @section Cyclic Ordering of Windows |