diff options
| author | Richard M. Stallman | 1992-09-12 08:52:51 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-09-12 08:52:51 +0000 |
| commit | 51172b6d06f14a2f724418357dcc096537d69a5f (patch) | |
| tree | ce782e9a7a4ee3270f0b48e33473d610ff414374 /src | |
| parent | 65864ae07e2adcf0de133bfb626e2f5091c03cbb (diff) | |
| download | emacs-51172b6d06f14a2f724418357dcc096537d69a5f.tar.gz emacs-51172b6d06f14a2f724418357dcc096537d69a5f.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 17d81655c23..5b04990b055 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -165,12 +165,15 @@ static Lisp_Object Vauto_save_timeout; | |||
| 165 | /* Total number of times read_char has returned. */ | 165 | /* Total number of times read_char has returned. */ |
| 166 | int num_input_chars; | 166 | int num_input_chars; |
| 167 | 167 | ||
| 168 | /* Total number of times read_char has returned, outside of macros. */ | ||
| 169 | int num_nonmacro_input_chars; | ||
| 170 | |||
| 168 | /* Auto-save automatically when this many characters have been typed | 171 | /* Auto-save automatically when this many characters have been typed |
| 169 | since the last time. */ | 172 | since the last time. */ |
| 170 | 173 | ||
| 171 | static int auto_save_interval; | 174 | static int auto_save_interval; |
| 172 | 175 | ||
| 173 | /* Value of num_input_chars as of last auto save. */ | 176 | /* Value of num_nonmacro_input_chars as of last auto save. */ |
| 174 | 177 | ||
| 175 | int last_auto_save; | 178 | int last_auto_save; |
| 176 | 179 | ||
| @@ -527,7 +530,7 @@ recursive_edit_1 () | |||
| 527 | /* When an auto-save happens, record the "time", and don't do again soon. */ | 530 | /* When an auto-save happens, record the "time", and don't do again soon. */ |
| 528 | record_auto_save () | 531 | record_auto_save () |
| 529 | { | 532 | { |
| 530 | last_auto_save = num_input_chars; | 533 | last_auto_save = num_nonmacro_input_chars; |
| 531 | } | 534 | } |
| 532 | 535 | ||
| 533 | Lisp_Object recursive_edit_unwind (), command_loop (); | 536 | Lisp_Object recursive_edit_unwind (), command_loop (); |
| @@ -1158,7 +1161,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1158 | 1161 | ||
| 1159 | if (commandflag != 0 | 1162 | if (commandflag != 0 |
| 1160 | && auto_save_interval > 0 | 1163 | && auto_save_interval > 0 |
| 1161 | && num_input_chars - last_auto_save > max (auto_save_interval, 20) | 1164 | && num_nonmacro_input_chars - last_auto_save > max (auto_save_interval, 20) |
| 1162 | && !detect_input_pending ()) | 1165 | && !detect_input_pending ()) |
| 1163 | { | 1166 | { |
| 1164 | jmp_buf temp; | 1167 | jmp_buf temp; |
| @@ -1193,7 +1196,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1193 | 1196 | ||
| 1194 | /* Auto save if enough time goes by without input. */ | 1197 | /* Auto save if enough time goes by without input. */ |
| 1195 | if (commandflag != 0 | 1198 | if (commandflag != 0 |
| 1196 | && num_input_chars > last_auto_save | 1199 | && num_nonmacro_input_chars > last_auto_save |
| 1197 | && XTYPE (Vauto_save_timeout) == Lisp_Int | 1200 | && XTYPE (Vauto_save_timeout) == Lisp_Int |
| 1198 | && XINT (Vauto_save_timeout) > 0) | 1201 | && XINT (Vauto_save_timeout) > 0) |
| 1199 | { | 1202 | { |
| @@ -1286,6 +1289,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1286 | 1289 | ||
| 1287 | store_kbd_macro_char (c); | 1290 | store_kbd_macro_char (c); |
| 1288 | 1291 | ||
| 1292 | num_nonmacro_input_chars++; | ||
| 1293 | |||
| 1289 | from_macro: | 1294 | from_macro: |
| 1290 | reread_first: | 1295 | reread_first: |
| 1291 | echo_char (c); | 1296 | echo_char (c); |