diff options
author | Chong Yidong <cyd@gnu.org> | 2012-05-29 19:51:19 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-05-29 19:51:19 +0800 |
commit | a149fa519d0cda67bead8ac74edbaf122da1ec91 (patch) | |
tree | 80b2915453d295058659a0630717727a2b7a3f4f | |
parent | 2b311310c35f1a75a9dfc77fc393c97320accdd9 (diff) | |
download | emacs-a149fa519d0cda67bead8ac74edbaf122da1ec91.tar.gz |
* whitespace.el (whitespace-cleanup): Fix whitespace-empty-at-bob-regexp usage.
Fixes: debbugs:11492
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/whitespace.el | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 03acd7edafa..2e4155e6c0d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-05-29 Chong Yidong <cyd@gnu.org> + + * whitespace.el (whitespace-cleanup): Fix usage of + whitespace-empty-at-bob-regexp (Bug#11492). + 2012-05-29 Aaron S. Hawley <aaron.s.hawley@gmail.com> * vc/vc.el (vc-revert, vc-rollback): Dont kill vc-diff buffer on diff --git a/lisp/whitespace.el b/lisp/whitespace.el index e752dc56553..a529725fc38 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -1533,8 +1533,7 @@ documentation." (when (memq 'empty whitespace-style) (let (overwrite-mode) ; enforce no overwrite (goto-char (point-min)) - (when (re-search-forward - (concat "\\`" whitespace-empty-at-bob-regexp) nil t) + (when (looking-at whitespace-empty-at-bob-regexp) (delete-region (match-beginning 1) (match-end 1))) (when (re-search-forward (concat whitespace-empty-at-eob-regexp "\\'") nil t) |