comparison src/window.c @ 30039:07f23448b6e5

(add_window_to_list): Add parameter LIST. (window_list): Order list so that, for each frame, windows are in canonical order, and so that frames appear in the list in the order given by Vframe_list. (next_window): Reverse the handling of NEXT_P.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 05 Jul 2000 11:38:42 +0000
parents 79b4fa5288c3
children ff2db81c11c1
comparison
equal deleted inserted replaced
30038:9a141c819d48 30039:07f23448b6e5
66 int, int, int, int, int, int, int)); 66 int, int, int, int, int, int, int));
67 static int freeze_window_start P_ ((struct window *, int)); 67 static int freeze_window_start P_ ((struct window *, int));
68 static int window_fixed_size_p P_ ((struct window *, int, int)); 68 static int window_fixed_size_p P_ ((struct window *, int, int));
69 static void enlarge_window P_ ((Lisp_Object, int, int)); 69 static void enlarge_window P_ ((Lisp_Object, int, int));
70 static Lisp_Object window_list P_ ((void)); 70 static Lisp_Object window_list P_ ((void));
71 static int add_window_to_list P_ ((struct window *)); 71 static int add_window_to_list P_ ((struct window *, Lisp_Object *));
72 static int candidate_window_p P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); 72 static int candidate_window_p P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
73 static Lisp_Object next_window P_ ((Lisp_Object, Lisp_Object, 73 static Lisp_Object next_window P_ ((Lisp_Object, Lisp_Object,
74 Lisp_Object, int)); 74 Lisp_Object, int));
75 static void decode_next_window_args P_ ((Lisp_Object *, Lisp_Object *, 75 static void decode_next_window_args P_ ((Lisp_Object *, Lisp_Object *,
76 Lisp_Object *)); 76 Lisp_Object *));
1178 1178
1179 /*********************************************************************** 1179 /***********************************************************************
1180 Window List 1180 Window List
1181 ***********************************************************************/ 1181 ***********************************************************************/
1182 1182
1183 /* Add window W to Vwindow_list. This is a callback function for 1183 /* Add window W to *LIST. This is a callback function for
1184 foreach_window, used from window_list. */ 1184 foreach_window, used in function window_list. */
1185 1185
1186 static int 1186 static int
1187 add_window_to_list (w) 1187 add_window_to_list (w, list)
1188 struct window *w; 1188 struct window *w;
1189 Lisp_Object *list;
1189 { 1190 {
1190 Lisp_Object window; 1191 Lisp_Object window;
1191 XSETWINDOW (window, w); 1192 XSETWINDOW (window, w);
1192 Vwindow_list = Fcons (window, Vwindow_list); 1193 *list = Fcons (window, *list);
1193 return 1; 1194 return 1;
1194 } 1195 }
1195 1196
1196 1197
1197 /* Return a list of all windows, for use by next_window. If 1198 /* Return a list of all windows, for use by next_window. If
1202 window_list () 1203 window_list ()
1203 { 1204 {
1204 if (!CONSP (Vwindow_list)) 1205 if (!CONSP (Vwindow_list))
1205 { 1206 {
1206 Lisp_Object tail; 1207 Lisp_Object tail;
1208
1207 Vwindow_list = Qnil; 1209 Vwindow_list = Qnil;
1208 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) 1210 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
1209 foreach_window (XFRAME (XCAR (tail)), add_window_to_list); 1211 {
1212 Lisp_Object args[2];
1213
1214 /* We are visiting windows in canonical order, and add
1215 new windows at the front of args[1], which means we
1216 have to reverse this list at the end. */
1217 args[1] = Qnil;
1218 foreach_window (XFRAME (XCAR (tail)), add_window_to_list, &args[1]);
1219 args[0] = Vwindow_list;
1220 args[1] = Fnreverse (args[1]);
1221 Vwindow_list = Fnconc (2, args);
1222 }
1210 } 1223 }
1211 1224
1212 return Vwindow_list; 1225 return Vwindow_list;
1213 } 1226 }
1214 1227
1331 return the first window on the frame. */ 1344 return the first window on the frame. */
1332 if (FRAMEP (all_frames) 1345 if (FRAMEP (all_frames)
1333 && !EQ (all_frames, XWINDOW (window)->frame)) 1346 && !EQ (all_frames, XWINDOW (window)->frame))
1334 return Fframe_first_window (all_frames); 1347 return Fframe_first_window (all_frames);
1335 1348
1336 if (!next_p) 1349 if (next_p)
1337 { 1350 {
1338 Lisp_Object list; 1351 Lisp_Object list;
1339 1352
1340 /* Find WINDOW in the list of all windows. */ 1353 /* Find WINDOW in the list of all windows. */
1341 list = Fmemq (window, window_list ()); 1354 list = Fmemq (window, window_list ());