]> code.delx.au - gnu-emacs/commitdiff
Fix error messages from jit-stealth-lock when load-average returns nil.
authorEli Zaretskii <eliz@gnu.org>
Tue, 4 Nov 2014 16:30:48 +0000 (18:30 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 4 Nov 2014 16:30:48 +0000 (18:30 +0200)
 lisp/jit-lock.el (jit-lock-stealth-fontify): Be tolerant to nil being
 returned by load-average.

lisp/ChangeLog
lisp/jit-lock.el

index 12a140d445d3170664289c963e78450aa20ce968..bad4def88f260820f46031048a22576e7a755d32 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * jit-lock.el (jit-lock-stealth-fontify): Be tolerant to nil being
+       returned by load-average.
+
 2014-11-04  Michael Albinus  <michael.albinus@gmx.de>
 
         * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer): Don't use
index 42e6519e38c77fce1dbe51e005cec162bdab0bd8..97df89a12d998bd323492f4c96b2cc3bcc8009c4 100644 (file)
@@ -503,7 +503,10 @@ non-nil in a repeated invocation of this function."
          message-log-max
          start)
       (if (and jit-lock-stealth-load
-              (> (car (load-average)) jit-lock-stealth-load))
+              ;; load-average can return nil.  The w32 emulation does
+              ;; that during the first few dozens of seconds after
+              ;; startup.
+              (> (or (car (load-average)) 0) jit-lock-stealth-load))
          ;; Wait a little if load is too high.
          (setq delay jit-lock-stealth-time)
        (if (buffer-live-p buffer)