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: Jeff Dairiki
Subject: bug#7582: whitespace.el: whitespace-cleanup does not clean spaces before tabs
Date: Tue, 7 Dec 2010 09:34:26 -0800
User-agent: Mutt/1.5.18 (2008-05-17)

`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]