From a1740a150d2d15189b0e93878845e62a569c257f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 4 Nov 2014 18:30:48 +0200 Subject: [PATCH] Fix error messages from jit-stealth-lock when load-average returns nil. lisp/jit-lock.el (jit-lock-stealth-fontify): Be tolerant to nil being returned by load-average. --- lisp/ChangeLog | 5 +++++ lisp/jit-lock.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 12a140d445d..bad4def88f2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-11-04 Eli Zaretskii + + * jit-lock.el (jit-lock-stealth-fontify): Be tolerant to nil being + returned by load-average. + 2014-11-04 Michael Albinus * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer): Don't use diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index 42e6519e38c..97df89a12d9 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -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) -- 2.39.5