diff options
| author | Richard M. Stallman | 1994-03-08 06:20:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-03-08 06:20:18 +0000 |
| commit | 89bca6129b086443bf60762a2b72b2ac32f815d9 (patch) | |
| tree | 1718ef6005aa57e462bec0d1b2a60e339aeea924 /src/window.c | |
| parent | f7af3f7b44c971f3393f3c28e877f06a03b51b7b (diff) | |
| download | emacs-89bca6129b086443bf60762a2b72b2ac32f815d9.tar.gz emacs-89bca6129b086443bf60762a2b72b2ac32f815d9.zip | |
(Fprevious_window, Fnext_window): ALL_FRAMES = visible
means consider only visible frames.
(window_loop): Likewise for FRAMES.
(Fget_buffer_window, Fget_largest_window, Fget_lru_window): Doc fix.
(Fdelete_windows_on): Doc fix.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 75 |
1 files changed, 45 insertions, 30 deletions
diff --git a/src/window.c b/src/window.c index ac65cf39ea5..558426135f6 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Window creation, deletion and examination for GNU Emacs. | 1 | /* Window creation, deletion and examination for GNU Emacs. |
| 2 | Does not include redisplay. | 2 | Does not include redisplay. |
| 3 | Copyright (C) 1985, 1986, 1987, 1993 Free Software Foundation, Inc. | 3 | Copyright (C) 1985, 1986, 1987, 1993, 1994 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -736,7 +736,8 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", | |||
| 736 | 736 | ||
| 737 | if (EQ (window, pwindow)) | 737 | if (EQ (window, pwindow)) |
| 738 | { | 738 | { |
| 739 | Lisp_Object alternative = Fnext_window (window, Qlambda, Qnil); | 739 | Lisp_Object alternative; |
| 740 | alternative = Fnext_window (window, Qlambda, Qnil); | ||
| 740 | 741 | ||
| 741 | /* If we're about to delete the selected window on the | 742 | /* If we're about to delete the selected window on the |
| 742 | selected frame, then we should use Fselect_window to select | 743 | selected frame, then we should use Fselect_window to select |
| @@ -841,7 +842,8 @@ minibuffer does not count, only windows from WINDOW's frame count.\n\ | |||
| 841 | \n\ | 842 | \n\ |
| 842 | Optional third arg ALL-FRAMES t means include windows on all frames.\n\ | 843 | Optional third arg ALL-FRAMES t means include windows on all frames.\n\ |
| 843 | ALL-FRAMES nil or omitted means cycle within the frames as specified\n\ | 844 | ALL-FRAMES nil or omitted means cycle within the frames as specified\n\ |
| 844 | above. If neither nil nor t, restrict to WINDOW's frame.\n\ | 845 | above. ALL-FRAMES = `visible' means include windows on all visible frames.\n\ |
| 846 | Anything else means restrict to WINDOW's frame.\n\ | ||
| 845 | \n\ | 847 | \n\ |
| 846 | If you use consistent values for MINIBUF and ALL-FRAMES, you can use\n\ | 848 | If you use consistent values for MINIBUF and ALL-FRAMES, you can use\n\ |
| 847 | `next-window' to iterate through the entire cycle of acceptable\n\ | 849 | `next-window' to iterate through the entire cycle of acceptable\n\ |
| @@ -878,6 +880,8 @@ DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, | |||
| 878 | (WINDOW_FRAME | 880 | (WINDOW_FRAME |
| 879 | (XWINDOW (window))))) | 881 | (XWINDOW (window))))) |
| 880 | : Qnil); | 882 | : Qnil); |
| 883 | else if (EQ (all_frames, Qvisible)) | ||
| 884 | ; | ||
| 881 | else if (! EQ (all_frames, Qt)) | 885 | else if (! EQ (all_frames, Qt)) |
| 882 | all_frames = Qnil; | 886 | all_frames = Qnil; |
| 883 | /* Now all_frames is t meaning search all frames, | 887 | /* Now all_frames is t meaning search all frames, |
| @@ -954,7 +958,8 @@ count.\n\ | |||
| 954 | \n\ | 958 | \n\ |
| 955 | Optional third arg ALL-FRAMES t means include windows on all frames.\n\ | 959 | Optional third arg ALL-FRAMES t means include windows on all frames.\n\ |
| 956 | ALL-FRAMES nil or omitted means cycle within the frames as specified\n\ | 960 | ALL-FRAMES nil or omitted means cycle within the frames as specified\n\ |
| 957 | above. If neither nil nor t, restrict to WINDOW's frame.\n\ | 961 | above. ALL-FRAMES = `visible' means include windows on all visible frames.\n\ |
| 962 | Anything else means restrict to WINDOW's frame.\n\ | ||
| 958 | \n\ | 963 | \n\ |
| 959 | If you use consistent values for MINIBUF and ALL-FRAMES, you can use\n\ | 964 | If you use consistent values for MINIBUF and ALL-FRAMES, you can use\n\ |
| 960 | `previous-window' to iterate through the entire cycle of acceptable\n\ | 965 | `previous-window' to iterate through the entire cycle of acceptable\n\ |
| @@ -992,6 +997,8 @@ DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0, | |||
| 992 | (WINDOW_FRAME | 997 | (WINDOW_FRAME |
| 993 | (XWINDOW (window))))) | 998 | (XWINDOW (window))))) |
| 994 | : Qnil); | 999 | : Qnil); |
| 1000 | else if (EQ (all_frames, Qvisible)) | ||
| 1001 | ; | ||
| 995 | else if (! EQ (all_frames, Qt)) | 1002 | else if (! EQ (all_frames, Qt)) |
| 996 | all_frames = Qnil; | 1003 | all_frames = Qnil; |
| 997 | /* Now all_frames is t meaning search all frames, | 1004 | /* Now all_frames is t meaning search all frames, |
| @@ -1095,6 +1102,7 @@ argument ALL_FRAMES is non-nil, cycle through all frames.") | |||
| 1095 | with argument OBJ. | 1102 | with argument OBJ. |
| 1096 | If FRAMES is Qt, look at all frames; | 1103 | If FRAMES is Qt, look at all frames; |
| 1097 | Qnil, look at just the selected frame; | 1104 | Qnil, look at just the selected frame; |
| 1105 | Qvisible, look at visible frames; | ||
| 1098 | a frame, just look at windows on that frame. | 1106 | a frame, just look at windows on that frame. |
| 1099 | If MINI is non-zero, perform the operation on minibuffer windows too. | 1107 | If MINI is non-zero, perform the operation on minibuffer windows too. |
| 1100 | */ | 1108 | */ |
| @@ -1121,6 +1129,8 @@ window_loop (type, obj, mini, frames) | |||
| 1121 | register Lisp_Object next_window; | 1129 | register Lisp_Object next_window; |
| 1122 | register Lisp_Object last_window; | 1130 | register Lisp_Object last_window; |
| 1123 | FRAME_PTR frame; | 1131 | FRAME_PTR frame; |
| 1132 | Lisp_Object frame_arg; | ||
| 1133 | frame_arg = Qt; | ||
| 1124 | 1134 | ||
| 1125 | #ifdef MULTI_FRAME | 1135 | #ifdef MULTI_FRAME |
| 1126 | /* If we're only looping through windows on a particular frame, | 1136 | /* If we're only looping through windows on a particular frame, |
| @@ -1132,10 +1142,18 @@ window_loop (type, obj, mini, frames) | |||
| 1132 | frame = selected_frame; | 1142 | frame = selected_frame; |
| 1133 | else | 1143 | else |
| 1134 | frame = 0; | 1144 | frame = 0; |
| 1145 | if (frame) | ||
| 1146 | frame_arg = Qlambda; | ||
| 1147 | else if (EQ (frames, Qvisible)) | ||
| 1148 | frame_arg = frames; | ||
| 1135 | #else | 1149 | #else |
| 1136 | frame = 0; | 1150 | frame = 0; |
| 1137 | #endif | 1151 | #endif |
| 1138 | 1152 | ||
| 1153 | /* frame_arg is Qlambda to stick to one frame, | ||
| 1154 | Qvisible to consider all visible frames, | ||
| 1155 | or Qt otherwise. */ | ||
| 1156 | |||
| 1139 | /* Pick a window to start with. */ | 1157 | /* Pick a window to start with. */ |
| 1140 | if (XTYPE (obj) == Lisp_Window) | 1158 | if (XTYPE (obj) == Lisp_Window) |
| 1141 | w = obj; | 1159 | w = obj; |
| @@ -1151,14 +1169,7 @@ window_loop (type, obj, mini, frames) | |||
| 1151 | We can't just wait until we hit the first window again, because | 1169 | We can't just wait until we hit the first window again, because |
| 1152 | it might be deleted. */ | 1170 | it might be deleted. */ |
| 1153 | 1171 | ||
| 1154 | #ifdef MULTI_FRAME | 1172 | last_window = Fprevious_window (w, mini ? Qt : Qnil, frame_arg); |
| 1155 | if (frame) | ||
| 1156 | last_window = Fprevious_window (w, (mini ? Qt : Qnil), Qlambda); | ||
| 1157 | else | ||
| 1158 | #endif /* MULTI_FRAME */ | ||
| 1159 | /* We know frame is 0, so we're looping through all frames. | ||
| 1160 | Or we know this isn't a MULTI_FRAME Emacs, so who cares? */ | ||
| 1161 | last_window = Fprevious_window (w, mini ? Qt : Qnil, Qt); | ||
| 1162 | 1173 | ||
| 1163 | best_window = Qnil; | 1174 | best_window = Qnil; |
| 1164 | for (;;) | 1175 | for (;;) |
| @@ -1167,15 +1178,13 @@ window_loop (type, obj, mini, frames) | |||
| 1167 | 1178 | ||
| 1168 | /* Pick the next window now, since some operations will delete | 1179 | /* Pick the next window now, since some operations will delete |
| 1169 | the current window. */ | 1180 | the current window. */ |
| 1170 | #ifdef MULTI_FRAME | 1181 | next_window = Fnext_window (w, mini ? Qt : Qnil, frame_arg); |
| 1171 | if (frame) | ||
| 1172 | next_window = Fnext_window (w, (mini ? Qt : Qnil), Qlambda); | ||
| 1173 | else | ||
| 1174 | #endif /* MULTI_FRAME */ | ||
| 1175 | /* We know frame is 0, so we're looping through all frames. | ||
| 1176 | Or we know this isn't a MULTI_FRAME Emacs, so who cares? */ | ||
| 1177 | next_window = Fnext_window (w, mini ? Qt : Qnil, Qt); | ||
| 1178 | 1182 | ||
| 1183 | #ifdef MULTI_FRAME | ||
| 1184 | if (frame != 0 && EQ (frames, Qt) | ||
| 1185 | && FRAME_VISIBLE_P (w_frame)) | ||
| 1186 | continue; | ||
| 1187 | #endif | ||
| 1179 | if (! MINI_WINDOW_P (XWINDOW (w)) | 1188 | if (! MINI_WINDOW_P (XWINDOW (w)) |
| 1180 | || (mini && minibuf_level > 0)) | 1189 | || (mini && minibuf_level > 0)) |
| 1181 | switch (type) | 1190 | switch (type) |
| @@ -1283,24 +1292,28 @@ window_loop (type, obj, mini, frames) | |||
| 1283 | 1292 | ||
| 1284 | DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 1, 0, | 1293 | DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 1, 0, |
| 1285 | "Return the window least recently selected or used for display.\n\ | 1294 | "Return the window least recently selected or used for display.\n\ |
| 1286 | If optional argument FRAMES is t, search all frames. If FRAME is a\n\ | 1295 | If optional argument FRAME is `visible', search all visible frames.\n\ |
| 1287 | frame, search only that frame.\n") | 1296 | If FRAME is t, search all frames.\n\ |
| 1288 | (frames) | 1297 | If FRAME is nil, search only the selected frame.\n\ |
| 1289 | Lisp_Object frames; | 1298 | If FRAME is a frame, search only that frame.") |
| 1299 | (frame) | ||
| 1300 | Lisp_Object frame; | ||
| 1290 | { | 1301 | { |
| 1291 | register Lisp_Object w; | 1302 | register Lisp_Object w; |
| 1292 | /* First try for a window that is full-width */ | 1303 | /* First try for a window that is full-width */ |
| 1293 | w = window_loop (GET_LRU_WINDOW, Qt, 0, frames); | 1304 | w = window_loop (GET_LRU_WINDOW, Qt, 0, frame); |
| 1294 | if (!NILP (w) && !EQ (w, selected_window)) | 1305 | if (!NILP (w) && !EQ (w, selected_window)) |
| 1295 | return w; | 1306 | return w; |
| 1296 | /* If none of them, try the rest */ | 1307 | /* If none of them, try the rest */ |
| 1297 | return window_loop (GET_LRU_WINDOW, Qnil, 0, frames); | 1308 | return window_loop (GET_LRU_WINDOW, Qnil, 0, frame); |
| 1298 | } | 1309 | } |
| 1299 | 1310 | ||
| 1300 | DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 1, 0, | 1311 | DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 1, 0, |
| 1301 | "Return the largest window in area.\n\ | 1312 | "Return the largest window in area.\n\ |
| 1302 | If optional argument FRAMES is t, search all frames. If FRAME is a\n\ | 1313 | If optional argument FRAME is `visible', search all visible frames.\n\ |
| 1303 | frame, search only that frame.\n") | 1314 | If FRAME is t, search all frames.\n\ |
| 1315 | If FRAME is nil, search only the selected frame.\n\ | ||
| 1316 | If FRAME is a frame, search only that frame.") | ||
| 1304 | (frame) | 1317 | (frame) |
| 1305 | Lisp_Object frame; | 1318 | Lisp_Object frame; |
| 1306 | { | 1319 | { |
| @@ -1310,9 +1323,10 @@ frame, search only that frame.\n") | |||
| 1310 | 1323 | ||
| 1311 | DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 1, 2, 0, | 1324 | DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 1, 2, 0, |
| 1312 | "Return a window currently displaying BUFFER, or nil if none.\n\ | 1325 | "Return a window currently displaying BUFFER, or nil if none.\n\ |
| 1313 | If optional argument FRAME is t, search all visible frames.\n\ | 1326 | If optional argument FRAME is `visible', search all visible frames.\n\ |
| 1327 | If FRAME is t, search all frames.\n\ | ||
| 1314 | If FRAME is nil, search only the selected frame.\n\ | 1328 | If FRAME is nil, search only the selected frame.\n\ |
| 1315 | If FRAME is a frame, search only that frame.\n") | 1329 | If FRAME is a frame, search only that frame.") |
| 1316 | (buffer, frame) | 1330 | (buffer, frame) |
| 1317 | Lisp_Object buffer, frame; | 1331 | Lisp_Object buffer, frame; |
| 1318 | { | 1332 | { |
| @@ -1370,6 +1384,7 @@ DEFUN ("delete-windows-on", Fdelete_windows_on, Sdelete_windows_on, | |||
| 1370 | Optional second argument FRAME controls which frames are affected.\n\ | 1384 | Optional second argument FRAME controls which frames are affected.\n\ |
| 1371 | If nil or omitted, delete all windows showing BUFFER in any frame.\n\ | 1385 | If nil or omitted, delete all windows showing BUFFER in any frame.\n\ |
| 1372 | If t, delete only windows showing BUFFER in the selected frame.\n\ | 1386 | If t, delete only windows showing BUFFER in the selected frame.\n\ |
| 1387 | If `visible', delete all windows showing BUFFER in any visible frame.\n\ | ||
| 1373 | If a frame, delete only windows showing BUFFER in that frame.") | 1388 | If a frame, delete only windows showing BUFFER in that frame.") |
| 1374 | (buffer, frame) | 1389 | (buffer, frame) |
| 1375 | Lisp_Object buffer, frame; | 1390 | Lisp_Object buffer, frame; |