2013-02-15 Eli Zaretskii <eliz@gnu.org>
+ * 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
&& 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);