Mercurial > emacs
diff lisp/whitespace.el @ 90140:02f1dbc4a199
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-35
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 228-240)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 53-58)
- Merge from emacs--cvs-trunk--0
- Update from CVS
- Collapse feature addition/removal within single ChangeLog entry
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 09 Apr 2005 02:16:29 +0000 |
parents | f3ec05478165 21f8452c722e |
children | 146c086df160 |
line wrap: on
line diff
--- a/lisp/whitespace.el Sat Apr 09 01:45:41 2005 +0000 +++ b/lisp/whitespace.el Sat Apr 09 02:16:29 2005 +0000 @@ -1,6 +1,6 @@ ;;; whitespace.el --- warn about and clean bogus whitespaces in the file -;; Copyright (C) 1999, 2000 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2005 Free Software Foundation, Inc. ;; Author: Rajesh Vaidheeswarran <rv@gnu.org> ;; Keywords: convenience @@ -319,7 +319,7 @@ :group 'faces) (defface whitespace-highlight-face '((((class color) (background light)) - (:background "green")) + (:background "green1")) (((class color) (background dark)) (:background "sea green")) (((class grayscale mono) @@ -489,16 +489,14 @@ (if whitespace-spacetab "s") (if whitespace-trailing "t"))))) (whitespace-update-modeline whitespace-this-modeline) - (save-excursion - (get-buffer-create whitespace-errbuf) - (kill-buffer whitespace-errbuf) - (get-buffer-create whitespace-errbuf) - (set-buffer whitespace-errbuf) + (if (get-buffer whitespace-errbuf) + (kill-buffer whitespace-errbuf)) + (with-current-buffer (get-buffer-create whitespace-errbuf) (if whitespace-errmsg (progn (insert whitespace-errmsg) (if (not (or quiet whitespace-silent)) - (display-buffer whitespace-errbuf t)) + (display-buffer (current-buffer) t)) (if (not quiet) (message "Whitespaces: [%s%s] in %s" whitespace-this-modeline @@ -511,9 +509,7 @@ (if (and (not quiet) (not (equal whitespace-clean-msg ""))) (message "%s %s" whitespace-filename whitespace-clean-msg)))))))) - (if whitespace-error - t - nil))) + whitespace-error)) ;;;###autoload (defun whitespace-region (s e) @@ -736,23 +732,17 @@ (defun whitespace-highlight-the-space (b e) "Highlight the current line, unhighlighting a previously jumped to line." (if whitespace-display-spaces-in-color - (progn + (let ((ol (whitespace-make-overlay b e))) (whitespace-unhighlight-the-space) - (add-to-list 'whitespace-highlighted-space - (whitespace-make-overlay b e)) - (whitespace-overlay-put (whitespace-make-overlay b e) 'face - 'whitespace-highlight-face)))) + (push ol whitespace-highlighted-space) + (whitespace-overlay-put ol 'face 'whitespace-highlight-face)))) ;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space)) (defun whitespace-unhighlight-the-space () "Unhighlight the currently highlight line." (if (and whitespace-display-spaces-in-color whitespace-highlighted-space) - (let ((whitespace-this-space nil)) - (while whitespace-highlighted-space - (setq whitespace-this-space (car whitespace-highlighted-space)) - (setq whitespace-highlighted-space - (cdr whitespace-highlighted-space)) - (whitespace-delete-overlay whitespace-this-space)) + (progn + (mapc 'whitespace-delete-overlay whitespace-highlighted-space) (setq whitespace-highlighted-space nil)) (remove-hook 'pre-command-hook 'whitespace-unhighlight-the-space))) @@ -863,5 +853,5 @@ (provide 'whitespace) -;;; arch-tag: 4ff44e87-b63c-402d-95a6-15e51e58bd0c +;; arch-tag: 4ff44e87-b63c-402d-95a6-15e51e58bd0c ;;; whitespace.el ends here