comparison lisp/whitespace.el @ 26259:912b004387d9

(whitespace-update-modeline): Bugfix to ensure that the modeline display was updated *only* when `whitespace-display-in-modeline' was set, not otherwise.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 31 Oct 1999 13:59:19 +0000
parents 3bb622df1c52
children 0a24f44a46f3
comparison
equal deleted inserted replaced
26258:4ca4f3f6c4a0 26259:912b004387d9
500 500
501 (defun whitespace-update-modeline (&optional whitespace-err) 501 (defun whitespace-update-modeline (&optional whitespace-err)
502 "Update modeline with whitespace errors and whitespaces whose testing has 502 "Update modeline with whitespace errors and whitespaces whose testing has
503 been turned off." 503 been turned off."
504 (if whitespace-display-in-modeline 504 (if whitespace-display-in-modeline
505 (setq whitespace-mode-line nil) 505 (progn
506 ;; Whitespace errors 506 (setq whitespace-mode-line nil)
507 (if (and whitespace-err (not (equal whitespace-err ""))) 507 ;; Whitespace errors
508 (setq whitespace-mode-line whitespace-err)) 508 (if (and whitespace-err (not (equal whitespace-err "")))
509 ;; Whitespace suppressed errors 509 (setq whitespace-mode-line whitespace-err))
510 (let ((whitespace-unchecked (whitespace-unchecked-whitespaces))) 510 ;; Whitespace suppressed errors
511 (if whitespace-unchecked 511 (let ((whitespace-unchecked (whitespace-unchecked-whitespaces)))
512 (setq whitespace-mode-line 512 (if whitespace-unchecked
513 (concat whitespace-mode-line "!" whitespace-unchecked)))) 513 (setq whitespace-mode-line
514 ;; Add the whitespace modeline prefix 514 (concat whitespace-mode-line "!" whitespace-unchecked))))
515 (setq whitespace-mode-line (if whitespace-mode-line 515 ;; Add the whitespace modeline prefix
516 (concat " W:" whitespace-mode-line) 516 (setq whitespace-mode-line (if whitespace-mode-line
517 nil)) 517 (concat " W:" whitespace-mode-line)
518 (whitespace-force-mode-line-update))) 518 nil))
519 (whitespace-force-mode-line-update))))
519 520
520 ;; Force mode line updation for different Emacs versions 521 ;; Force mode line updation for different Emacs versions
521 (defun whitespace-force-mode-line-update () 522 (defun whitespace-force-mode-line-update ()
522 "Force the mode line update for different flavors of Emacs." 523 "Force the mode line update for different flavors of Emacs."
523 (if whitespace-running-emacs 524 (if whitespace-running-emacs