GNU bug report logs - #11492
whitespace.el (whitespace-cleanup) not cleaning beginning-of-buffer [PATCH]

Previous Next

Package: emacs;

Reported by: Kevin J. Fletcher <dev <at> kjfletch.co.uk>

Date: Wed, 16 May 2012 21:26:01 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11492 in the body.
You can then email your comments to 11492 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11492; Package emacs. (Wed, 16 May 2012 21:26:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kevin J. Fletcher <dev <at> kjfletch.co.uk>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 16 May 2012 21:26:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kevin J. Fletcher <dev <at> kjfletch.co.uk>
To: bug-gnu-emacs <at> gnu.org
Subject: whitespace.el (whitespace-cleanup) not cleaning beginning-of-buffer
	[PATCH]
Date: Wed, 16 May 2012 22:19:38 +0100
[Message part 1 (text/plain, inline)]
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 <at> kjfletch.co.uk>
	* lisp/whitespace.el (whitespace-cleanup): Fixed cleaning of
	whitespace at beginning of buffer.

[whitespace-bob.diff (text/x-diff, inline)]
=== 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)


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11492; Package emacs. (Tue, 29 May 2012 11:54:02 GMT) Full text and rfc822 format available.

Message #8 received at 11492 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Kevin J. Fletcher <dev <at> kjfletch.co.uk>
Cc: 11492 <at> debbugs.gnu.org
Subject: Re: bug#11492: whitespace.el (whitespace-cleanup) not cleaning
	beginning-of-buffer [PATCH]
Date: Tue, 29 May 2012 19:51:55 +0800
Kevin J. Fletcher <dev <at> 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.




bug closed, send any further explanations to 11492 <at> debbugs.gnu.org and Kevin J. Fletcher <dev <at> kjfletch.co.uk> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 29 May 2012 11:54:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 27 Jun 2012 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 318 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.