comparison src/window.c @ 33619:d0482eab29e1

(Fwindow_list): Change parameter list to be XEmacs compatible. (window_list_1): New function. (window_loop): Use it instead of Fwindow_list.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 19 Nov 2000 15:20:27 +0000
parents 968cd8a9cdfe
children 1436ae066de4
comparison
equal deleted inserted replaced
33618:beb961476e7f 33619:d0482eab29e1
77 static void decode_next_window_args P_ ((Lisp_Object *, Lisp_Object *, 77 static void decode_next_window_args P_ ((Lisp_Object *, Lisp_Object *,
78 Lisp_Object *)); 78 Lisp_Object *));
79 static int foreach_window_1 P_ ((struct window *, 79 static int foreach_window_1 P_ ((struct window *,
80 int (* fn) (struct window *, void *), 80 int (* fn) (struct window *, void *),
81 void *)); 81 void *));
82 static Lisp_Object window_list_1 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
82 83
83 /* This is the window in which the terminal's cursor should 84 /* This is the window in which the terminal's cursor should
84 be left when nothing is being done with it. This must 85 be left when nothing is being done with it. This must
85 always be a leaf window, and its buffer is selected by 86 always be a leaf window, and its buffer is selected by
86 the top level editing loop at the end of each command. 87 the top level editing loop at the end of each command.
1547 return Qnil; 1548 return Qnil;
1548 } 1549 }
1549 1550
1550 1551
1551 DEFUN ("window-list", Fwindow_list, Swindow_list, 0, 3, 0, 1552 DEFUN ("window-list", Fwindow_list, Swindow_list, 0, 3, 0,
1552 "Return a list of windows in canonical ordering.\n\ 1553 "Return a list of windows on FRAME, starting with WINDOW.\n\
1553 Arguments are like for `next-window'.") 1554 FRAME nil or omitted means use the selected frame.\n\
1554 (window, minibuf, all_frames) 1555 WINDOW nil or omitted means use the selected window.\n\
1556 MINIBUF t means include the minibuffer window, even if it isn't active.\n\
1557 MINIBUF nil or omitted means include the minibuffer window only\n\
1558 if it's active.\n\
1559 MINIBUF neither nil nor t means never include the minibuffer window.")
1560 (frame, minibuf, window)
1561 Lisp_Object frame, minibuf, window;
1562 {
1563 Lisp_Object list;
1564
1565 if (NILP (window))
1566 window = selected_window;
1567 if (NILP (frame))
1568 frame = selected_frame;
1569
1570 if (!EQ (frame, XWINDOW (window)->frame))
1571 error ("Window is on a different frame");
1572
1573 return window_list_1 (window, minibuf, frame);
1574 }
1575
1576
1577 /* Return a list of windows in canonical ordering. Arguments are like
1578 for `next-window'. */
1579
1580 static Lisp_Object
1581 window_list_1 (window, minibuf, all_frames)
1555 Lisp_Object window, minibuf, all_frames; 1582 Lisp_Object window, minibuf, all_frames;
1556 { 1583 {
1557 Lisp_Object tail, list; 1584 Lisp_Object tail, list;
1558 1585
1559 decode_next_window_args (&window, &minibuf, &all_frames); 1586 decode_next_window_args (&window, &minibuf, &all_frames);
1635 ring, we can just use Fprevious_window to find the last one. 1662 ring, we can just use Fprevious_window to find the last one.
1636 1663
1637 We can't just wait until we hit the first window again, because 1664 We can't just wait until we hit the first window again, because
1638 it might be deleted. */ 1665 it might be deleted. */
1639 1666
1640 windows = Fwindow_list (window, mini ? Qt : Qnil, frame_arg); 1667 windows = window_list_1 (window, mini ? Qt : Qnil, frame_arg);
1641 GCPRO1 (windows); 1668 GCPRO1 (windows);
1642 best_window = Qnil; 1669 best_window = Qnil;
1643 1670
1644 for (; CONSP (windows); windows = CDR (windows)) 1671 for (; CONSP (windows); windows = CDR (windows))
1645 { 1672 {