]> code.delx.au - gnu-emacs/commitdiff
* puresize.h (BASE_PURESIZE): Increment to 1211000.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 10 Jul 2006 18:51:31 +0000 (18:51 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 10 Jul 2006 18:51:31 +0000 (18:51 +0000)
* dispnew.c (Fredisplay): New function, equivalent to (sit-for 0).
(Fsit_for): Function deleted.

* keyboard.c (command_loop_1, Fexecute_extended_command): Call
sit_for instead of Fsit_for.

* minibuf.c (temp_echo_area_glyphs): Likewise.

src/ChangeLog
src/dispnew.c
src/keyboard.c
src/minibuf.c
src/puresize.h

index 79e32451f9d805a88ae81e9dcc4a9313caed254e..cefc2f4048d65961cbc0c47b93aa8d07862aeb6a 100644 (file)
@@ -1,3 +1,15 @@
+2006-07-10  Chong Yidong  <cyd@stupidchicken.com>
+
+       * puresize.h (BASE_PURESIZE): Increment to 1211000.
+
+       * dispnew.c (Fredisplay): New function, equivalent to (sit-for 0).
+       (Fsit_for): Function deleted.
+
+       * keyboard.c (command_loop_1, Fexecute_extended_command): Call
+       sit_for instead of Fsit_for.
+
+       * minibuf.c (temp_echo_area_glyphs): Likewise.
+
 2006-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * syntax.c (Fforward_comment): Revert the reversion.
index e331d8628f2d86dffeb14642ed41d77830067202..857ae40ee34e9da10f587cb989e36e8fce46e16d 100644 (file)
@@ -6495,10 +6495,7 @@ Emacs was built without floating point support.
 
 
 /* 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
-   waiting for input as well.  */
+   it does redisplay.  */
 
 Lisp_Object
 sit_for (sec, usec, reading, display, initial_display)
@@ -6535,56 +6532,20 @@ sit_for (sec, usec, reading, display, initial_display)
 }
 
 
-DEFUN ("sit-for", Fsit_for, Ssit_for, 1, 3, 0,
-       doc: /* Perform redisplay, then wait for SECONDS seconds or until input is available.
-SECONDS may be a floating-point value, meaning that you can wait for a
-fraction of a second.
-\(Not all operating systems support waiting for a fraction of a second.)
-Optional arg NODISP non-nil means don't redisplay, just wait for input.
-Redisplay is preempted as always if input arrives, and does not happen
-if input is available before it starts.
-Value is t if waited the full time with no input arriving.
-
-Redisplay will occur even when input is available if SECONDS is negative.
-
-An obsolete but still supported form is
-\(sit-for SECONDS &optional MILLISECONDS NODISP)
-Where the optional arg MILLISECONDS specifies an additional wait period,
-in milliseconds; this was useful when Emacs was built without
-floating point support.
-usage: (sit-for SECONDS &optional NODISP OLD-NODISP) */)
-
-/* The `old-nodisp' stuff is there so that the arglist has the correct
-   length.  Otherwise, `defdvice' will redefine it with fewer args.  */
-     (seconds, milliseconds, nodisp)
-     Lisp_Object seconds, milliseconds, nodisp;
+DEFUN ("redisplay", Fredisplay, Sredisplay, 0, 0, 0,
+       doc: /* Perform redisplay.
+If input is available before this starts, redisplay is preempted
+unless `redisplay-dont-pause' is non-nil.  */)
+     ()
 {
-  int sec, usec;
-
-  if (NILP (nodisp) && !NUMBERP (milliseconds))
-    { /* New style.  */
-      nodisp = milliseconds;
-      milliseconds = Qnil;
-    }
-
-  if (NILP (milliseconds))
-    XSETINT (milliseconds, 0);
-  else
-    CHECK_NUMBER (milliseconds);
-  usec = XINT (milliseconds) * 1000;
-
-  {
-    double duration = extract_float (seconds);
-    sec = (int) duration;
-    usec += (duration - sec) * 1000000;
-  }
-
-#ifndef EMACS_HAS_USECS
-  if (usec != 0 && sec == 0)
-    error ("Millisecond `sit-for' not supported on %s", SYSTEM_TYPE);
-#endif
+  swallow_events (Qt);
+  if ((detect_input_pending_run_timers (Qt)
+       && NILP (Qredisplay_dont_pause))
+      || !NILP (Vexecuting_kbd_macro))
+    return Qnil;
 
-  return sit_for (sec, usec, 0, NILP (nodisp), NILP (nodisp));
+  redisplay_preserve_echo_area (2);
+  return Qt;
 }
 
 
@@ -6974,7 +6935,7 @@ syms_of_display ()
   defsubr (&Sframe_or_buffer_changed_p);
   defsubr (&Sopen_termscript);
   defsubr (&Sding);
