]> code.delx.au - gnu-emacs/commitdiff
Fix bug #13720 with auto-save-timeout less than 4 seconds.
authorEli Zaretskii <eliz@gnu.org>
Fri, 15 Feb 2013 18:52:16 +0000 (20:52 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 15 Feb 2013 18:52:16 +0000 (20:52 +0200)
 src/keyboard.c (read_char): Fix calculation of auto-save time out
 when auto-save-timeout is less than 4.

src/ChangeLog
src/keyboard.c

index 1e1fe641ee5ed9c6836acd6284f0c7b686f3968c..1175e97688de9cac86acdd60be10afdec76c6ce2 100644 (file)
@@ -1,5 +1,8 @@
 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
index fe1c3d77eb6644a21ca17a173cac049c0919e764..69c68d13943c4c23ab4416f4b049b7374771cf41 100644 (file)
@@ -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);