diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-06-12 07:27:12 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-06-12 07:27:12 +0000 |
commit | 476e9367ec1f440aa23904b7bc482ea4a3b8041c (patch) | |
tree | 4f7f5a5e9a6668f908834bb6e216c8fa3727d4b3 /lisp/whitespace.el | |
parent | a13f8f50d4cc544d3bbfa78568e82ce09e68bded (diff) | |
parent | 6b519504c3297595101628e823e72c91e562ab45 (diff) | |
download | emacs-476e9367ec1f440aa23904b7bc482ea4a3b8041c.tar.gz |
Merged from emacs@sv.gnu.org.
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-294
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-295
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-296
Update from CVS: admin/FOR-RELEASE: Update refcard section.
* emacs@sv.gnu.org/emacs--devo--0--patch-297
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-298
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-299
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-300
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-301
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-302
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-303
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-304
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-103
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-104
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-570
Diffstat (limited to 'lisp/whitespace.el')
-rw-r--r-- | lisp/whitespace.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 7f3cbd913ca..449606607f6 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -430,7 +430,7 @@ and: (if buffer-read-only (if (not quiet) (message "Can't cleanup: %s is read-only" (buffer-name))) - (whitespace-cleanup)) + (whitespace-cleanup-internal)) (let ((whitespace-leading (if whitespace-check-buffer-leading (whitespace-buffer-leading) nil)) @@ -520,6 +520,11 @@ and: "Cleanup the five different kinds of whitespace problems. See `whitespace-buffer' docstring for a summary of the problems." (interactive) + (if (and transient-mark-mode mark-active) + (whitespace-cleanup-region (region-beginning) (region-end)) + (whitespace-cleanup-internal))) + +(defun whitespace-cleanup-internal () ;; If this buffer really contains a file, then run, else quit. (whitespace-check-whitespace-mode current-prefix-arg) (if (and buffer-file-name whitespace-mode) @@ -563,7 +568,7 @@ See `whitespace-buffer' docstring for a summary of the problems." ;; Call this recursively till everything is taken care of (if whitespace-any - (whitespace-cleanup) + (whitespace-cleanup-internal) (progn (if (not whitespace-silent) (message "%s clean" buffer-file-name)) @@ -577,7 +582,7 @@ See `whitespace-buffer' docstring for a summary of the problems." (save-excursion (save-restriction (narrow-to-region s e) - (whitespace-cleanup)) + (whitespace-cleanup-internal)) (whitespace-buffer t))) (defun whitespace-buffer-leading () @@ -760,7 +765,7 @@ If timer is not set, then set it to scan the files in (if whitespace-auto-cleanup (progn ;;(message "cleaning up whitespace in %s" bufname) - (whitespace-cleanup)) + (whitespace-cleanup-internal)) (progn ;;(message "whitespace-buffer %s." (buffer-name)) (whitespace-buffer t)))) @@ -806,7 +811,7 @@ This is meant to be added buffer-locally to `write-file-functions'." (interactive) (let ((werr nil)) (if whitespace-auto-cleanup - (whitespace-cleanup) + (whitespace-cleanup-internal) (setq werr (whitespace-buffer))) (if (and whitespace-abort-on-error werr) (error (concat "Abort write due to whitespaces in " |