From ef9c57e27aad0105ec058cc68377460763438af4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 15 Feb 2013 20:52:16 +0200 Subject: [PATCH] Fix bug #13720 with auto-save-timeout less than 4 seconds. src/keyboard.c (read_char): Fix calculation of auto-save time out when auto-save-timeout is less than 4. --- src/ChangeLog | 3 +++ src/keyboard.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1e1fe641ee5..1175e97688d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2013-02-15 Eli Zaretskii + * keyboard.c (read_char): Fix calculation of auto-save time out + when auto-save-timeout is less than 4. (Bug#13720) + * w32proc.c (new_child): Free up to 2 slots of dead processes at a time. Improve diagnostics in DebPrint. (reader_thread): If cp->char_avail is NULL, set the FILE_AT_EOF diff --git a/src/keyboard.c b/src/keyboard.c index fe1c3d77eb6..69c68d13943 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2657,9 +2657,10 @@ read_char (int commandflag, Lisp_Object map, && XINT (Vauto_save_timeout) > 0) { Lisp_Object tem0; - EMACS_INT timeout = (delay_level - * min (XFASTINT (Vauto_save_timeout) / 4, - MOST_POSITIVE_FIXNUM / delay_level)); + EMACS_INT timeout = XFASTINT (Vauto_save_timeout); + + timeout = min (timeout, MOST_POSITIVE_FIXNUM / delay_level * 4); + timeout = delay_level * timeout / 4; save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); tem0 = sit_for (make_number (timeout), 1, 1); -- 2.39.5