From: Chong Yidong Date: Tue, 29 May 2012 11:51:19 +0000 (+0800) Subject: * whitespace.el (whitespace-cleanup): Fix whitespace-empty-at-bob-regexp usage. X-Git-Tag: emacs-24.2.90~471^2~6^2~57 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a149fa519d0cda67bead8ac74edbaf122da1ec91;p=emacs.git * whitespace.el (whitespace-cleanup): Fix whitespace-empty-at-bob-regexp usage. Fixes: debbugs:11492 --- 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 + + * whitespace.el (whitespace-cleanup): Fix usage of + whitespace-empty-at-bob-regexp (Bug#11492). + 2012-05-29 Aaron S. Hawley * 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)