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.

Full log


View this message in rfc822 format

From: Kevin J. Fletcher <dev <at> kjfletch.co.uk>
To: 11492 <at> debbugs.gnu.org
Subject: bug#11492: 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)


This bug report was last modified 12 years and 364 days ago.

Previous Next


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