unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin J. Fletcher <dev@kjfletch.co.uk>
To: 11492@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	[thread overview]
Message-ID: <87d363u8lx.fsf@kjfletch.co.uk> (raw)

[-- 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)


             reply	other threads:[~2012-05-16 21:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16 21:19 Kevin J. Fletcher [this message]
2012-05-29 11:51 ` bug#11492: whitespace.el (whitespace-cleanup) not cleaning beginning-of-buffer [PATCH] Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d363u8lx.fsf@kjfletch.co.uk \
    --to=dev@kjfletch.co.uk \
    --cc=11492@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).