# HG changeset patch # User Gerd Moellmann # Date 941378359 0 # Node ID 912b004387d9327a0e3aecb3cdbbaae6c1c51cc6 # Parent 4ca4f3f6c4a048f3537ed95c25450caeebe307ee (whitespace-update-modeline): Bugfix to ensure that the modeline display was updated *only* when `whitespace-display-in-modeline' was set, not otherwise. diff -r 4ca4f3f6c4a0 -r 912b004387d9 lisp/whitespace.el --- a/lisp/whitespace.el Sun Oct 31 13:04:20 1999 +0000 +++ b/lisp/whitespace.el Sun Oct 31 13:59:19 1999 +0000 @@ -502,20 +502,21 @@ "Update modeline with whitespace errors and whitespaces whose testing has been turned off." (if whitespace-display-in-modeline - (setq whitespace-mode-line nil) - ;; Whitespace errors - (if (and whitespace-err (not (equal whitespace-err ""))) - (setq whitespace-mode-line whitespace-err)) - ;; Whitespace suppressed errors - (let ((whitespace-unchecked (whitespace-unchecked-whitespaces))) - (if whitespace-unchecked - (setq whitespace-mode-line - (concat whitespace-mode-line "!" whitespace-unchecked)))) - ;; Add the whitespace modeline prefix - (setq whitespace-mode-line (if whitespace-mode-line - (concat " W:" whitespace-mode-line) - nil)) - (whitespace-force-mode-line-update))) + (progn + (setq whitespace-mode-line nil) + ;; Whitespace errors + (if (and whitespace-err (not (equal whitespace-err ""))) + (setq whitespace-mode-line whitespace-err)) + ;; Whitespace suppressed errors + (let ((whitespace-unchecked (whitespace-unchecked-whitespaces))) + (if whitespace-unchecked + (setq whitespace-mode-line + (concat whitespace-mode-line "!" whitespace-unchecked)))) + ;; Add the whitespace modeline prefix + (setq whitespace-mode-line (if whitespace-mode-line + (concat " W:" whitespace-mode-line) + nil)) + (whitespace-force-mode-line-update)))) ;; Force mode line updation for different Emacs versions (defun whitespace-force-mode-line-update ()