From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reuben Thomas Newsgroups: gmane.emacs.bugs Subject: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Date: Tue, 28 Jan 2014 00:48:21 +0000 Message-ID: References: <1390857567.273549.1665@skwd> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11395aaa51d95604f0fd2eb2 X-Trace: ger.gmane.org 1390870152 18291 80.91.229.3 (28 Jan 2014 00:49:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jan 2014 00:49:12 +0000 (UTC) Cc: 13837@debbugs.gnu.org, Dmitry Gutov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 28 01:49:19 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W7wrf-0005pM-5t for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Jan 2014 01:49:19 +0100 Original-Received: from localhost ([::1]:34334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7wre-00074A-Nc for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Jan 2014 19:49:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7wrT-0006vI-SR for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 19:49:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7wrP-0002uk-10 for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 19:49:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7wrO-0002ub-QV for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 19:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W7wrO-0002aL-AX for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 19:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Reuben Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Jan 2014 00:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13837-submit@debbugs.gnu.org id=B13837.13908701059878 (code B ref 13837); Tue, 28 Jan 2014 00:49:02 +0000 Original-Received: (at 13837) by debbugs.gnu.org; 28 Jan 2014 00:48:25 +0000 Original-Received: from localhost ([127.0.0.1]:38474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7wqm-0002ZF-U2 for submit@debbugs.gnu.org; Mon, 27 Jan 2014 19:48:25 -0500 Original-Received: from mail-qa0-f43.google.com ([209.85.216.43]:58035) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7wqk-0002Z6-C9 for 13837@debbugs.gnu.org; Mon, 27 Jan 2014 19:48:23 -0500 Original-Received: by mail-qa0-f43.google.com with SMTP id o15so8291732qap.16 for <13837@debbugs.gnu.org>; Mon, 27 Jan 2014 16:48:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=1i4VidyeGK5qv2xkByavXSRmwo/AzXUs6/jb8AKZfwQ=; b=loRGsmUSRVqbNGzaMnLjpV/fXeceuU3PKEMGYN9S1ICykdCvz/c0b+sVhyxiPF6b9z us6lpYanyLCA6UKYk8XXL1FQhQvxK3/Qc27i3W31ACLNItzqgbHwDCVagBUpLzp40lWF V3889FO7eLMsUa9uNboTXJpQrJ2mL14++GGlc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=1i4VidyeGK5qv2xkByavXSRmwo/AzXUs6/jb8AKZfwQ=; b=Zk4E97KGlcrP67jDCbKPpKCauLh0bY50AqO5bpXg7yZ0Dyt5Ql/55b1MvgNoL8AF4w TWyNSY5LRdZpVteFr3gaAQ643FpAKasFPhKSyh3Jh4URzoTFSnQfDOU033gbHGi05xv4 B3U7JnROrtbhGbp6AWpzm/bm0LUDryFTcVdfEe+JwLrcW/kLqvbEW+Uyt9UVi8WDh361 IijIQ/CcVGURETUxPxscwqjf9bm+nBc2s6oe4r3YEbk/3einoxems91q9F+HuJ0TR/YY emm1wXA4teVJINBW+37O5HYcQSEOT/ZnHX/BzGhuqBs5rPWDw4UdqN0f9bxCYe9mPUg6 noPg== X-Gm-Message-State: ALoCoQlJpgEKBt510uV1jDCRNzf25iv6TMbWkszE+x9J3vvS9X5fagUPjl+KwMNe4u2UV8vj0X9J X-Received: by 10.140.46.119 with SMTP id j110mr45397026qga.32.1390870101340; Mon, 27 Jan 2014 16:48:21 -0800 (PST) Original-Received: by 10.229.172.137 with HTTP; Mon, 27 Jan 2014 16:48:21 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84147 Archived-At: --001a11395aaa51d95604f0fd2eb2 Content-Type: text/plain; charset=ISO-8859-1 On 28 January 2014 00:32, Stefan Monnier wrote: > > -(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. > Sure, OK. > > +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. > OK. > > - (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)) > Fine, revised patch to follow. -- http://rrt.sc3d.org --001a11395aaa51d95604f0fd2eb2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 2= 8 January 2014 00:32, Stefan Monnier <monnier@iro.umontreal.ca&= gt; wrote:
> -(defun whitespace-re= port (&optional force report-if-bogus)
> +(defun whitespace-report (&optional force report)

I'd leave the name unchanged. =A0Will make for a cleaner diff and= the
name "report" is not convincingly better.
Sure, OK.
=A0
> +If REPORT is t, it reports only when there are any whitespace
> +problems in buffer; if it is 'never, it does not report problems.=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^= ^
should be =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 `never'

> +problems in buffer; if it is 'never, it does not report problems.=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^= ^
should be =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 `never'

> =A0* If `indent-tabs-mode' is non-nil:
> + =A0 indentation =A0 =A0 =A0 =A0 =A0 =A0 =A0 = 6. 8 or more SPACEs at beginning of line.
> =A0* If `indent-tabs-mode' is nil:
> + =A0 indentation =A0 =A0 =A0 =A0 =A0 =A0 =A0 = 6. TABS at beginning of line.

Why not

=A0 =A0 =A0 indentation =A0 =A0 =A0 =A0 =A0 =A0 =A0 6. if `indent-tabs-mode= ':
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A08 or more SPACEs at beginning of line
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0else: TABS at beginning of line.

OK.
= =A0
> - =A0 =A0 (when (if report-if-bogus has-bogus t)
> + =A0 =A0 (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. =A0 IOW

=A0 =A0 =A0 =A0 (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-b= ogus))

Fine, revised patch to follow. <= br>

--
http://rrt.sc3d.o= rg
--001a11395aaa51d95604f0fd2eb2--