/* Keyboard and mouse input; editor command loop.
- Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99 Free Software Foundation, Inc.
+ Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99, 2000
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
key sequence that it reads. */
Lisp_Object read_key_sequence_cmd;
+/* Echo unfinished commands after this many seconds of pause. */
+Lisp_Object Vecho_keystrokes;
+
/* Form to evaluate (if non-nil) when Emacs is started. */
Lisp_Object Vtop_level;
static void restore_getcjmp ();
static Lisp_Object apply_modifiers P_ ((int, Lisp_Object));
-/* > 0 if we are to echo keystrokes. */
-static int echo_keystrokes;
-
/* Nonzero means don't try to suspend even if the operating system seems
to support it. */
static int cannot_suspend;
&& !current_kboard->immediate_echo
&& this_command_key_count > 0
&& ! noninteractive
- && echo_keystrokes > 0
+ && !NILP (Vecho_keystrokes)
&& (/* No message. */
NILP (echo_area_buffer[0])
/* Or empty message. */
echo_now ();
else
{
+ int sec, usec;
+ double duration = extract_float (Vecho_keystrokes);
+ sec = (int) duration;
+ usec += (duration - sec) * 1000000;
save_getcjmp (save_jump);
restore_getcjmp (local_getcjmp);
- tem0 = sit_for (echo_keystrokes, 0, 1, 1, 0);
+ tem0 = sit_for (sec, usec, 1, 1, 0);
restore_getcjmp (save_jump);
if (EQ (tem0, Qt)
&& ! CONSP (Vunread_command_events))
before_command_echo_length = echo_length ();
/* Don't echo mouse motion events. */
- if (echo_keystrokes
+ if (! NILP (Vecho_keystrokes)
&& ! (EVENT_HAS_PARAMETERS (c)
&& EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_movement)))
{
before_command_echo_length = echo_length ();
/* Don't echo mouse motion events. */
- if (echo_keystrokes)
+ if (! NILP (Vecho_keystrokes))
{
echo_char (c);
{
if (!NILP (prompt))
echo_prompt (XSTRING (prompt)->data);
- else if (cursor_in_echo_area && echo_keystrokes)
+ else if (cursor_in_echo_area && !NILP (Vecho_keystrokes))
/* This doesn't put in a dash if the echo buffer is empty, so
you don't always see a dash hanging out in the minibuffer. */
echo_dash ();
{
key = keybuf[t];
add_command_key (key);
- if (echo_keystrokes)
+ if (!NILP (Vecho_keystrokes))
echo_char (key);
}
Better ideas? */
for (; t < mock_input; t++)
{
- if (echo_keystrokes)
+ if (!NILP (Vecho_keystrokes))
echo_char (keybuf[t]);
add_command_key (keybuf[t]);
}
Emacs also does a garbage collection if that seems to be warranted.");
XSETFASTINT (Vauto_save_timeout, 30);
- DEFVAR_INT ("echo-keystrokes", &echo_keystrokes,
+ DEFVAR_LISP ("echo-keystrokes", &Vecho_keystrokes,
"*Nonzero means echo unfinished commands after this many seconds of pause.");
- echo_keystrokes = 1;
+ Vecho_keystrokes = make_number (1);
DEFVAR_INT ("polling-period", &polling_period,
"*Interval between polling for input during Lisp execution.\n\