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#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore Date: Thu, 22 Dec 2016 12:53:37 +0000 Message-ID: References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> <878tr9c4bn.fsf@users.sourceforge.net> <8760mcbta2.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c05a8300c981005443ec277 X-Trace: blaine.gmane.org 1482411266 10679 195.159.176.226 (22 Dec 2016 12:54:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 22 Dec 2016 12:54:26 +0000 (UTC) Cc: Mark Karpov , 25157@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 22 13:54:22 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 1cK2sx-00017n-NZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Dec 2016 13:54:16 +0100 Original-Received: from localhost ([::1]:33769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cK2sx-0004rU-Av for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Dec 2016 07:54:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cK2sp-0004qe-4m for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2016 07:54:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cK2sk-00022c-94 for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2016 07:54:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35581) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cK2sj-00022L-Ui for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2016 07:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cK2sj-0001Vt-IG for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2016 07:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Reuben Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2016 12:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25157 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 25157-submit@debbugs.gnu.org id=B25157.14824112255791 (code B ref 25157); Thu, 22 Dec 2016 12:54:01 +0000 Original-Received: (at 25157) by debbugs.gnu.org; 22 Dec 2016 12:53:45 +0000 Original-Received: from localhost ([127.0.0.1]:50980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cK2sT-0001VL-2G for submit@debbugs.gnu.org; Thu, 22 Dec 2016 07:53:45 -0500 Original-Received: from mail-qk0-f173.google.com ([209.85.220.173]:36407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cK2sR-0001V7-NQ for 25157@debbugs.gnu.org; Thu, 22 Dec 2016 07:53:44 -0500 Original-Received: by mail-qk0-f173.google.com with SMTP id n21so107290857qka.3 for <25157@debbugs.gnu.org>; Thu, 22 Dec 2016 04:53:43 -0800 (PST) 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=LbEJEDBBhVEJwvLTTAmFHBzGTprKGMHj+7TeoULL7Sc=; b=nLKXzNtZhUDx0/IdWJapzL2lh62SxVXa75x3rBcQ7qFi+c0Hiihm7EB8Vcfjs3uOpk w4eZZm/CtoqWH7B4eOic78fk/VwTNU7pSrjBEfcWKms73fi+Fi0uGhZzC7F5Q6tM0lYg zUbtpYH1HfJ95vbAXFJolHMBko0duFCEDcIfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LbEJEDBBhVEJwvLTTAmFHBzGTprKGMHj+7TeoULL7Sc=; b=TWFc2ROSQ1Iqh3eDjGLfX6fsb/g8Te0BLTw/cyiyOBWE//XwBfP20zodrLiSKXCQr+ CHMznYeMxiIvDcoIrHPI8KIAS9LUZUrkf8MvYoC3oESay/B2HrzkTafxu9WdzLDZc7WM I4RblF2+HX6Ci2O7DfwFrtFBiAKKBDtGJgrcj9XBFQZEuEaX7nmXarL9+VriE66ZcIG2 NZmJsYGVSnT+mR7jObGdb4ffeKU827AgRalaWPdgsGWs017RMwxLqu7MOO9oOJ6Uoq8s LcDHrAiyn9mROgLXkXxsKpNsl9SBqvE3P8W1/qvLb4EDREXulFQrvbtPLpT5bHDV/OQV DtHg== X-Gm-Message-State: AIkVDXJ/9teT9n7bapm9d3onNER9rrJ3jppnINKWByytDGEmVslHY6k/rZf5OpAiCh+LLCFn0OLEVsq5r3mbRnhv X-Received: by 10.55.113.69 with SMTP id m66mr9565529qkc.186.1482411217814; Thu, 22 Dec 2016 04:53:37 -0800 (PST) Original-Received: by 10.140.88.51 with HTTP; Thu, 22 Dec 2016 04:53:37 -0800 (PST) Original-Received: by 10.140.88.51 with HTTP; Thu, 22 Dec 2016 04:53:37 -0800 (PST) In-Reply-To: <8760mcbta2.fsf@users.sourceforge.net> 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:127322 Archived-At: --94eb2c05a8300c981005443ec277 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Dec 22, 2016 2:17 AM, wrote: > > Reuben Thomas writes: > > >(I was trying to make it match ALL the whitespace at the end of the > >buffer, as you probably realised.) > > Oh, I thought that might have been the case. It explains why you were > going through all that trouble with the regexp. > > > > > The only thing I'd change in your match is, as in mine, remove the FIXME after save-match-data.=E2=80=8B > > (whitespace-cleanup): Remove a FIXME: the reason for save-match-data > is the call of re-search-forward. > > I'm not sure this is a sufficient explanation of why save-match-data is > needed. Usually in Emacs the caller is responsible for saving the match > data, if it needs to. I don't really see the need here. Can it be removed then? The only perhaps unexpected thing I can think of is that whitespace-cleanup can be called from a hook, such as save-file-hook, but that doesn't seem to matter. --94eb2c05a8300c981005443ec277 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Dec 22, 2016 2:17 AM, <npostavs@users.sourceforge.net> wrote:
>
> Reuben Thomas <rrt@sc3d.org>= writes:
>
> >(I was trying to make it match ALL the whitespace at the end of th= e
> >buffer, as you probably realised.)
>
> Oh, I thought that might have been the case.=C2=A0 It explains why you= were
> going through all that trouble with the regexp.
>
> >
> > The only thing I'd change in your match is, as in mine, remov= e the FIXME after save-match-data.=E2=80=8B
>
> =C2=A0 =C2=A0 (whitespace-cleanup): Remove a FIXME: the reason for sav= e-match-data
> =C2=A0 =C2=A0 is the call of re-search-forward.
>
> I'm not sure this is a sufficient explanation of why save-match-da= ta is
> needed.=C2=A0 Usually in Emacs the caller is responsible for saving th= e match
> data, if it needs to.=C2=A0 I don't really see the need here.

Can it be removed then? The only perhaps unexpected thing I = can think of is that whitespace-cleanup can be called from a hook, such as = save-file-hook, but that doesn't seem to matter.

--94eb2c05a8300c981005443ec277--