*** empty log message ***
[bpt/emacs.git] / src / dispnew.c
index ec60f3d..eb20a71 100644 (file)
@@ -121,13 +121,15 @@ Lisp_Object Vstandard_display_table;
 int cursor_in_echo_area;
 \f
 /* The currently selected frame.
-   In a single-frame version, this variable always remains 0.  */
+   In a single-frame version, this variable always holds the address of
+   the_only_frame.  */
 
 FRAME_PTR selected_frame;
 
 /* A frame which is not just a minibuffer, or 0 if there are no such
    frames.  This is usually the most recent such frame that was
-   selected.  In a single-frame version, this variable always remains 0.  */
+   selected.  In a single-frame version, this variable always holds
+   the address of the_only_frame.  */
 FRAME_PTR last_nonminibuf_frame;
 
 /* In a single-frame version, the information that would otherwise
@@ -186,7 +188,7 @@ redraw_frame (f)
      FRAME_PTR f;
 {
   Lisp_Object frame;
-  XSET (frame, Lisp_Frame, f);
+  XSETFRAME (frame, f);
   Fredraw_frame (frame);
 }
 
@@ -318,7 +320,7 @@ make_frame_glyphs (frame, empty)
   return new;
 }
 
-static void
+void
 free_frame_glyphs (frame, glyphs)
      FRAME_PTR frame;
      struct frame_glyphs *glyphs;
@@ -851,10 +853,10 @@ preserve_other_columns (w)
 
              bcopy (current_frame->glyphs[vpos],
                     desired_frame->glyphs[vpos],
-                    start * sizeof (current_frame->glyphs[vpos]));
+                    start * sizeof (current_frame->glyphs[vpos][0]));
              bcopy (current_frame->charstarts[vpos],
                     desired_frame->charstarts[vpos],
-                    start * sizeof (current_frame->charstarts[vpos]));
+                    start * sizeof (current_frame->charstarts[vpos][0]));
              len = min (start, current_frame->used[vpos]);
              if (desired_frame->used[vpos] < len)
                desired_frame->used[vpos] = len;
@@ -871,11 +873,11 @@ preserve_other_columns (w)
              bcopy (current_frame->glyphs[vpos] + end,
                     desired_frame->glyphs[vpos] + end,
                     ((current_frame->used[vpos] - end)
-                     * sizeof (current_frame->glyphs[vpos])));
+                     * sizeof (current_frame->glyphs[vpos][0])));
              bcopy (current_frame->charstarts[vpos] + end,
                     desired_frame->charstarts[vpos] + end,
                     ((current_frame->used[vpos] - end)
-                     * sizeof (current_frame->charstarts[vpos])));
+                     * sizeof (current_frame->charstarts[vpos][0])));
              desired_frame->used[vpos] = current_frame->used[vpos];
            }
        }
@@ -1077,7 +1079,7 @@ direct_output_for_insert (g)
      At the moment we only lose at end of line or end of buffer
      and only with faces that have some background */
   /* Instead of wasting time, give up if character has any text properties */
-      || ! NILP (Ftext_properties_at (XFASTINT (point - 1), Qnil))
+      || ! NILP (Ftext_properties_at (make_number (point - 1), Qnil))
 #endif
 
   /* Give up if w is minibuffer and a message is being displayed there */
@@ -1086,7 +1088,7 @@ direct_output_for_insert (g)
 
   {
     int face = 0;
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_FACES
     int dummy;
 
     if (FRAME_X_P (frame))
@@ -1100,9 +1102,9 @@ direct_output_for_insert (g)
   }
   unchanged_modified = MODIFF;
   beg_unchanged = GPT - BEG;
-  XFASTINT (w->last_point) = point;
-  XFASTINT (w->last_point_x) = hpos;
-  XFASTINT (w->last_modified) = MODIFF;
+  XSETFASTINT (w->last_point, point);
+  XSETFASTINT (w->last_point_x, hpos);
+  XSETFASTINT (w->last_modified, MODIFF);
 
   reassert_line_highlight (0, vpos);
   write_glyphs (&current_frame->glyphs[vpos][hpos], 1);
