1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-23 18:47:57 +00:00

(whitespace-update-modeline): Bugfix to ensure

that the modeline display was updated *only* when
`whitespace-display-in-modeline' was set, not otherwise.
This commit is contained in:
Gerd Moellmann 1999-10-31 13:59:19 +00:00
parent e82bd92274
commit 0e38b2a220

View File

@ -502,20 +502,21 @@ whitespace problems."
"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 ()