Mercurial > emacs
comparison lisp/whitespace.el @ 83288:2c2b97b30980
Merged from miles@gnu.org--gnu-2005 (patch 60-65, 246-265)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-246
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-247
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-248
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-249
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-250
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-251
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-252
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-253
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-254
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-255
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-256
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-257
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-258
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-259
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-260
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-261
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-262
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-263
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-264
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-265
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-60
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-61
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-62
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-63
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-64
(mm-string-to-multibyte): Use Gnus trunk definition.
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-65
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-328
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 18 Apr 2005 13:40:23 +0000 |
parents | 9deb6323655c 875507693e78 |
children | e58cb448e07c |
comparison
equal
deleted
inserted
replaced
83287:b4b67a7fcbe0 | 83288:2c2b97b30980 |
---|---|
84 ;; `whitespace-cleanup-region' - To cleanup all whitespaces between point | 84 ;; `whitespace-cleanup-region' - To cleanup all whitespaces between point |
85 ;; and mark in the current buffer. | 85 ;; and mark in the current buffer. |
86 | 86 |
87 ;;; Code: | 87 ;;; Code: |
88 | 88 |
89 (defvar whitespace-version "3.4" "Version of the whitespace library.") | 89 (defvar whitespace-version "3.5" "Version of the whitespace library.") |
90 | 90 |
91 (defvar whitespace-all-buffer-files nil | 91 (defvar whitespace-all-buffer-files nil |
92 "An associated list of buffers and files checked for whitespace cleanliness. | 92 "An associated list of buffers and files checked for whitespace cleanliness. |
93 | 93 |
94 This is to enable periodic checking of whitespace cleanliness in the files | 94 This is to enable periodic checking of whitespace cleanliness in the files |
597 (setq pmin (point)) | 597 (setq pmin (point)) |
598 (end-of-line) | 598 (end-of-line) |
599 (setq pmax (point)) | 599 (setq pmax (point)) |
600 (if (equal pmin pmax) | 600 (if (equal pmin pmax) |
601 (progn | 601 (progn |
602 (whitespace-highlight-the-space pmin pmax) | 602 (whitespace-highlight-the-space pmin (1+ pmax)) |
603 t) | 603 t) |
604 nil)))) | 604 nil)))) |
605 | 605 |
606 (defun whitespace-buffer-leading-cleanup () | 606 (defun whitespace-buffer-leading-cleanup () |
607 "Remove any empty lines at the top of the file." | 607 "Remove any empty lines at the top of the file." |
635 (setq pmin (point)) | 635 (setq pmin (point)) |
636 (end-of-line) | 636 (end-of-line) |
637 (setq pmax (point)) | 637 (setq pmax (point)) |
638 (if (equal pmin pmax) | 638 (if (equal pmin pmax) |
639 (progn | 639 (progn |
640 (whitespace-highlight-the-space pmin pmax) | 640 (whitespace-highlight-the-space (- pmin 1) pmax) |
641 t) | 641 t) |
642 nil)) | 642 nil)) |
643 nil)))) | 643 nil)))) |
644 | 644 |
645 (defun whitespace-buffer-trailing-cleanup () | 645 (defun whitespace-buffer-trailing-cleanup () |
731 | 731 |
732 (defun whitespace-highlight-the-space (b e) | 732 (defun whitespace-highlight-the-space (b e) |
733 "Highlight the current line, unhighlighting a previously jumped to line." | 733 "Highlight the current line, unhighlighting a previously jumped to line." |
734 (if whitespace-display-spaces-in-color | 734 (if whitespace-display-spaces-in-color |
735 (let ((ol (whitespace-make-overlay b e))) | 735 (let ((ol (whitespace-make-overlay b e))) |
736 (whitespace-unhighlight-the-space) | |
737 (push ol whitespace-highlighted-space) | 736 (push ol whitespace-highlighted-space) |
738 (whitespace-overlay-put ol 'face 'whitespace-highlight-face)))) | 737 (whitespace-overlay-put ol 'face 'whitespace-highlight-face)))) |
739 ;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space)) | 738 ;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space)) |
740 | 739 |
741 (defun whitespace-unhighlight-the-space () | 740 (defun whitespace-unhighlight-the-space() |
742 "Unhighlight the currently highlight line." | 741 "Unhighlight the currently highlight line." |
743 (if (and whitespace-display-spaces-in-color whitespace-highlighted-space) | 742 (if (and whitespace-display-spaces-in-color whitespace-highlighted-space) |
744 (progn | 743 (progn |
745 (mapc 'whitespace-delete-overlay whitespace-highlighted-space) | 744 (mapc 'whitespace-delete-overlay whitespace-highlighted-space) |
746 (setq whitespace-highlighted-space nil)) | 745 (setq whitespace-highlighted-space nil)) |