aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2006-07-10 18:51:31 +0000
committerChong Yidong2006-07-10 18:51:31 +0000
commit7ba07a1a03765521da615a59ce7ee2c596f8341d (patch)
tree16249c92bdcf0244e59e778644737131d3cbba9e /src
parent2946191dee63d8cbc6c025bb0c658c77241df76a (diff)
downloademacs-7ba07a1a03765521da615a59ce7ee2c596f8341d.tar.gz
emacs-7ba07a1a03765521da615a59ce7ee2c596f8341d.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/dispnew.c67
-rw-r--r--src/keyboard.c46
-rw-r--r--src/minibuf.c2
-rw-r--r--src/puresize.h2
5 files changed, 59 insertions, 70 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 79e32451f9d..cefc2f4048d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12006-07-10 Chong Yidong <cyd@stupidchicken.com>
2
3 * puresize.h (BASE_PURESIZE): Increment to 1211000.
4
5 * dispnew.c (Fredisplay): New function, equivalent to (sit-for 0).
6 (Fsit_for): Function deleted.
7
8 * keyboard.c (command_loop_1, Fexecute_extended_command): Call
9 sit_for instead of Fsit_for.
10
11 * minibuf.c (temp_echo_area_glyphs): Likewise.
12
12006-07-09 Stefan Monnier <monnier@iro.umontreal.ca> 132006-07-09 Stefan Monnier <monnier@iro.umontreal.ca>
2 14
3 * syntax.c (Fforward_comment): Revert the reversion. 15 * syntax.c (Fforward_comment): Revert the reversion.
diff --git a/src/dispnew.c b/src/dispnew.c
index e331d8628f2..857ae40ee34 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6495,10 +6495,7 @@ Emacs was built without floating point support.
6495 6495
6496 6496
6497/* This is just like wait_reading_process_output, except that 6497/* This is just like wait_reading_process_output, except that
6498 it does the redisplay. 6498 it does redisplay. */
6499
6500 It's also much like Fsit_for, except that it can be used for
6501 waiting for input as well. */
6502 6499
6503Lisp_Object 6500Lisp_Object
6504sit_for (sec, usec, reading, display, initial_display) 6501sit_for (sec, usec, reading, display, initial_display)
@@ -6535,56 +6532,20 @@ sit_for (sec, usec, reading, display, initial_display)
6535} 6532}
6536 6533
6537 6534
6538DEFUN ("sit-for", Fsit_for, Ssit_for, 1, 3, 0, 6535DEFUN ("redisplay", Fredisplay, Sredisplay, 0, 0, 0,
6539 doc: /* Perform redisplay, then wait for SECONDS seconds or until input is available. 6536 doc: /* Perform redisplay.
6540SECONDS may be a floating-point value, meaning that you can wait for a 6537If input is available before this starts, redisplay is preempted
6541fraction of a second. 6538unless `redisplay-dont-pause' is non-nil. */)
6542\(Not all operating systems support waiting for a fraction of a second.) 6539 ()
6543Optional arg NODISP non-nil means don't redisplay, just wait for input.
6544Redisplay is preempted as always if input arrives, and does not happen
6545if input is available before it starts.
6546Value is t if waited the full time with no input arriving.
6547
6548Redisplay will occur even when input is available if SECONDS is negative.
6549
6550An obsolete but still supported form is
6551\(sit-for SECONDS &optional MILLISECONDS NODISP)
6552Where the optional arg MILLISECONDS specifies an additional wait period,
6553in milliseconds; this was useful when Emacs was built without
6554floating point support.
6555usage: (sit-for SECONDS &optional NODISP OLD-NODISP) */)
6556
6557/* The `old-nodisp' stuff is there so that the arglist has the correct
6558 length. Otherwise, `defdvice' will redefine it with fewer args. */
6559 (seconds, milliseconds, nodisp)
6560 Lisp_Object seconds, milliseconds, nodisp;
6561{ 6540{
6562 int sec, usec; 6541 swallow_events (Qt);
6563 6542 if ((detect_input_pending_run_timers (Qt)
6564 if (NILP (nodisp) && !NUMBERP (milliseconds)) 6543 && NILP (Qredisplay_dont_pause))
6565 { /* New style. */ 6544 || !NILP (Vexecuting_kbd_macro))
6566 nodisp = milliseconds; 6545 return Qnil;
6567 milliseconds = Qnil;
6568 }
6569
6570 if (NILP (milliseconds))
6571 XSETINT (milliseconds, 0);
6572 else
6573 CHECK_NUMBER (milliseconds);
6574 usec = XINT (milliseconds) * 1000;
6575
6576 {
6577 double duration = extract_float (seconds);
6578 sec = (int) duration;
6579 usec += (duration - sec) * 1000000;
6580 }
6581
6582#ifndef EMACS_HAS_USECS
6583 if (usec != 0 && sec == 0)
6584 error ("Millisecond `sit-for' not supported on %s", SYSTEM_TYPE);
6585#endif
6586 6546
6587 return sit_for (sec, usec, 0, NILP (nodisp), NILP (nodisp)); 6547 redisplay_preserve_echo_area (2);
6548 return Qt;
6588} 6549}
6589 6550
6590 6551
@@ -6974,7 +6935,7 @@ syms_of_display ()
6974 defsubr (&Sframe_or_buffer_changed_p); 6935 defsubr (&Sframe_or_buffer_changed_p);
6975 defsubr (&Sopen_termscript); 6936 defsubr (&Sopen_termscript);
6976 defsubr (&Sding); 6937 defsubr (&Sding);
6977 defsubr (&Ssit_for); 6938 defsubr (&Sredisplay);
6978 defsubr (&Ssleep_for); 6939 defsubr (&Ssleep_for);
6979 defsubr (&Ssend_string_to_terminal); 6940 defsubr (&Ssend_string_to_terminal);
6980 defsubr (&Sinternal_show_cursor); 6941 defsubr (&Sinternal_show_cursor);
diff --git a/src/keyboard.c b/src/keyboard.c
index 07388428451..b955daa41d9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1488,9 +1488,11 @@ command_loop_1 ()
1488 /* Bind inhibit-quit to t so that C-g gets read in 1488 /* Bind inhibit-quit to t so that C-g gets read in
1489 rather than quitting back to the minibuffer. */ 1489 rather than quitting back to the minibuffer. */
1490 int count = SPECPDL_INDEX (); 1490 int count = SPECPDL_INDEX ();
1491 double duration = extract_float (Vminibuffer_message_timeout);
1491 specbind (Qinhibit_quit, Qt); 1492 specbind (Qinhibit_quit, Qt);
1492 1493
1493 Fsit_for (Vminibuffer_message_timeout, Qnil, Qnil); 1494 sit_for ((int) duration, (duration - (int) duration) * 1000000,
1495 0, Qt, Qt);
1494 /* Clear the echo area. */ 1496 /* Clear the echo area. */
1495 message2 (0, 0, 0); 1497 message2 (0, 0, 0);
1496 safe_run_hooks (Qecho_area_clear_hook); 1498 safe_run_hooks (Qecho_area_clear_hook);
@@ -9880,19 +9882,26 @@ give to the command you invoke, if it asks for an argument. */)
9880 Qmouse_movement))) 9882 Qmouse_movement)))
9881 { 9883 {
9882 /* But first wait, and skip the message if there is input. */ 9884 /* But first wait, and skip the message if there is input. */
9883 int delay_time; 9885 Lisp_Object waited;
9886
9884 if (!NILP (echo_area_buffer[0])) 9887 if (!NILP (echo_area_buffer[0]))
9885 /* This command displayed something in the echo area; 9888 {
9886 so wait a few seconds, then display our suggestion message. */ 9889 /* This command displayed something in the echo area;
9887 delay_time = (NUMBERP (Vsuggest_key_bindings) 9890 so wait a few seconds, then display our suggestion message. */
9888 ? XINT (Vsuggest_key_bindings) : 2); 9891 if (NUMBERP (Vsuggest_key_bindings))
9892 {
9893 double duration = extract_float (Vminibuffer_message_timeout);
9894 waited = sit_for ((int) duration,
9895 (duration - (int) duration) * 1000000,
9896 0, Qt, Qt);
9897 }
9898 else
9899 waited = sit_for (2, 0, 0, Qt, Qt);
9900 }
9889 else 9901 else
9890 /* This command left the echo area empty, 9902 waited = sit_for (0, 0, 0, Qt, Qt);
9891 so display our message immediately. */
9892 delay_time = 0;
9893 9903
9894 if (!NILP (Fsit_for (make_number (delay_time), Qnil, Qnil)) 9904 if (!NILP (waited) && ! CONSP (Vunread_command_events))
9895 && ! CONSP (Vunread_command_events))
9896 { 9905 {
9897 Lisp_Object binding; 9906 Lisp_Object binding;
9898 char *newmessage; 9907 char *newmessage;
@@ -9912,10 +9921,17 @@ give to the command you invoke, if it asks for an argument. */)
9912 message2_nolog (newmessage, 9921 message2_nolog (newmessage,
9913 strlen (newmessage), 9922 strlen (newmessage),
9914 STRING_MULTIBYTE (binding)); 9923 STRING_MULTIBYTE (binding));
9915 if (!NILP (Fsit_for ((NUMBERP (Vsuggest_key_bindings) 9924 if (NUMBERP (Vsuggest_key_bindings))
9916 ? Vsuggest_key_bindings : make_number (2)), 9925 {
9917 Qnil, Qnil)) 9926 double duration = extract_float (Vsuggest_key_bindings);
9918 && message_p) 9927 waited = sit_for ((int) duration,
9928 (duration - (int) duration) * 1000000,
9929 0, Qt, Qt);
9930 }
9931 else
9932 waited = sit_for (2, 0, 0, Qt, Qt);
9933
9934 if (!NILP (waited) && message_p)
9919 restore_message (); 9935 restore_message ();
9920 9936
9921 unbind_to (count, Qnil); 9937 unbind_to (count, Qnil);
diff --git a/src/minibuf.c b/src/minibuf.c
index 86d24e6647c..af8cfe33e37 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2692,7 +2692,7 @@ temp_echo_area_glyphs (string)
2692 insert_from_string (string, 0, 0, SCHARS (string), SBYTES (string), 0); 2692 insert_from_string (string, 0, 0, SCHARS (string), SBYTES (string), 0);
2693 SET_PT_BOTH (opoint, opoint_byte); 2693 SET_PT_BOTH (opoint, opoint_byte);
2694 Vinhibit_quit = Qt; 2694 Vinhibit_quit = Qt;
2695 Fsit_for (make_number (2), Qnil, Qnil); 2695 sit_for (2, 0, 0, Qt, Qt);
2696 del_range_both (osize, osize_byte, ZV, ZV_BYTE, 1); 2696 del_range_both (osize, osize_byte, ZV, ZV_BYTE, 1);
2697 SET_PT_BOTH (opoint, opoint_byte); 2697 SET_PT_BOTH (opoint, opoint_byte);
2698 if (!NILP (Vquit_flag)) 2698 if (!NILP (Vquit_flag))
diff --git a/src/puresize.h b/src/puresize.h
index fa01ad610a1..457a75ea023 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */
43#endif 43#endif
44 44
45#ifndef BASE_PURESIZE 45#ifndef BASE_PURESIZE
46#define BASE_PURESIZE (1210500 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) 46#define BASE_PURESIZE (1211000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
47#endif 47#endif
48 48
49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ 49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */