* bug#11492: whitespace.el (whitespace-cleanup) not cleaning beginning-of-buffer [PATCH]
@ 2012-05-16 21:19 Kevin J. Fletcher
2012-05-29 11:51 ` Chong Yidong
0 siblings, 1 reply; 2+ messages in thread
From: Kevin J. Fletcher @ 2012-05-16 21:19 UTC (permalink / raw)
To: 11492
[-- Attachment #1: Type: text/plain, Size: 323 bytes --]
whitespace.el: (whitespace-cleanup) fails to clean whitespace at
beginning of buffer due to a failed regexp starting with "\\`^".
This patch removes the "^" from the regexp.
2012-05-16 Kevin Fletcher <dev@kjfletch.co.uk>
* lisp/whitespace.el (whitespace-cleanup): Fixed cleaning of
whitespace at beginning of buffer.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: whitespace-bob.diff --]
[-- Type: text/x-diff, Size: 922 bytes --]
=== modified file 'lisp/whitespace.el'
*** lisp/whitespace.el 2012-01-19 07:21:25 +0000
--- lisp/whitespace.el 2012-05-16 20:56:53 +0000
*************** documentation."
*** 1534,1540 ****
(let (overwrite-mode) ; enforce no overwrite
(goto-char (point-min))
(when (re-search-forward
! (concat "\\`" whitespace-empty-at-bob-regexp) nil t)
(delete-region (match-beginning 1) (match-end 1)))
(when (re-search-forward
(concat whitespace-empty-at-eob-regexp "\\'") nil t)
--- 1534,1543 ----
(let (overwrite-mode) ; enforce no overwrite
(goto-char (point-min))
(when (re-search-forward
! (concat "\\`"
! (replace-regexp-in-string
! "^\\^" "" whitespace-empty-at-bob-regexp))
! nil t)
(delete-region (match-beginning 1) (match-end 1)))
(when (re-search-forward
(concat whitespace-empty-at-eob-regexp "\\'") nil t)
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#11492: whitespace.el (whitespace-cleanup) not cleaning beginning-of-buffer [PATCH]
2012-05-16 21:19 bug#11492: whitespace.el (whitespace-cleanup) not cleaning beginning-of-buffer [PATCH] Kevin J. Fletcher
@ 2012-05-29 11:51 ` Chong Yidong
0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-05-29 11:51 UTC (permalink / raw)
To: Kevin J. Fletcher; +Cc: 11492
Kevin J. Fletcher <dev@kjfletch.co.uk> writes:
> whitespace.el: (whitespace-cleanup) fails to clean whitespace at
> beginning of buffer due to a failed regexp starting with "\\`^".
>
> This patch removes the "^" from the regexp.
I fixed in this trunk using looking-at instead. Thanks for the report.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-29 11:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-16 21:19 bug#11492: whitespace.el (whitespace-cleanup) not cleaning beginning-of-buffer [PATCH] Kevin J. Fletcher
2012-05-29 11:51 ` Chong Yidong
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).