]> code.delx.au - gnu-emacs/blobdiff - src/frame.c
(Fset_text_properties): Special case for getting
[gnu-emacs] / src / frame.c
index 8998dd8eb91e0bec10ae390089257e6fa27939a1..5c6e44e936adea11deeeb5b807e2bc4cc1a5bb83 100644 (file)
@@ -100,7 +100,7 @@ Also see `live-frame-p'.")
   (object)
      Lisp_Object object;
 {
-  if (XTYPE (object) != Lisp_Frame)
+  if (!FRAMEP (object))
     return Qnil;
   switch (XFRAME (object)->output_method)
     {
@@ -197,14 +197,14 @@ make_frame (mini_p)
   f->width = 10;
   f->height = 10;
 
-  XFASTINT (XWINDOW (root_window)->width) = 10;
-  XFASTINT (XWINDOW (root_window)->height) = (mini_p ? 9 : 10);
+  XSETFASTINT (XWINDOW (root_window)->width, 10);
+  XSETFASTINT (XWINDOW (root_window)->height, (mini_p ? 9 : 10));
 
   if (mini_p)
     {
-      XFASTINT (XWINDOW (mini_window)->width) = 10;
-      XFASTINT (XWINDOW (mini_window)->top) = 9;
-      XFASTINT (XWINDOW (mini_window)->height) = 1;
+      XSETFASTINT (XWINDOW (mini_window)->width, 10);
+      XSETFASTINT (XWINDOW (mini_window)->top, 9);
+      XSETFASTINT (XWINDOW (mini_window)->height, 1);
     }
 
   /* Choose a buffer for the frame's root window.  */
@@ -233,7 +233,7 @@ make_frame (mini_p)
   f->selected_window = root_window;
   /* Make sure this window seems more recently used than
      a newly-created, never-selected window.  */
-  XFASTINT (XWINDOW (f->selected_window)->use_time) = ++window_select_count;
+  XSETFASTINT (XWINDOW (f->selected_window)->use_time, ++window_select_count);
 
   return f;
 }
@@ -251,7 +251,7 @@ make_frame_without_minibuffer (mini_window)
   /* Choose the minibuffer window to use.  */
   if (NILP (mini_window))
     {
-      if (XTYPE (Vdefault_minibuffer_frame) != Lisp_Frame)
+      if (!FRAMEP (Vdefault_minibuffer_frame))
        error ("default-minibuffer-frame must be set when creating minibufferless frames");
       if (! FRAME_LIVE_P (XFRAME (Vdefault_minibuffer_frame)))
        error ("default-minibuffer-frame must be a live frame");
@@ -285,7 +285,7 @@ make_minibuffer_frame ()
   register Lisp_Object mini_window;
   register Lisp_Object frame;
 
-  XSET (frame, Lisp_Frame, f);
+  XSETFRAME (frame, f);
 
   f->auto_raise = 0;
   f->auto_lower = 0;
@@ -323,13 +323,13 @@ make_terminal_frame ()
   Vframe_list = Qnil;
   f = make_frame (1);
 
-  XSET (frame, Lisp_Frame, f);
+  XSETFRAME (frame, f);
   Vframe_list = Fcons (frame, Vframe_list);
 
   f->name = build_string ("terminal");
   FRAME_SET_VISIBLE (f, 1);
   f->display.nothing = 1;   /* Nonzero means frame isn't deleted.  */
-  XSET (Vterminal_frame, Lisp_Frame, f);
+  XSETFRAME (Vterminal_frame, f);
   return f;
 }
 \f
@@ -373,13 +373,12 @@ do_switch_frame (frame, no_enter, track)
        {
          Lisp_Object focus;
 
-         if (XTYPE (XCONS (tail)->car) != Lisp_Frame)
+         if (!FRAMEP (XCONS (tail)->car))
            abort ();
 
          focus = FRAME_FOCUS_FRAME (XFRAME (XCONS (tail)->car));
 
-         if (XTYPE (focus) == Lisp_Frame
-             && XFRAME (focus) == selected_frame)
+         if (FRAMEP (focus) && XFRAME (focus) == selected_frame)
            Fredirect_frame_focus (XCONS (tail)->car, frame);
        }
     }
@@ -453,7 +452,7 @@ DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
   ()
 {
   Lisp_Object tem;
-  XSET (tem, Lisp_Frame, selected_frame);
+  XSETFRAME (tem, selected_frame);
   return tem;
 }
 \f
@@ -500,7 +499,7 @@ If omitted, FRAME defaults to the currently selected frame.")
      Lisp_Object frame;
 {
   if (NILP (frame))
-    XSET (frame, Lisp_Frame, selected_frame);
+    XSETFRAME (frame, selected_frame);
   else
     CHECK_LIVE_FRAME (frame, 0);
 
@@ -515,7 +514,7 @@ If omitted, FRAME defaults to the currently selected frame.")
      Lisp_Object frame;
 {
   if (NILP (frame))
-    XSET (frame, Lisp_Frame, selected_frame);
+    XSETFRAME (frame, selected_frame);
   else
     CHECK_LIVE_FRAME (frame, 0);
 
@@ -531,7 +530,7 @@ If FRAME is the selected frame, this makes WINDOW the selected window.")
      Lisp_Object frame, window;
 {
   if (NILP (frame))
-    XSET (frame, Lisp_Frame, selected_frame);
+    XSETFRAME (frame, selected_frame);
   else
     CHECK_LIVE_FRAME (frame, 0);
 
@@ -657,7 +656,7 @@ prev_frame (frame, minibuf)
       Lisp_Object f;
 
       f = XCONS (tail)->car;
-      if (XTYPE (f) != Lisp_Frame)
+      if (!FRAMEP (f))
        abort ();
 
       if (EQ (frame, f) && !NILP (prev))
@@ -670,7 +669,7 @@ prev_frame (frame, minibuf)
          if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
            prev = f;
        }
-      else if (XTYPE (minibuf) == Lisp_Window)
+      else if (WINDOWP (minibuf))
        {
          if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
              /* Check that F either is, or has forwarded its focus to,
@@ -686,7 +685,7 @@ prev_frame (frame, minibuf)
          if (FRAME_VISIBLE_P (XFRAME (f)))
            prev = f;
        }
-      else if (XFASTINT (f) == 0)
+      else if (XFASTINT (minibuf) == 0)
        {
          FRAME_SAMPLE_VISIBILITY (XFRAME (f));
          if (FRAME_VISIBLE_P (XFRAME (f))
@@ -726,7 +725,7 @@ Otherwise, include all frames.")
   Lisp_Object tail;
 
   if (NILP (frame))
-    XSET (frame, Lisp_Frame, selected_frame);
+    XSETFRAME (frame, selected_frame);
   else
     CHECK_LIVE_FRAME (frame, 0);
 
@@ -749,7 +748,7 @@ Otherwise, include all frames.")
   Lisp_Object tail;
 
   if (NILP (frame))
-    XSET (frame, Lisp_Frame, selected_frame);
+    XSETFRAME (frame, selected_frame);
   else
     CHECK_LIVE_FRAME (frame, 0);
 
@@ -815,7 +814,7 @@ but if the second optional argument FORCE is non-nil, you may do so.")
   if (EQ (frame, Qnil))
     {
       f = selected_frame;
-      XSET (frame, Lisp_Frame, f);
+      XSETFRAME (frame, f);
     }
   else
     {
@@ -944,7 +943,7 @@ but if the second optional argument FORCE is non-nil, you may do so.")
          Lisp_Object this;
 
          this = XCONS (frames)->car;
-         if (XTYPE (this) != Lisp_Frame)
+         if (!FRAMEP (this))
            abort ();
          f = XFRAME (this);
 
@@ -1006,7 +1005,7 @@ and nil for X and Y.")
       XSETINT (x, col);
       XSETINT (y, row);
     }
-  XSET (lispy_dummy, Lisp_Frame, f);
+  XSETFRAME (lispy_dummy, f);
   return Fcons (lispy_dummy, Fcons (x, y));
 }
 
@@ -1036,7 +1035,7 @@ and nil for X and Y.")
                            &lispy_dummy, &party_dummy,
                            &x, &y,
                            &long_dummy);
-  XSET (lispy_dummy, Lisp_Frame, f);
+  XSETFRAME (lispy_dummy, f);
   return Fcons (lispy_dummy, Fcons (x, y));
 }
 
@@ -1091,7 +1090,7 @@ If omitted, FRAME defaults to the currently selected frame.")
      Lisp_Object frame;
 {
   if (NILP (frame))
-    XSET (frame, Lisp_Frame, selected_frame);
+    XSETFRAME (frame, selected_frame);
 
   CHECK_LIVE_FRAME (frame, 0);
 
@@ -1120,7 +1119,7 @@ but if the second optional argument FORCE is non-nil, you may do so.")
      Lisp_Object frame, force;
 {
   if (NILP (frame))
-    XSET (frame, Lisp_Frame, selected_frame);
+    XSETFRAME (frame, selected_frame);
 
   CHECK_LIVE_FRAME (frame, 0);
 
@@ -1161,7 +1160,7 @@ If omitted, FRAME defaults to the currently selected frame.")
      Lisp_Object frame;
 {
   if (NILP (frame))
-    XSET (frame, Lisp_Frame, selected_frame);
+    XSETFRAME (frame, selected_frame);
   
   CHECK_LIVE_FRAME (frame, 0);
 
@@ -1224,7 +1223,7 @@ DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list,
   for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
     {
       frame = XCONS (tail)->car;
-      if (XTYPE (frame) != Lisp_Frame)
+      if (!FRAMEP (frame))
        continue;
       f = XFRAME (frame);
       if (FRAME_VISIBLE_P (f))
@@ -1376,8 +1375,7 @@ store_frame_param (f, prop, val)
   else
     Fsetcdr (tem, val);
 
-  if (EQ (prop, Qminibuffer)
-      && XTYPE (val) == Lisp_Window)
+  if (EQ (prop, Qminibuffer) && WINDOWP (val))
     {
       if (! MINI_WINDOW_P (XWINDOW (val)))
        error ("Surrogate minibuffer windows must be minibuffer windows.");
@@ -1432,7 +1430,7 @@ If FRAME is omitted, return information on the currently selected frame.")
     {
       /* This ought to be correct in f->param_alist for an X frame.  */
       Lisp_Object lines;
-      XFASTINT (lines) = FRAME_MENU_BAR_LINES (f);
+      XSETFASTINT (lines, FRAME_MENU_BAR_LINES (f));
       store_in_alist (&alist, Qmenu_bar_lines, lines);
     }
   return alist;
@@ -1830,6 +1828,7 @@ For values specific to the separate minibuffer frame, see\n\
 keys_of_frame ()
 {
   initial_define_lispy_key (global_map, "switch-frame", "handle-switch-frame");
+  initial_define_lispy_key (global_map, "delete-frame", "handle-delete-frame");
 }
 \f
 #else /* not MULTI_FRAME */
@@ -1857,7 +1856,7 @@ DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
   ()
 {
   Lisp_Object tem;
-  XFASTINT (tem) = 0;
+  XSETFASTINT (tem, 0);
   return tem;
 }
 
@@ -2120,7 +2119,7 @@ syms_of_frame ()
 
   DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
     "The initial frame-object, which represents Emacs's stdout.");
-  XFASTINT (Vterminal_frame) = 0;
+  XSETFASTINT (Vterminal_frame, 0);
 
   defsubr (&Sselected_frame);
   defsubr (&Sframe_first_window);