]> code.delx.au - gnu-emacs/blobdiff - src/dispnew.c
(enum it_method): New enum.
[gnu-emacs] / src / dispnew.c
index 8a713857273a9b23d6ce6a2e37819b7e1fed46da..63a8a3a313f67c9ff9cdccde391db3ba96a94182 100644 (file)
@@ -1,6 +1,6 @@
 /* Updating of data structures for redisplay.
-   Copyright (C) 1985,86,87,88,93,94,95,97,98,1999,2000,01,02,03,04
-       Free Software Foundation, Inc.
+   Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, 1998, 1999,
+     2000, 2001, 2002, 2003, 2004, 2005  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -579,7 +579,7 @@ margin_glyphs_to_reserve (w, total_glyphs, margin)
       int width = XFASTINT (w->total_cols);
       double d = max (0, XFLOATINT (margin));
       d = min (width / 2 - 1, d);
-      n = (int) ((double) total_glyphs / width * d) * w->ncols_scale_factor;
+      n = (int) ((double) total_glyphs / width * d);
     }
   else
     n = 0;
@@ -2777,6 +2777,7 @@ build_frame_matrix_from_leaf_window (frame_matrix, w)
              SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph);
            }
 
+#if GLYPH_DEBUG
          /* Window row window_y must be a slice of frame row
             frame_y.  */
          xassert (glyph_row_slice_p (window_row, frame_row));
@@ -2784,7 +2785,6 @@ build_frame_matrix_from_leaf_window (frame_matrix, w)
          /* If rows are in sync, we don't have to copy glyphs because
             frame and window share glyphs.  */
 
-#if GLYPH_DEBUG
          strcpy (w->current_matrix->method, w->desired_matrix->method);
          add_window_display_history (w, w->current_matrix->method, 0);
 #endif
@@ -4065,17 +4065,17 @@ update_window (w, force_p)
   extern Lisp_Object do_mouse_tracking;
 #if GLYPH_DEBUG
   struct frame *f = XFRAME (WINDOW_FRAME (w));
-#endif
 
   /* Check that W's frame doesn't have glyph matrices.  */
   xassert (FRAME_WINDOW_P (f));
   xassert (updating_frame != NULL);
+#endif
 
   /* Check pending input the first time so that we can quickly return.  */
   if (redisplay_dont_pause)
     force_p = 1;
   else
-    detect_input_pending ();
+    detect_input_pending_ignore_squeezables ();
 
   /* If forced to complete the update, or if no input is pending, do
      the update.  */
@@ -4149,7 +4149,7 @@ update_window (w, force_p)
               scrolling large windows with repeated scroll-up
               commands will too quickly pause redisplay.  */
            if (!force_p && ++n_updated % preempt_count == 0)
-             detect_input_pending ();
+             detect_input_pending_ignore_squeezables ();
 
            changed_p |= update_window_line (w, vpos,
                                             &mouse_face_overwritten_p);
@@ -5093,7 +5093,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
 
   if (redisplay_dont_pause)
     force_p = 1;
-  else if (!force_p && detect_input_pending ())
+  else if (!force_p && detect_input_pending_ignore_squeezables ())
     {
       pause = 1;
       goto do_pause;
@@ -5149,7 +5149,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
            }
 
          if ((i - 1) % preempt_count == 0)
-           detect_input_pending ();
+           detect_input_pending_ignore_squeezables ();
 
          update_frame_line (f, i);
        }
@@ -5842,7 +5842,7 @@ mode_line_string (w, part, x, y, charpos, object, dx, dy, width, height)
          it's the one we were looking for.  */
       glyph = row->glyphs[TEXT_AREA];
       end = glyph + row->used[TEXT_AREA];
-      for (x0 = *x; glyph < end && x0 > glyph->pixel_width; ++glyph)
+      for (x0 = *x; glyph < end && x0 >= glyph->pixel_width; ++glyph)
        x0 -= glyph->pixel_width;
       *x = glyph - row->glyphs[TEXT_AREA];
       if (glyph < end)
@@ -5934,7 +5934,7 @@ marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height)
 
       glyph = row->glyphs[area];
       end = glyph + row->used[area];
-      for (x0 = *x - x0; glyph < end && x0 > glyph->pixel_width; ++glyph)
+      for (x0 = *x - x0; glyph < end && x0 >= glyph->pixel_width; ++glyph)
        x0 -= glyph->pixel_width;
       *x = glyph - row->glyphs[area];
       if (glyph < end)
@@ -5994,6 +5994,9 @@ window_change_signal (signalnum) /* If we don't have an argument, */
 #endif
   int old_errno = errno;
 
+  signal (SIGWINCH, window_change_signal);
+  SIGNAL_THREAD_CHECK (signalnum);
+
   get_frame_size (&width, &height);
 
   /* The frame size change obviously applies to a termcap-controlled
@@ -6016,7 +6019,6 @@ window_change_signal (signalnum) /* If we don't have an argument, */
       }
   }
 
-  signal (SIGWINCH, window_change_signal);
   errno = old_errno;
 }
 #endif /* SIGWINCH */
@@ -6331,52 +6333,13 @@ Emacs was built without floating point support.
   if (sec < 0 || (sec == 0 && usec == 0))
     return Qnil;
 
-  {
-    Lisp_Object zero;
-
-    XSETFASTINT (zero, 0);
-    wait_reading_process_input (sec, usec, zero, 0);
-  }
-
-  /* We should always have wait_reading_process_input; we have a dummy
-     implementation for systems which don't support subprocesses.  */
-#if 0
-  /* No wait_reading_process_input */
-  immediate_quit = 1;
-  QUIT;
-
-#ifdef VMS
-  sys_sleep (sec);
-#else /* not VMS */
-/* The reason this is done this way
-    (rather than defined (H_S) && defined (H_T))
-   is because the VMS preprocessor doesn't grok `defined'.  */
-#ifdef HAVE_SELECT
-  EMACS_GET_TIME (end_time);
-  EMACS_SET_SECS_USECS (timeout, sec, usec);
-  EMACS_ADD_TIME (end_time, end_time, timeout);
-
-  while (1)
-    {
-      EMACS_GET_TIME (timeout);
-      EMACS_SUB_TIME (timeout, end_time, timeout);
-      if (EMACS_TIME_NEG_P (timeout)
-         || !select (1, 0, 0, 0, &timeout))
-       break;
-    }
-#else /* not HAVE_SELECT */
-  sleep (sec);
-#endif /* HAVE_SELECT */
-#endif /* not VMS */
-
-  immediate_quit = 0;
-#endif /* no subprocesses */
+  wait_reading_process_output (sec, usec, 0, 0, Qnil, NULL, 0);
 
   return Qnil;
 }
 
 
-/* This is just like wait_reading_process_input, except that
+/* This is just like wait_reading_process_output, except that
    it does the redisplay.
 
    It's also much like Fsit_for, except that it can be used for
@@ -6386,8 +6349,6 @@ Lisp_Object
 sit_for (sec, usec, reading, display, initial_display)
      int sec, usec, reading, display, initial_display;
 {
-  Lisp_Object read_kbd;
-
   swallow_events (display);
 
   if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro))
@@ -6403,8 +6364,8 @@ sit_for (sec, usec, reading, display, initial_display)
   gobble_input (0);
 #endif
 
-  XSETINT (read_kbd, reading ? -1 : 1);
-  wait_reading_process_input (sec, usec, read_kbd, display);
+  wait_reading_process_output (sec, usec, reading ? -1 : 1, display,
+                              Qnil, NULL, 0);
 
   return detect_input_pending () ? Qnil : Qt;
 }