changeset 1104:f3a7122a68e1

(num_nonmacro_input_chars): New variable. (read_char): Use num_nonmacro_input_chars to decide on auto-save & gc. Increment it when appropriate. (record_auto_save): Use num_nonmacro_input_chars.
author Richard M. Stallman <rms@gnu.org>
date Sat, 12 Sep 1992 08:52:51 +0000
parents ecaf2b70cd45
children 80ad8d0704ba
files src/keyboard.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Sat Sep 12 08:44:18 1992 +0000
+++ b/src/keyboard.c	Sat Sep 12 08:52:51 1992 +0000
@@ -165,12 +165,15 @@
 /* Total number of times read_char has returned.  */
 int num_input_chars;
 
+/* Total number of times read_char has returned, outside of macros.  */
+int num_nonmacro_input_chars;
+
 /* Auto-save automatically when this many characters have been typed
    since the last time.  */
 
 static int auto_save_interval;
 
-/* Value of num_input_chars as of last auto save.  */
+/* Value of num_nonmacro_input_chars as of last auto save.  */
 
 int last_auto_save;
 
@@ -527,7 +530,7 @@
 /* When an auto-save happens, record the "time", and don't do again soon.  */
 record_auto_save ()
 {
-  last_auto_save = num_input_chars;
+  last_auto_save = num_nonmacro_input_chars;
 }
 
 Lisp_Object recursive_edit_unwind (), command_loop ();
@@ -1158,7 +1161,7 @@
 
   if (commandflag != 0
       && auto_save_interval > 0
-      && num_input_chars - last_auto_save > max (auto_save_interval, 20)
+      && num_nonmacro_input_chars - last_auto_save > max (auto_save_interval, 20)
       && !detect_input_pending ())
     {
       jmp_buf temp;
@@ -1193,7 +1196,7 @@
 
       /* Auto save if enough time goes by without input.  */
       if (commandflag != 0
-	  && num_input_chars > last_auto_save
+	  && num_nonmacro_input_chars > last_auto_save
 	  && XTYPE (Vauto_save_timeout) == Lisp_Int
 	  && XINT (Vauto_save_timeout) > 0)
 	{
@@ -1286,6 +1289,8 @@
 
   store_kbd_macro_char (c);
 
+  num_nonmacro_input_chars++;
+
  from_macro:
  reread_first:
   echo_char (c);