@@ -1123,7 +1125,7 @@ direct_output_forward_char (n)
 {
   register FRAME_PTR frame = selected_frame;
   register struct window *w = XWINDOW (selected_window);
-  int position;
+  Lisp_Object position;
   int hpos = FRAME_CURSOR_X (frame);
 
   /* Give up if in truncated text at end of line.  */
@@ -1147,14 +1149,14 @@ direct_output_forward_char (n)
   /* Don't use direct output next to an invisible character
      since we might need to do something special.  */
 
-  XFASTINT (position) = point;
+  XSETFASTINT (position, point);
   if (XFASTINT (position) < ZV
       && ! NILP (Fget_char_property (position,
                                     Qinvisible,
                                     selected_window)))
     return 0;
 
-  XFASTINT (position) = point - 1;
+  XSETFASTINT (position, point - 1);
   if (XFASTINT (position) >= BEGV
       && ! NILP (Fget_char_property (position,
                                     Qinvisible,
@@ -1163,8 +1165,8 @@ direct_output_forward_char (n)
 #endif
 
   FRAME_CURSOR_X (frame) += n;
-  XFASTINT (w->last_point_x) = FRAME_CURSOR_X (frame);
-  XFASTINT (w->last_point) = point;
+  XSETFASTINT (w->last_point_x, FRAME_CURSOR_X (frame));
+  XSETFASTINT (w->last_point, point);
   cursor_to (FRAME_CURSOR_Y (frame), FRAME_CURSOR_X (frame));
   fflush (stdout);
 
@@ -2048,8 +2050,8 @@ change_frame_size (frame, newheight, newwidth, pretend, delay)
          /* Frame has both root and minibuffer.  */
          set_window_height (FRAME_ROOT_WINDOW (frame),
                             newheight - 1 - FRAME_MENU_BAR_LINES (frame), 0);
-         XFASTINT (XWINDOW (FRAME_MINIBUF_WINDOW (frame))->top)
-           = newheight - 1;
+         XSETFASTINT (XWINDOW (FRAME_MINIBUF_WINDOW (frame))->top,
+                      newheight - 1);
          set_window_height (FRAME_MINIBUF_WINDOW (frame), 1, 0);
        }
       else
@@ -2163,7 +2165,7 @@ Emacs was built without floating point support.\n\
   int sec, usec;
 
   if (NILP (milliseconds))
-    XSET (milliseconds, Lisp_Int, 0);
+    XSETINT (milliseconds, 0);
   else
     CHECK_NUMBER (milliseconds, 1);
   usec = XINT (milliseconds) * 1000;
@@ -2202,7 +2204,7 @@ Emacs was built without floating point support.\n\
   {
     Lisp_Object zero;
 
-    XFASTINT (zero) = 0;
+    XSETFASTINT (zero, 0);
     wait_reading_process_input (sec, usec, zero, 0);
   }
 
@@ -2256,10 +2258,6 @@ sit_for (sec, usec, reading, display)
 {
   Lisp_Object read_kbd;
 
-  if (CONSP (Vunread_command_events)
-      || unread_command_char != -1)
-    return Qnil;
-
   if (detect_input_pending ())
     return Qnil;
 
@@ -2273,7 +2271,7 @@ sit_for (sec, usec, reading, display)
   gobble_input (0);
 #endif
 
-  XSET (read_kbd, Lisp_Int, reading ? -1 : 1);
+  XSETINT (read_kbd, reading ? -1 : 1);
   wait_reading_process_input (sec, usec, read_kbd, display);
 
 
@@ -2322,7 +2320,7 @@ Value is t if waited the full time with no input arriving.")
   int sec, usec;
 
   if (NILP (milliseconds))
-    XSET (milliseconds, Lisp_Int, 0);
+    XSETINT (milliseconds, 0);
   else
     CHECK_NUMBER (milliseconds, 1);
   usec = XINT (milliseconds) * 1000;