bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11492: whitespace.el (whitespace-cleanup) not cleaning beginning-of-


From: Kevin J . Fletcher
Subject: bug#11492: whitespace.el (whitespace-cleanup) not cleaning beginning-of-buffer [PATCH]
Date: Wed, 16 May 2012 22:19:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

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 <address@hidden>
        * lisp/whitespace.el (whitespace-cleanup): Fixed cleaning of
        whitespace at beginning of buffer.

=== 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 via email to

[Prev in Thread] Current Thread [Next in Thread]