aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Love2000-02-18 20:10:00 +0000
committerDave Love2000-02-18 20:10:00 +0000
commit39aab6799083f44d5e869b75b2c2f749e636b482 (patch)
tree3645943848f1011f7e47b00f59d679abe0f6f240 /src
parentd59b6ae627531547849514b33fa50fb3e4b14f1a (diff)
downloademacs-39aab6799083f44d5e869b75b2c2f749e636b482.tar.gz
emacs-39aab6799083f44d5e869b75b2c2f749e636b482.zip
(echo_keystrokes): Remove declaration.
(Vecho_keystrokes) New variable. (read_char, record_menu_key, read_key_sequence): Use it to allow use of float value. (syms_of_keyboard): Change Vecho_keystrokes declaration.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 0b145454729..996894bc72a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1,5 +1,6 @@
1/* Keyboard and mouse input; editor command loop. 1/* Keyboard and mouse input; editor command loop.
2 Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99 Free Software Foundation, Inc. 2 Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99, 2000
3 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -378,6 +379,9 @@ Lisp_Object Qtimer_event_handler;
378 key sequence that it reads. */ 379 key sequence that it reads. */
379Lisp_Object read_key_sequence_cmd; 380Lisp_Object read_key_sequence_cmd;
380 381
382/* Echo unfinished commands after this many seconds of pause. */
383Lisp_Object Vecho_keystrokes;
384
381/* Form to evaluate (if non-nil) when Emacs is started. */ 385/* Form to evaluate (if non-nil) when Emacs is started. */
382Lisp_Object Vtop_level; 386Lisp_Object Vtop_level;
383 387
@@ -638,9 +642,6 @@ static void save_getcjmp ();
638static void restore_getcjmp (); 642static void restore_getcjmp ();
639static Lisp_Object apply_modifiers P_ ((int, Lisp_Object)); 643static Lisp_Object apply_modifiers P_ ((int, Lisp_Object));
640 644
641/* > 0 if we are to echo keystrokes. */
642static int echo_keystrokes;
643
644/* Nonzero means don't try to suspend even if the operating system seems 645/* Nonzero means don't try to suspend even if the operating system seems
645 to support it. */ 646 to support it. */
646static int cannot_suspend; 647static int cannot_suspend;
@@ -2150,7 +2151,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2150 && !current_kboard->immediate_echo 2151 && !current_kboard->immediate_echo
2151 && this_command_key_count > 0 2152 && this_command_key_count > 0
2152 && ! noninteractive 2153 && ! noninteractive
2153 && echo_keystrokes > 0 2154 && !NILP (Vecho_keystrokes)
2154 && (/* No message. */ 2155 && (/* No message. */
2155 NILP (echo_area_buffer[0]) 2156 NILP (echo_area_buffer[0])
2156 /* Or empty message. */ 2157 /* Or empty message. */
@@ -2170,9 +2171,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2170 echo_now (); 2171 echo_now ();
2171 else 2172 else
2172 { 2173 {
2174 int sec, usec;
2175 double duration = extract_float (Vecho_keystrokes);
2176 sec = (int) duration;
2177 usec += (duration - sec) * 1000000;
2173 save_getcjmp (save_jump); 2178 save_getcjmp (save_jump);
2174 restore_getcjmp (local_getcjmp); 2179 restore_getcjmp (local_getcjmp);
2175 tem0 = sit_for (echo_keystrokes, 0, 1, 1, 0); 2180 tem0 = sit_for (sec, usec, 1, 1, 0);
2176 restore_getcjmp (save_jump); 2181 restore_getcjmp (save_jump);
2177 if (EQ (tem0, Qt) 2182 if (EQ (tem0, Qt)
2178 && ! CONSP (Vunread_command_events)) 2183 && ! CONSP (Vunread_command_events))
@@ -2603,7 +2608,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2603 before_command_echo_length = echo_length (); 2608 before_command_echo_length = echo_length ();
2604 2609
2605 /* Don't echo mouse motion events. */ 2610 /* Don't echo mouse motion events. */
2606 if (echo_keystrokes 2611 if (! NILP (Vecho_keystrokes)
2607 && ! (EVENT_HAS_PARAMETERS (c) 2612 && ! (EVENT_HAS_PARAMETERS (c)
2608 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_movement))) 2613 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_movement)))
2609 { 2614 {
@@ -2673,7 +2678,7 @@ record_menu_key (c)
2673 before_command_echo_length = echo_length (); 2678 before_command_echo_length = echo_length ();
2674 2679
2675 /* Don't echo mouse motion events. */ 2680 /* Don't echo mouse motion events. */
2676 if (echo_keystrokes) 2681 if (! NILP (Vecho_keystrokes))
2677 { 2682 {
2678 echo_char (c); 2683 echo_char (c);
2679 2684
@@ -7453,7 +7458,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
7453 { 7458 {
7454 if (!NILP (prompt)) 7459 if (!NILP (prompt))
7455 echo_prompt (XSTRING (prompt)->data); 7460 echo_prompt (XSTRING (prompt)->data);
7456 else if (cursor_in_echo_area && echo_keystrokes) 7461 else if (cursor_in_echo_area && !NILP (Vecho_keystrokes))
7457 /* This doesn't put in a dash if the echo buffer is empty, so 7462 /* This doesn't put in a dash if the echo buffer is empty, so
7458 you don't always see a dash hanging out in the minibuffer. */ 7463 you don't always see a dash hanging out in the minibuffer. */
7459 echo_dash (); 7464 echo_dash ();
@@ -7599,7 +7604,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
7599 { 7604 {
7600 key = keybuf[t]; 7605 key = keybuf[t];
7601 add_command_key (key); 7606 add_command_key (key);
7602 if (echo_keystrokes) 7607 if (!NILP (Vecho_keystrokes))
7603 echo_char (key); 7608 echo_char (key);
7604 } 7609 }
7605 7610
@@ -8388,7 +8393,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
8388 Better ideas? */ 8393 Better ideas? */
8389 for (; t < mock_input; t++) 8394 for (; t < mock_input; t++)
8390 { 8395 {
8391 if (echo_keystrokes) 8396 if (!NILP (Vecho_keystrokes))
8392 echo_char (keybuf[t]); 8397 echo_char (keybuf[t]);
8393 add_command_key (keybuf[t]); 8398 add_command_key (keybuf[t]);
8394 } 8399 }
@@ -9933,9 +9938,9 @@ After auto-saving due to this many seconds of idle time,\n\
9933Emacs also does a garbage collection if that seems to be warranted."); 9938Emacs also does a garbage collection if that seems to be warranted.");
9934 XSETFASTINT (Vauto_save_timeout, 30); 9939 XSETFASTINT (Vauto_save_timeout, 30);
9935 9940
9936 DEFVAR_INT ("echo-keystrokes", &echo_keystrokes, 9941 DEFVAR_LISP ("echo-keystrokes", &Vecho_keystrokes,
9937 "*Nonzero means echo unfinished commands after this many seconds of pause."); 9942 "*Nonzero means echo unfinished commands after this many seconds of pause.");
9938 echo_keystrokes = 1; 9943 Vecho_keystrokes = make_number (1);
9939 9944
9940 DEFVAR_INT ("polling-period", &polling_period, 9945 DEFVAR_INT ("polling-period", &polling_period,
9941 "*Interval between polling for input during Lisp execution.\n\ 9946 "*Interval between polling for input during Lisp execution.\n\