-  defsubr (&Ssit_for);
+  defsubr (&Sredisplay);
   defsubr (&Ssleep_for);
   defsubr (&Ssend_string_to_terminal);
   defsubr (&Sinternal_show_cursor);
index 07388428451ed53dc3b98a1268a2bf2a22b29ad9..b955daa41d95e96791d5ede7a17c4484cf6fa51c 100644 (file)
@@ -1488,9 +1488,11 @@ command_loop_1 ()
          /* Bind inhibit-quit to t so that C-g gets read in
             rather than quitting back to the minibuffer.  */
          int count = SPECPDL_INDEX ();
+         double duration = extract_float (Vminibuffer_message_timeout);
          specbind (Qinhibit_quit, Qt);
 
-         Fsit_for (Vminibuffer_message_timeout, Qnil, Qnil);
+         sit_for ((int) duration, (duration - (int) duration) * 1000000,
+                  0, Qt, Qt);
          /* Clear the echo area.  */
          message2 (0, 0, 0);
          safe_run_hooks (Qecho_area_clear_hook);
@@ -9880,19 +9882,26 @@ give to the command you invoke, if it asks for an argument.  */)
                                      Qmouse_movement)))
     {
       /* But first wait, and skip the message if there is input.  */
-      int delay_time;
+      Lisp_Object waited;
+
       if (!NILP (echo_area_buffer[0]))
-       /* This command displayed something in the echo area;
-          so wait a few seconds, then display our suggestion message.  */
-       delay_time = (NUMBERP (Vsuggest_key_bindings)
-                     ? XINT (Vsuggest_key_bindings) : 2);
+       {
+         /* This command displayed something in the echo area;
+            so wait a few seconds, then display our suggestion message.  */
+         if (NUMBERP (Vsuggest_key_bindings))
+           {
+             double duration = extract_float (Vminibuffer_message_timeout);
+             waited = sit_for ((int) duration,
+                               (duration - (int) duration) * 1000000,
+                               0, Qt, Qt);
+           }
+         else
+           waited = sit_for (2, 0, 0, Qt, Qt);
+       }
       else
-       /* This command left the echo area empty,
-          so display our message immediately.  */
-       delay_time = 0;
+       waited = sit_for (0, 0, 0, Qt, Qt);
 
-      if (!NILP (Fsit_for (make_number (delay_time), Qnil, Qnil))
-         && ! CONSP (Vunread_command_events))
+      if (!NILP (waited) && ! CONSP (Vunread_command_events))
        {
          Lisp_Object binding;
          char *newmessage;
@@ -9912,10 +9921,17 @@ give to the command you invoke, if it asks for an argument.  */)
          message2_nolog (newmessage,
                          strlen (newmessage),
                          STRING_MULTIBYTE (binding));
-         if (!NILP (Fsit_for ((NUMBERP (Vsuggest_key_bindings)
-                               ? Vsuggest_key_bindings : make_number (2)),
-                              Qnil, Qnil))
-             && message_p)
+         if (NUMBERP (Vsuggest_key_bindings))
+           {
+             double duration = extract_float (Vsuggest_key_bindings);
+             waited = sit_for ((int) duration,
+                               (duration - (int) duration) * 1000000,
+                               0, Qt, Qt);
+           }
+         else
+           waited = sit_for (2, 0, 0, Qt, Qt);
+
+         if (!NILP (waited) && message_p)
            restore_message ();
 
          unbind_to (count, Qnil);
index 86d24e6647c29eb92d9aefcd216a77ff6d774503..af8cfe33e37ba2fb44b6128395cba04c0df0da1f 100644 (file)
@@ -2692,7 +2692,7 @@ temp_echo_area_glyphs (string)
   insert_from_string (string, 0, 0, SCHARS (string), SBYTES (string), 0);
   SET_PT_BOTH (opoint, opoint_byte);
   Vinhibit_quit = Qt;
-  Fsit_for (make_number (2), Qnil, Qnil);
+  sit_for (2, 0, 0, Qt, Qt);
   del_range_both (osize, osize_byte, ZV, ZV_BYTE, 1);
   SET_PT_BOTH (opoint, opoint_byte);
   if (!NILP (Vquit_flag))
index fa01ad610a15fbc2b64cce32117b3b7cd8497d72..457a75ea023647aa7411640bec41e7c19c2cafe8 100644 (file)
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA.  */
 #endif
 
 #ifndef BASE_PURESIZE
-#define BASE_PURESIZE (1210500 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
+#define BASE_PURESIZE (1211000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
 #endif
 
 /* Increase BASE_PURESIZE by a ratio depending on the machine's word size.  */