From: Eli Zaretskii Date: Fri, 15 Feb 2013 18:52:16 +0000 (+0200) Subject: Fix bug #13720 with auto-save-timeout less than 4 seconds. X-Git-Tag: emacs-24.3.90~173^2~7^2~33 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/ef9c57e27aad0105ec058cc68377460763438af4 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 1e1fe641ee..1175e97688 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 fe1c3d77eb..69c68d1394 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);