307 |
:group 'whitespace) |
:group 'whitespace) |
308 |
|
|
309 |
(defcustom whitespace-display-spaces-in-color t |
(defcustom whitespace-display-spaces-in-color t |
310 |
"Display the bogus whitespaces by coloring them with |
"Display the bogus whitespaces by coloring them with the face |
311 |
`whitespace-highlight-face'." |
`whitespace-highlight'." |
312 |
:type 'boolean |
:type 'boolean |
313 |
:group 'whitespace) |
:group 'whitespace) |
314 |
|
|
318 |
:group 'whitespace |
:group 'whitespace |
319 |
:group 'faces) |
:group 'faces) |
320 |
|
|
321 |
(defface whitespace-highlight-face '((((class color) (background light)) |
(defface whitespace-highlight '((((class color) (background light)) |
322 |
(:background "green1")) |
(:background "green1")) |
323 |
(((class color) (background dark)) |
(((class color) (background dark)) |
324 |
(:background "sea green")) |
(:background "sea green")) |
325 |
(((class grayscale mono) |
(((class grayscale mono) |
326 |
(background light)) |
(background light)) |
327 |
(:background "black")) |
(:background "black")) |
328 |
(((class grayscale mono) |
(((class grayscale mono) |
329 |
(background dark)) |
(background dark)) |
330 |
(:background "white"))) |
(:background "white"))) |
331 |
"Face used for highlighting the bogus whitespaces that exist in the buffer." |
"Face used for highlighting the bogus whitespaces that exist in the buffer." |
332 |
:group 'whitespace-faces) |
:group 'whitespace-faces) |
333 |
|
;; backward-compatibility alias |
334 |
|
(put 'whitespace-highlight-face 'face-alias 'whitespace-highlight) |
335 |
|
|
336 |
(if (not (assoc 'whitespace-mode minor-mode-alist)) |
(if (not (assoc 'whitespace-mode minor-mode-alist)) |
337 |
(setq minor-mode-alist (cons '(whitespace-mode whitespace-mode-line) |
(setq minor-mode-alist (cons '(whitespace-mode whitespace-mode-line) |
736 |
(if whitespace-display-spaces-in-color |
(if whitespace-display-spaces-in-color |
737 |
(let ((ol (whitespace-make-overlay b e))) |
(let ((ol (whitespace-make-overlay b e))) |
738 |
(push ol whitespace-highlighted-space) |
(push ol whitespace-highlighted-space) |
739 |
(whitespace-overlay-put ol 'face 'whitespace-highlight-face)))) |
(whitespace-overlay-put ol 'face 'whitespace-highlight)))) |
740 |
;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space)) |
;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space)) |
741 |
|
|
742 |
(defun whitespace-unhighlight-the-space() |
(defun whitespace-unhighlight-the-space() |