changeset 8264:8f227ebb7748

[!MULTI_FRAME] (Fframe_first_window): Defined. (syms_of_frame): Defvar it.
author Richard M. Stallman <rms@gnu.org>
date Sat, 16 Jul 1994 20:19:25 +0000
parents bae811318a57
children c830f54843c2
files src/frame.c
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/frame.c	Sat Jul 16 20:18:53 1994 +0000
+++ b/src/frame.c	Sat Jul 16 20:19:25 1994 +0000
@@ -1837,6 +1837,28 @@
   XFASTINT (tem) = 0;
   return tem;
 }
+
+DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0,
+  0)
+  (frame)
+     Lisp_Object frame;
+{
+  Lisp_Object w;
+
+  w = FRAME_ROOT_WINDOW (selected_frame);
+
+  while (NILP (XWINDOW (w)->buffer))
+    {
+      if (! NILP (XWINDOW (w)->hchild))
+	w = XWINDOW (w)->hchild;
+      else if (! NILP (XWINDOW (w)->vchild))
+	w = XWINDOW (w)->vchild;
+      else
+	abort ();
+    }
+  return w;
+}
+
 DEFUN ("framep", Fframep, Sframep, 1, 1, 0,
   /* Don't confuse make-docfile by having two doc strings for this function.
      make-docfile does not pay attention to #if, for good reason!  */
@@ -2078,6 +2100,7 @@
   XFASTINT (Vterminal_frame) = 0;
 
   defsubr (&Sselected_frame);
+  defsubr (&Sframe_first_window);
   defsubr (&Sframep);
   defsubr (&Sframe_char_height);
   defsubr (&Sframe_char_width);