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

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

bug#7582: whitespace.el: whitespace-cleanup does not clean spaces before


From: Vinicius Jose Latorre
Subject: bug#7582: whitespace.el: whitespace-cleanup does not clean spaces before tabs
Date: Wed, 08 Dec 2010 17:35:10 -0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 SeaMonkey/2.0.10


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





reply via email to

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