* 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-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.
/* 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)
}
-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;
}
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);
/* 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);
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;
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);
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))
#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. */