From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Reuben Thomas Newsgroups: gmane.emacs.bugs Subject: bug#24745: 25.1.50; whitespace.el: fix beginning/end of buffer checks Date: Fri, 21 Oct 2016 15:42:58 +0100 Message-ID: References: <87pomv6w1h.fsf@sc3d.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114b0128fac7a6053f610ed4 X-Trace: blaine.gmane.org 1477061651 5854 195.159.176.226 (21 Oct 2016 14:54:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Oct 2016 14:54:11 +0000 (UTC) Cc: 24745@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 21 16:54:02 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxbCZ-0007IN-Ry for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Oct 2016 16:53:44 +0200 Original-Received: from localhost ([::1]:32871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxbCc-0003Zn-1Z for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Oct 2016 10:53:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxb3F-0005ZD-EC for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2016 10:44:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxb3C-0001NS-AI for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2016 10:44:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bxb3C-0001NO-39 for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2016 10:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bxb3B-0005UY-O4 for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2016 10:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Reuben Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Oct 2016 14:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24745 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24745-submit@debbugs.gnu.org id=B24745.147706098721032 (code B ref 24745); Fri, 21 Oct 2016 14:44:01 +0000 Original-Received: (at 24745) by debbugs.gnu.org; 21 Oct 2016 14:43:07 +0000 Original-Received: from localhost ([127.0.0.1]:44983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxb2I-0005TA-Tv for submit@debbugs.gnu.org; Fri, 21 Oct 2016 10:43:07 -0400 Original-Received: from mail-lf0-f45.google.com ([209.85.215.45]:33052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxb2H-0005Sh-0v for 24745@debbugs.gnu.org; Fri, 21 Oct 2016 10:43:05 -0400 Original-Received: by mail-lf0-f45.google.com with SMTP id x79so155146703lff.0 for <24745@debbugs.gnu.org>; Fri, 21 Oct 2016 07:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wbWIg0IWIRkU6WioSIm5+7OIibOqFB/2MsNzUpe7mPQ=; b=1y2IvmVrIB3ekg/LCF8Sb5e4HLv3GP5Wjn1jD4PMFJ83aK8cKQXNia4bOFiUGxFIiV SSoe8jqoKCZzka4h1LcHOR/AyDUQRRacn5kTLbi7eR0MogJSmsd4/lhffwu4hmOAbiJY LiutClQWBpuU0AZFeUmgdO6d7cFesN8TqcyIY= 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:from:date :message-id:subject:to:cc; bh=wbWIg0IWIRkU6WioSIm5+7OIibOqFB/2MsNzUpe7mPQ=; b=C8Q8IKIqwi9MmlwJCz99RzsdGscZsoAinGmBJN3cXhN4MsGVjj/qtiqgGwuNJ37sf/ by+MGdyns6peV7rZ/m6PWJZ2YmarD01ugDjqjP5l40RLWtQz9xNAYjfO288lQATxCutS +vZ/WqAP0jSDgTX1/3fFna6WVi+siAcn5gmLf0Gl+8pX4rXhxXdm17hiQl4R9nj3eQs7 a7H7tRuoHRVpHdUaKBZ5vbPX2tuESrxxzYvPhrT2FnzOC6YiVKB54Q8zoR3nZDCtzDyY t7fBq0ekjriG1q83f3CJu1OMPUFscrD25jFmoexF4TaY7rUpai9e31PqWCbXL/dF5T5c K1DA== X-Gm-Message-State: ABUngvf+SZLN8erUyBltNMFXeh7IpVVCoRMq73PXKM6RCXySrE6Kpjb1ER4xpX7S9WC3OK/pDIFRZgurqDOwOMMd X-Received: by 10.25.125.193 with SMTP id y184mr797028lfc.51.1477060979243; Fri, 21 Oct 2016 07:42:59 -0700 (PDT) Original-Received: by 10.25.158.206 with HTTP; Fri, 21 Oct 2016 07:42:58 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:124775 Archived-At: --001a114b0128fac7a6053f610ed4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable [Apologies for not responding earlier; I had to dig this out of my spam trap.] On 20 October 2016 at 23:43, Dmitry Gutov wrote: > On 20.10.2016 15:32, Reuben Thomas wrote: > >> whitespace-report-region currently (Emacs 25.1, and identically in >> master) fails correctly to detect whitespace at the start and end of the >> buffer. >> > > Could you please describe the problematic behavior exactly? > =E2=80=8BThe problem is that whitespace-report-region does not apply the te= sts whitespace-empty-at-{bob,eob}-regexp specifically to the start and end of the buffer. Since the tests were (intentionally) not previously anchored to the start/end of the buffer, this meant they could pass at other, arbitrary, places in the buffer, and incorrect report that there were blank lines at the start/end of the buffer when there weren't. The new tests are specifically anchored, and I made a minor change elsewhere to avoid appending a now-unnecessary anchor. --=20 http://rrt.sc3d.org --001a114b0128fac7a6053f610ed4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
[Ap= ologies for not responding earlier; I had to dig this out of my spam trap.]=

On 20 October 2016 at 23= :43, Dmitry Gutov <dgutov@yandex.ru> wrote:
whitespace-report-region currently (Emacs 25.1, and identically in
master) fails correctly to detect whitespace at the start and end of the buffer.

Could you please describe the problematic behavior exactly?

=E2=80=8BThe problem is that whitespace-report-region does not apply the t= ests whitespace-empty-at-{bob,eob}-regexp specifically to the start and end= of the buffer. Since the tests were (intentionally) not previously anchore= d to the start/end of the buffer, this meant they could pass at other, arbi= trary, places in the buffer, and incorrect report that there were blank lin= es at the start/end of the buffer when there weren't.

The new tests are specifically ancho= red, and I made a minor change elsewhere to avoid appending a now-unnecessa= ry anchor.

--
--001a114b0128fac7a6053f610ed4--