diff options
| author | Gerd Moellmann | 1999-10-31 13:59:19 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-10-31 13:59:19 +0000 |
| commit | 0e38b2a2206bae1fd4e120100615f8d51c316ed6 (patch) | |
| tree | f1087583756a12850e6038989852e9ba25dd950d | |
| parent | e82bd92274ff748a89c86600abfecf8d68930f32 (diff) | |
| download | emacs-0e38b2a2206bae1fd4e120100615f8d51c316ed6.tar.gz emacs-0e38b2a2206bae1fd4e120100615f8d51c316ed6.zip | |
(whitespace-update-modeline): Bugfix to ensure
that the modeline display was updated *only* when
`whitespace-display-in-modeline' was set, not otherwise.
| -rw-r--r-- | lisp/whitespace.el | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index b003798e65a..2b1385bf439 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -502,20 +502,21 @@ whitespace problems." | |||
| 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 () |