GNU bug report logs - #13837
24.2; Make it possible to turn whitespace-mode only when there are no existing problems

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Wed, 27 Feb 2013 21:45:02 UTC

Severity: wishlist

Found in version 24.2

Fixed in version 25.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Reuben Thomas <rrt <at> sc3d.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13837 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems
Date: Thu, 29 May 2014 20:02:49 +0100
[Message part 1 (text/plain, inline)]
Revised patch as promised. [Resent owing to addressing error the first time
around.]

=== modified file 'lisp/whitespace.el'
--- lisp/whitespace.el  2014-01-27 12:30:17 +0000
+++ lisp/whitespace.el  2014-01-28 00:41:32 +0000
@@ -1730,8 +1730,9 @@
    space-before-tab
    space-after-tab

-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
+If REPORT-IF-BOGUS is t, it reports only when there are any
+whitespace problems in buffer; if it is `never', it does not
+report problems.

 Report if some of the following whitespace problems exist:

@@ -1776,26 +1777,20 @@
    trailing
    space-after-tab

-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
+If REPORT-IF-BOGUS is t, it reports only when there are any
+whitespace problems in buffer; if it is `never', it does not
+report problems.

 Report if some of the following whitespace problems exist:

-* If `indent-tabs-mode' is non-nil:
-   empty               1. empty lines at beginning of buffer.
-   empty               2. empty lines at end of buffer.
-   trailing            3. SPACEs or TABs at end of line.
-   indentation         4. 8 or more SPACEs at beginning of line.
-   space-before-tab    5. SPACEs before TAB.
-   space-after-tab     6. 8 or more SPACEs after TAB.
-
-* If `indent-tabs-mode' is nil:
-   empty               1. empty lines at beginning of buffer.
-   empty               2. empty lines at end of buffer.
-   trailing            3. SPACEs or TABs at end of line.
-   indentation         4. TABS at beginning of line.
-   space-before-tab    5. SPACEs before TAB.
-   space-after-tab     6. 8 or more SPACEs after TAB.
+   empty               1. empty lines at beginning of buffer.
+   empty               2. empty lines at end of buffer.
+   trailing            3. SPACEs or TABs at end of line.
+   space-before-tab    4. SPACEs before TAB.
+   space-after-tab     5. 8 or more SPACEs after TAB.
+   indentation         6. If `indent-tabs-mode':
+                           8 or more SPACEs at beginning of line
+                           else: TABS at beginning of line.

 See `whitespace-style' for documentation.
 See also `whitespace-cleanup' and `whitespace-cleanup-region' for
@@ -1832,7 +1827,7 @@
                     (and (re-search-forward regexp rend t)
                          (setq has-bogus t))))
               whitespace-report-list)))
-       (when (if report-if-bogus has-bogus t)
+       (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus))
          (whitespace-kill-buffer whitespace-report-buffer-name)
          ;; `whitespace-indent-tabs-mode' is local to current buffer
          ;; `whitespace-tab-width' is local to current buffer

--
http://rrt.sc3d.org/



-- 
http://rrt.sc3d.org
[Message part 2 (text/html, inline)]

This bug report was last modified 10 years and 235 days ago.

Previous Next


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