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

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

bug#13837: 24.2; Make it possible to turn whitespace-mode only when ther


From: Stefan Monnier
Subject: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems
Date: Mon, 27 Jan 2014 19:32:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> -(defun whitespace-report (&optional force report-if-bogus)
> +(defun whitespace-report (&optional force report)

I'd leave the name unchanged.  Will make for a cleaner diff and the
name "report" is not convincingly better.

> +If REPORT is t, it reports only when there are any whitespace
> +problems in buffer; if it is 'never, it does not report problems.
                                ^^^^^^
should be                       `never'

> +problems in buffer; if it is 'never, it does not report problems.
                                ^^^^^^
should be                       `never'
 
>  * If `indent-tabs-mode' is non-nil:
> +   indentation               6. 8 or more SPACEs at beginning of line.
>  * If `indent-tabs-mode' is nil:
> +   indentation               6. TABS at beginning of line.

Why not

      indentation               6. if `indent-tabs-mode':
                                   8 or more SPACEs at beginning of line
                                   else: TABS at beginning of line.

> -     (when (if report-if-bogus has-bogus t)
> +     (when (if (equal report t) has-bogus (null report))

For better backward compatibility, this should check for `never' and
treat any other non-nil value as t.   IOW

        (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus))


-- Stefan





reply via email to

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