From 2bcac7667a8d99b3ff897eaa0efe11b79b074c0c Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 10 Oct 2006 01:20:20 +0000 Subject: [PATCH] * dispnew.c (sit_for): Sit forever if TIMEOUT is t. * keyboard.c (command_loop_1): Handle non-number values of `minibuffer-message-timeout'. (Fexecute_extended_command): Fix typo. * minibuf.c (temp_echo_area_glyphs): Sit for `minibuffer-message-timeout' seconds. --- src/ChangeLog | 6 ++++++ src/dispnew.c | 10 ++++++++-- src/keyboard.c | 10 ++++++---- src/minibuf.c | 7 ++----- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1a6c151b4b1..646fb439843 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2006-10-09 Chong Yidong + * dispnew.c (sit_for): Sit forever if TIMEOUT is t. + + * keyboard.c (command_loop_1): Handle non-number values of + `minibuffer-message-timeout'. + (Fexecute_extended_command): Fix typo. + * minibuf.c (temp_echo_area_glyphs): Sit for `minibuffer-message-timeout' seconds. diff --git a/src/dispnew.c b/src/dispnew.c index 02a3aedaf11..59f109df45b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6502,7 +6502,8 @@ Emacs was built without floating point support. /* This is just like wait_reading_process_output, except that it does redisplay. - TIMEOUT is number of seconds to wait (float or integer). + TIMEOUT is number of seconds to wait (float or integer), + or t to wait forever. READING is 1 if reading input. If DO_DISPLAY is >0 display process output while waiting. If DO_DISPLAY is >1 perform an initial redisplay before waiting. @@ -6535,10 +6536,15 @@ sit_for (timeout, reading, do_display) sec = (int) seconds; usec = (int) ((seconds - sec) * 1000000); } + else if (EQ (timeout, Qt)) + { + sec = 0; + usec = 0; + } else wrong_type_argument (Qnumberp, timeout); - if (sec == 0 && usec == 0) + if (sec == 0 && usec == 0 && !EQ (timeout, Qt)) return Qt; #ifdef SIGIO diff --git a/src/keyboard.c b/src/keyboard.c index 8518bcb98c1..eb46f99d668 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1546,15 +1546,17 @@ command_loop_1 () if (minibuf_level && !NILP (echo_area_buffer[0]) - && EQ (minibuf_window, echo_area_window) - && NUMBERP (Vminibuffer_message_timeout)) + && EQ (minibuf_window, echo_area_window)) { /* Bind inhibit-quit to t so that C-g gets read in rather than quitting back to the minibuffer. */ int count = SPECPDL_INDEX (); specbind (Qinhibit_quit, Qt); - sit_for (Vminibuffer_message_timeout, 0, 2); + if (NUMBERP (Vminibuffer_message_timeout)) + sit_for (Vminibuffer_message_timeout, 0, 2); + else + sit_for (Qt, 0, 2); /* Clear the echo area. */ message2 (0, 0, 0); @@ -9982,7 +9984,7 @@ give to the command you invoke, if it asks for an argument. */) if (NILP (echo_area_buffer[0])) waited = sit_for (make_number (0), 0, 2); else if (NUMBERP (Vsuggest_key_bindings)) - waited = sit_for (Vminibuffer_message_timeout, 0, 2); + waited = sit_for (Vsuggest_key_bindings, 0, 2); else waited = sit_for (make_number (2), 0, 2); diff --git a/src/minibuf.c b/src/minibuf.c index 19b06acc471..bb9c80b4e7d 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -2714,12 +2714,9 @@ temp_echo_area_glyphs (string) Vinhibit_quit = Qt; if (NUMBERP (Vminibuffer_message_timeout)) - { - if (Fgtr (Vminibuffer_message_timeout, make_number (0))) - sit_for (Vminibuffer_message_timeout, 0, 2); - } + sit_for (Vminibuffer_message_timeout, 0, 2); else - sit_for (make_number (-1), 0, 2); + sit_for (Qt, 0, 2); del_range_both (osize, osize_byte, ZV, ZV_BYTE, 1); SET_PT_BOTH (opoint, opoint_byte); -- 2.39.2