489 |
(if whitespace-spacetab "s") |
(if whitespace-spacetab "s") |
490 |
(if whitespace-trailing "t"))))) |
(if whitespace-trailing "t"))))) |
491 |
(whitespace-update-modeline whitespace-this-modeline) |
(whitespace-update-modeline whitespace-this-modeline) |
492 |
(save-excursion |
(if (get-buffer whitespace-errbuf) |
493 |
(get-buffer-create whitespace-errbuf) |
(kill-buffer whitespace-errbuf)) |
494 |
(kill-buffer whitespace-errbuf) |
(with-current-buffer (get-buffer-create whitespace-errbuf) |
|
(get-buffer-create whitespace-errbuf) |
|
|
(set-buffer whitespace-errbuf) |
|
495 |
(if whitespace-errmsg |
(if whitespace-errmsg |
496 |
(progn |
(progn |
497 |
(insert whitespace-errmsg) |
(insert whitespace-errmsg) |
498 |
(if (not (or quiet whitespace-silent)) |
(if (not (or quiet whitespace-silent)) |
499 |
(display-buffer whitespace-errbuf t)) |
(display-buffer (current-buffer) t)) |
500 |
(if (not quiet) |
(if (not quiet) |
501 |
(message "Whitespaces: [%s%s] in %s" |
(message "Whitespaces: [%s%s] in %s" |
502 |
whitespace-this-modeline |
whitespace-this-modeline |
509 |
(if (and (not quiet) (not (equal whitespace-clean-msg ""))) |
(if (and (not quiet) (not (equal whitespace-clean-msg ""))) |
510 |
(message "%s %s" whitespace-filename |
(message "%s %s" whitespace-filename |
511 |
whitespace-clean-msg)))))))) |
whitespace-clean-msg)))))))) |
512 |
(if whitespace-error |
whitespace-error)) |
|
t |
|
|
nil))) |
|
513 |
|
|
514 |
;;;###autoload |
;;;###autoload |
515 |
(defun whitespace-region (s e) |
(defun whitespace-region (s e) |
732 |
(defun whitespace-highlight-the-space (b e) |
(defun whitespace-highlight-the-space (b e) |
733 |
"Highlight the current line, unhighlighting a previously jumped to line." |
"Highlight the current line, unhighlighting a previously jumped to line." |
734 |
(if whitespace-display-spaces-in-color |
(if whitespace-display-spaces-in-color |
735 |
(progn |
(let ((ol (whitespace-make-overlay b e))) |
736 |
(whitespace-unhighlight-the-space) |
(whitespace-unhighlight-the-space) |
737 |
(add-to-list 'whitespace-highlighted-space |
(push ol whitespace-highlighted-space) |
738 |
(whitespace-make-overlay b e)) |
(whitespace-overlay-put ol 'face 'whitespace-highlight-face)))) |
|
(whitespace-overlay-put (whitespace-make-overlay b e) 'face |
|
|
'whitespace-highlight-face)))) |
|
739 |
;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space)) |
;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space)) |
740 |
|
|
741 |
(defun whitespace-unhighlight-the-space () |
(defun whitespace-unhighlight-the-space () |
742 |
"Unhighlight the currently highlight line." |
"Unhighlight the currently highlight line." |
743 |
(if (and whitespace-display-spaces-in-color whitespace-highlighted-space) |
(if (and whitespace-display-spaces-in-color whitespace-highlighted-space) |
744 |
(let ((whitespace-this-space nil)) |
(progn |
745 |
(while whitespace-highlighted-space |
(mapc 'whitespace-delete-overlay 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)) |
|
746 |
(setq whitespace-highlighted-space nil)) |
(setq whitespace-highlighted-space nil)) |
747 |
(remove-hook 'pre-command-hook 'whitespace-unhighlight-the-space))) |
(remove-hook 'pre-command-hook 'whitespace-unhighlight-the-space))) |
748 |
|
|
853 |
|
|
854 |
(provide 'whitespace) |
(provide 'whitespace) |
855 |
|
|
856 |
;;; arch-tag: 4ff44e87-b63c-402d-95a6-15e51e58bd0c |
;; arch-tag: 4ff44e87-b63c-402d-95a6-15e51e58bd0c |
857 |
;;; whitespace.el ends here |
;;; whitespace.el ends here |