GNU bug report logs - #7582
whitespace.el: whitespace-cleanup does not clean spaces before tabs

Previous Next

Package: emacs;

Reported by: Jeff Dairiki <dairiki <at> dairiki.org>

Date: Tue, 7 Dec 2010 17:30:03 UTC

Severity: normal

Fixed in version 24.1

Done: Glenn Morris <rgm <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 7582 in the body.
You can then email your comments to 7582 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 owner <at> debbugs.gnu.org, viniciusjl <at> ig.com.br, bug-gnu-emacs <at> gnu.org:
bug#7582; Package emacs. (Tue, 07 Dec 2010 17:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jeff Dairiki <dairiki <at> dairiki.org>:
New bug report received and forwarded. Copy sent to viniciusjl <at> ig.com.br, bug-gnu-emacs <at> gnu.org. (Tue, 07 Dec 2010 17:30:04 GMT) Full text and rfc822 format available.

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

From: Jeff Dairiki <dairiki <at> dairiki.org>
To: bug-gnu-emacs <at> gnu.org
Subject: whitespace.el: whitespace-cleanup does not clean spaces before tabs
Date: Tue, 7 Dec 2010 09:34:26 -0800
`whitespace-cleanup-region' in whitespace.el (version 13.1) does not
clean up spaces before tabs if either:

 - `space-before-tab' is in `whitespace-style' and `indent-tabs-mode'
   non-nil

 - `space-before-tab::tab' is in `whitespace-style'.


Here's a patch (on whitespace.el version 13.1) which fixes the problem
for me.

diff --git a/site-lisp/whitespace.el b/site-lisp/whitespace.el
index a9fec09..5f5e822 100644
--- a/site-lisp/whitespace.el
+++ b/site-lisp/whitespace.el
@@ -1700,12 +1700,12 @@ documentation."
            (whitespace-replace-action
             (if whitespace-indent-tabs-mode 'tabify 'untabify)
             rstart rend whitespace-space-before-tab-regexp
-            (if whitespace-indent-tabs-mode 1 2)))
+            (if whitespace-indent-tabs-mode 0 2)))
           ;; ACTION: replace SPACEs before TAB by TABs.
           ((memq 'space-before-tab::tab whitespace-style)
            (whitespace-replace-action
             'tabify rstart rend
-            whitespace-space-before-tab-regexp 1))
+            whitespace-space-before-tab-regexp 0))
           ;; ACTION: replace TABs by SPACEs.
           ((memq 'space-before-tab::space whitespace-style)
            (whitespace-replace-action


Thanks for everything!

Jeff




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7582; Package emacs. (Wed, 08 Dec 2010 19:27:02 GMT) Full text and rfc822 format available.

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

From: Vinicius Jose Latorre <viniciusjl <at> ig.com.br>
To: Jeff Dairiki <dairiki <at> dairiki.org>
Cc: 7582 <at> debbugs.gnu.org
Subject: Re: bug#7582: whitespace.el: whitespace-cleanup does not clean spaces
	before tabs
Date: Wed, 08 Dec 2010 17:35:10 -0200
I've just updated the BZR Emacs and EmacsWiki.

Thanks for your patch,

Vinicius


Jeff Dairiki wrote:
> `whitespace-cleanup-region' in whitespace.el (version 13.1) does not
> clean up spaces before tabs if either:
>
>   - `space-before-tab' is in `whitespace-style' and `indent-tabs-mode'
>     non-nil
>
>   - `space-before-tab::tab' is in `whitespace-style'.
>
>
> Here's a patch (on whitespace.el version 13.1) which fixes the problem
> for me.
>
> diff --git a/site-lisp/whitespace.el b/site-lisp/whitespace.el
> index a9fec09..5f5e822 100644
> --- a/site-lisp/whitespace.el
> +++ b/site-lisp/whitespace.el
> @@ -1700,12 +1700,12 @@ documentation."
>              (whitespace-replace-action
>               (if whitespace-indent-tabs-mode 'tabify 'untabify)
>               rstart rend whitespace-space-before-tab-regexp
> -            (if whitespace-indent-tabs-mode 1 2)))
> +            (if whitespace-indent-tabs-mode 0 2)))
>             ;; ACTION: replace SPACEs before TAB by TABs.
>             ((memq 'space-before-tab::tab whitespace-style)
>              (whitespace-replace-action
>               'tabify rstart rend
> -            whitespace-space-before-tab-regexp 1))
> +            whitespace-space-before-tab-regexp 0))
>             ;; ACTION: replace TABs by SPACEs.
>             ((memq 'space-before-tab::space whitespace-style)
>              (whitespace-replace-action
>
>
> Thanks for everything!
>
> Jeff




bug marked as fixed in version 24.1, send any further explanations to Jeff Dairiki <dairiki <at> dairiki.org> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 09 Dec 2010 20:22: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. (Fri, 07 Jan 2011 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 167 days ago.

Previous Next


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