From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 10 09:42:17 2016 Received: (at submit) by debbugs.gnu.org; 10 Dec 2016 14:42:17 +0000 Received: from localhost ([127.0.0.1]:36679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFiqv-0006Xx-0H for submit@debbugs.gnu.org; Sat, 10 Dec 2016 09:42:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFiqs-0006Xg-Ct for submit@debbugs.gnu.org; Sat, 10 Dec 2016 09:42:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFiqm-0007cq-14 for submit@debbugs.gnu.org; Sat, 10 Dec 2016 09:42:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59140) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cFiql-0007cm-U4 for submit@debbugs.gnu.org; Sat, 10 Dec 2016 09:42:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFiqk-00016R-7o for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:42:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFiqf-0007Xx-P2 for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:42:06 -0500 Received: from mail2.openmailbox.org ([62.4.1.33]:60612) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFiqf-0007XH-Ay for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:42:01 -0500 Received: by mail2.openmailbox.org (Postfix, from userid 1001) id 114B7105A3E; Sat, 10 Dec 2016 15:41:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1481380919; bh=KhSFbTIs4yRqc2yJi9QOlqMnxA6Tn0+r7vfUQ01NU5c=; h=From:To:Subject:Date:From; b=DmjDX1zA/1r54Nhzgr9jAu7QoS8Z84NK+4qfK8ID8ffQCIZszp3KAs0CArP6HD1+6 BnGkcLmbXXacDJaOBkrZJK64Vb3J1VLRkADyQDoUxAC8LaKXDWZewSMFtZ6cBN0bVP FTeuNw0GYkW4rB8tMyfl3T2frp2b0uHcEPuQzCX4= From: Mark Karpov DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1481380914; bh=KhSFbTIs4yRqc2yJi9QOlqMnxA6Tn0+r7vfUQ01NU5c=; h=From:To:Subject:Date:From; b=zb9N/39/bh2NfDI+pq2mJmS2L4zlToBaB6WVJUTfuGyhwcYwu7IBYd/4G3/CLRy2d NKo1isxkWRA2rKyeCiAvRwG/sTI2s6SRVZ8h3E3G8t1bAwIGrOjrptCbRenpfKo23V k9YMz91XApXffjGSNndAyOGCZ4vXaY3BMrMid7gE= To: bug-gnu-emacs@gnu.org Subject: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore Date: Sat, 10 Dec 2016 17:41:52 +0300 Message-ID: <8760mr26dr.fsf@openmailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) The =E2=80=98whitespace-cleanup=E2=80=99 command does not remove single tra= iling empty line anymore. To reproduce start emacs with -Q flag, open any file and a single empty training line, like this: --- start of file foo --- end of file Then call =E2=80=98whitespace-cleanup=E2=80=99. Expected result: --- start of file foo --- end of file Actual result (nothing happens): --- start of file foo --- end of file This bug does not manifest itself if there are more than one empty line, i.e.: --- start of file foo --- end of file (Executing =E2=80=98whitespace-cleanup=E2=80=99): --- start of file foo --- end of file The result is as expected. In GNU Emacs 26.0.50.5 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.4) of 2016-12-10 built on arch Repository revision: fc0fd24c105bde4c001ebebe4b8b7e1f96cd2871 Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 Recent messages: Indentation setup for shell type bash next-line: End of buffer [5 times] Saving file /home/mark/.bash_profile... Wrote /home/mark/.bash_profile Saving file /home/mark/.bash_profile... Wrote /home/mark/.bash_profile Quit nil Saving file /home/mark/.bash_profile... Wrote /home/mark/.bash_profile Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 LIBSYSTEMD Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: i=CE=BB Minor modes in effect: shell-dirtrack-mode: t diff-auto-refine-mode: t aggressive-indent-mode: t rainbow-delimiters-mode: t whitespace-mode: t flycheck-color-mode-line-mode: t yas-global-mode: t yas-minor-mode: t vimish-fold-global-mode: t vimish-fold-mode: t show-paren-mode: t rich-minority-mode: t minibuffer-electric-default-mode: t ivy-mode: t global-auto-revert-mode: t display-time-mode: t delete-selection-mode: t cyphejor-mode: t ace-popup-menu-mode: t smartparens-global-mode: t smartparens-mode: t flyspell-mode: t flyspell-lazy-mode: t mk-highlight-line-mode: t modalka-mode: t hl-todo-mode: t flycheck-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t auto-fill-function: do-auto-fill transient-mark-mode: t auto-fill-mode: 1 Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug counsel esh-util swiper sh-script smie executable colir haskell-doc inf-haskell haskell-decl-scan imenu shell pcomplete haskell haskell-completions haskell-load haskell-commands highlight-uses-mode haskell-modules haskell-sandbox haskell-repl haskell-debug haskell-interactive-mode haskell-presentation-mode haskell-collapse haskell-navigate-imports haskell-compile haskell-process haskell-session url-util haskell-hoogle smartparens-haskell haskell-mode haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-compat haskell-complete-module haskell-ghc-support noutline outline flymake etags compile dabbrev haskell-customize vc-git diff-mode bookmark pp aggressive-indent easy-mmode rainbow-delimiters whitespace flycheck-haskell haskell-cabal haskell-utils flycheck-color-mode-line face-remap mk-visual smart-mode-line solarized-dark-theme solarized color mk-texinfo mk-tex mk-shakespeare mk-prolog mk-org mk-mustache mk-mu4e mk-markdown mk-man mk-magit mk-lisp mk-js mk-ibuffer mk-html mk-eshell mk-erc mk-elisp mk-dired mk-clojure kill-or-bury-alive mk-calendar mk-c mk-minor-modes common-lisp-snippets yasnippet whole-line-or-region vimish-fold paren rich-minority minibuf-eldef ivy ivy-overlay ffap autorevert filenotify time delsel cyphejor ace-popup-menu smartparens-config smartparens flyspell ispell flyspell-lazy mk-highlight-line mk-global modalka edmacro kmacro fix-input quail ace-link hl-todo xref project mu4e mu4e-speedbar speedbar sb-image ezimage dframe mu4e-main mu4e-context mu4e-view cal-menu calendar cal-loaddefs thingatpt browse-url comint ansi-color mu4e-headers mu4e-compose mu4e-draft mu4e-actions ido rfc2368 smtpmail sendmail mu4e-mark mu4e-message html2text mu4e-proc mu4e-utils doc-view jka-compr image-mode mu4e-lists mu4e-vars message puny dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader hl-line cl mu4e-meta mk-python mk-haskell mk-utils avy-menu avy ring flycheck json map find-func rx subr-x misc server f dash s ucs-normalize finder-inf tex-site fix-word advice slime-autoloads info package epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 470216 19037) (symbols 48 40810 0) (miscs 40 87 365) (strings 32 91124 7084) (string-bytes 1 2627337) (vectors 16 70269) (vector-slots 8 1777314 201698) (floats 8 654 304) (intervals 56 368 0) (buffers 976 16)) From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 23:35:20 2016 Received: (at 25157) by debbugs.gnu.org; 20 Dec 2016 04:35:20 +0000 Received: from localhost ([127.0.0.1]:48198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJC92-00078f-94 for submit@debbugs.gnu.org; Mon, 19 Dec 2016 23:35:20 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:36654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJC90-00078I-IZ; Mon, 19 Dec 2016 23:35:19 -0500 Received: by mail-it0-f67.google.com with SMTP id n68so12677207itn.3; Mon, 19 Dec 2016 20:35:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=4lCquDcwmZqmRS0Mz1GTvMdx+EggGKG6vZ+KAIdVXmo=; b=Ig+xo6l44MxW1r71X2K85YXCel218W9MswSImV0gokK1pX2tjgTLLoG9t+c2xeFucz 0PEaVsn+6aU2cP7usgq8BoNqDikVpdfpKeazcByQZmFm+LfFLLSv6NT68tLqXPgBs1Fk qjGocfwy1tg0+HhkgSZOeU+W7d2B3TyQOar9dJRjdpyCMEktP2Ehh1b9LvXm0kSV/ZJR gtgVgaZ+ou1V7xIUuUXG3UgBLDI706nroJRjVkOuOrosqkXUmFN3IbW2PTWbBMp7lMXs 1MuiaUbmHyGP7hfI2Zyom9PUy89x4Q6LBU5UIrGi12NBz+m3kpAPhjvGp9NOFRzQBE70 gTbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=4lCquDcwmZqmRS0Mz1GTvMdx+EggGKG6vZ+KAIdVXmo=; b=Ds5Hz2L7IBzgHr2heWNHXbvvCJxntzElR0Mvgf8+DGSMwPGv+H7OKi7N57h5bzTBJf kkpD3BdYa+98qQSECOVOjQhcPhAFX5TA/4RQ8UvIwFil6cKmzDi1rLtodjGcX2juRO/7 FJlmHGLdKX4sLKUiLFmT84iu/6xAy2QzZlna74q7RCdiO2fg6zCt8tAZ8P0wRcSV5SV/ 4j1fB67cDFix/u7FrvXCl+860bLnJzYll3cZ22IfkEe4z94QOlx2+VNNwLAvPaDQ8LUl V/FGwdc1Irbhyt894ccfn3KkxnCU2JXmLJhhLokpglMfpKVBQ7JOZ8bjRkIWWevuupOM OMiA== X-Gm-Message-State: AIkVDXL2P/LdmlXNI2UBlGPwJ4ID1gMNQmlVhU2km6oQPU/Z2yDpqn4//Kb59yVL4KZNgg== X-Received: by 10.36.28.204 with SMTP id c195mr51267itc.81.1482208513103; Mon, 19 Dec 2016 20:35:13 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id p20sm8917544itc.2.2016.12.19.20.35.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Dec 2016 20:35:12 -0800 (PST) From: npostavs@users.sourceforge.net To: Mark Karpov Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore References: <8760mr26dr.fsf@openmailbox.org> Date: Mon, 19 Dec 2016 23:36:15 -0500 In-Reply-To: <8760mr26dr.fsf@openmailbox.org> (Mark Karpov's message of "Sat, 10 Dec 2016 17:41:52 +0300") Message-ID: <87eg13b4jk.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25157 Cc: Reuben Thomas , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) tags 25157 confirmed quit Mark Karpov writes: > The =E2=80=98whitespace-cleanup=E2=80=99 command does not remove single t= railing empty > line anymore. This seems to have been caused by the fix for #24745. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D24745#5 has =20 -(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)" +(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)\\'" which is what I would expect, but https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D24745#11 says First, I revised my previous patch, which had an error in the new version of whitespace-empty-at-eob-regexp. and has -(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)" +(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]*\\(\n\\{2,\\}\\|[ \= t]+\\)\\)\\'" I don't quite understand why this more complicated expression is necessary. Reuben, can you explain? From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 13:37:38 2016 Received: (at 25157) by debbugs.gnu.org; 20 Dec 2016 18:37:38 +0000 Received: from localhost ([127.0.0.1]:49266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJPIA-0000mJ-4Z for submit@debbugs.gnu.org; Tue, 20 Dec 2016 13:37:38 -0500 Received: from mail-qk0-f174.google.com ([209.85.220.174]:33609) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJPI7-0000m3-C2 for 25157@debbugs.gnu.org; Tue, 20 Dec 2016 13:37:36 -0500 Received: by mail-qk0-f174.google.com with SMTP id t184so57329788qkd.0 for <25157@debbugs.gnu.org>; Tue, 20 Dec 2016 10:37:35 -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=g3S0YHGv6JIWWtJT2zBzg2st/ogH3HRM2iFQTEiSQIw=; b=EXsEWvh39MUoNpe8cOv9Pa71gsdt8Z+tl2KOs5br1Nr4jSsDUwGLrGcHHRU+ZCjAzG WFwz3W22uJJZLB4kSre/sRG9mf9v30aYdHJkMOen5JBAd8j2Dh7LaefGpZ8GB+2/YFjN fRgCqQuupYL/PunCWQbAngD7Tdp/9PJSn9kWs= 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=g3S0YHGv6JIWWtJT2zBzg2st/ogH3HRM2iFQTEiSQIw=; b=unh5tg0/AA75zS9HkXNvY+K56S0RTq8y9CZoa6+p2ocFivpPVNgXgCvxeBpsDAOxcV 3b9L0K3d+abqRahgXC9OtpYfXsGqUtA4xg9gAa7hbx/djRRKvRm+3/glVKcw9gVlMw2J fn6vQYoJh3doI23eNujaFWqHxulykqWPEyWtABwInd0oFas+OgDxKD15hMZV1Ddn9rcl uQGdGCp6JCpl0IW81XXOvHI3/jQIA/MU54bIN+DAfgTxiXzjGQtdJ/Z98Ry1vDmqIY4+ ULGf7ciqGswDAYzLGIZLOmIV8aNGA00WlZLtpPpH39Pfk3h+bZoD1osY3j8Y9xeGOVQB UZiQ== X-Gm-Message-State: AIkVDXINijBXPboV+6UjFNWpJsmVw/WwFYquc6MvWNW0ciDDPd+Y7rZ7dkXF3dQTqu3UkfMd3uqMDia4WAXju46V X-Received: by 10.55.135.69 with SMTP id j66mr822888qkd.31.1482259049718; Tue, 20 Dec 2016 10:37:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.88.51 with HTTP; Tue, 20 Dec 2016 10:37:29 -0800 (PST) In-Reply-To: <87eg13b4jk.fsf@users.sourceforge.net> References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> From: Reuben Thomas Date: Tue, 20 Dec 2016 18:37:29 +0000 Message-ID: Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore To: Noam Postavsky Content-Type: multipart/alternative; boundary=94eb2c075f461fbf3b05441b547d X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --94eb2c075f461fbf3b05441b547d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 20 December 2016 at 04:36, wrote: > tags 25157 confirmed > quit > > Mark Karpov writes: > > > The =E2=80=98whitespace-cleanup=E2=80=99 command does not remove single= trailing empty > > line anymore. > =E2=80=8B=E2=80=8BI can reproduce this; sorry! > -(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)" > +(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]*\\(\n\\{2,\\}\\|[ > \t]+\\)\\)\\'" > > I don't quite understand why this more complicated expression is > necessary. Reuben, can you explain? > =E2=80=8BWith the previous regexp, whitespace-cleanup would remove a single= newline at the end of a buffer. I think I tried to be a bit too clever. Thinking again, what we require is: Match at the end of the buffer, either: a. A mix of spaces and tabs, or b. Optional whitespace followed by a newline followed by whitespace. These two categories are not mutually exclusive (which is fine, and avoids being too clever). The point is that if there are any newlines, there must be at least two. Also note that the regexp does not need to be anchored at the start of a line (I'm not sure why I thought it did). So, I think a correct regexp, directly translating the above, is: \\([ \t]+\\|\\([ \t\n]*\n[ \t\n]+\\)\\)\\' However, there's still a problem: while this regexp will not match a single newline at the end of a buffer, when it does match any number of newlines (with or without extra space), it will remove all of them, whereas it should leave a single newline. I can't see a way around this purely in the regexp, because if for example the end of the buffer is: \t\n\t then the regexp should match (and this one does), but whitespace-cleanup should leave a newline. So I think a further change to the code is needed to whitespace-cleanup: when whitespace-empty-at-eob-regexp is matched, it should check match-string, and if it contains a newline, it should insert a newline in the buffer after deleting the matched string. Given my previous error of reasoning, I'm submitting the above for your consideration before I prepare a patch! --=20 http://rrt.sc3d.org --94eb2c075f461fbf3b05441b547d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On = 20 December 2016 at 04:36, <npostavs@users.sourceforge.= net> wrote:
tags 25157 confirmed
quit

Mark Karpov <markkarpov@openmailbox.org> writes:

> The =E2=80=98whitespace-cleanup=E2=80=99 command does not remove singl= e trailing empty
> line anymore.

=E2=80=8B=E2=80=8BI can reproduce this; = sorry!
=C2=A0
-(defcus= tom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)"
+(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]*\\(\n\\{2,\\}\= \|[ \t]+\\)\\)\\'"

I don't quite understand why this more complicated expression is
necessary.=C2=A0 Reuben, can you explain?

=E2=80=8BWith the previous regexp, whitespace-cleanup would remove a sin= gle newline at the end of a buffer.

I think I tried to be a bit too clever.

Thinking again, what we require is:

Match at the end of the buffer, either= :

a. A mix of spaces and = tabs, or

b. Optional whit= espace followed by a newline followed by whitespace.

These two categories are not mutually exclusive= (which is fine, and avoids being too clever).

The point is that if there are any newlines, there mu= st be at least two.

Also = note that the regexp does not need to be anchored at the start of a line (I= 'm not sure why I thought it did).

So, I think a correct regexp, directly translating the above,= is: \\([ \t]+\\|\\([ \t\n]*\n[ \t\n]+\\)\\)\\'

However, there's still a problem: while this= regexp will not match a single newline at the end of a buffer, when it doe= s match any number of newlines (with or without extra space), it will remov= e all of them, whereas it should leave a single newline.

I can't see a way around this purely in= the regexp, because if for example the end of the buffer is:

\t\n\t

then the regexp should match (and this one does), but = whitespace-cleanup should leave a newline.

So I think a further change to the code is needed to whit= espace-cleanup: when whitespace-empty-at-eob-regexp is matched, it should c= heck match-string, and if it contains a newline, it should insert a newline= in the buffer after deleting the matched string.

Given my previous error of reasoning, I'm subm= itting the above for your consideration before I prepare a patch!

--
--94eb2c075f461fbf3b05441b547d-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 19:51:11 2016 Received: (at 25157) by debbugs.gnu.org; 21 Dec 2016 00:51:11 +0000 Received: from localhost ([127.0.0.1]:49474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJV7f-0004sG-BF for submit@debbugs.gnu.org; Tue, 20 Dec 2016 19:51:11 -0500 Received: from mail-qk0-f169.google.com ([209.85.220.169]:33361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJV7e-0004s4-D9 for 25157@debbugs.gnu.org; Tue, 20 Dec 2016 19:51:10 -0500 Received: by mail-qk0-f169.google.com with SMTP id t184so66323647qkd.0 for <25157@debbugs.gnu.org>; Tue, 20 Dec 2016 16:51:10 -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=gi8ZYLFEyvc4lsqOuaT0VBOKTKiEAoKKEaHVI4TQ0SU=; b=JPitZfOrpOYlH9SL1sddGrgm5VGOGy1frr+A/LYCmlxb7AhlEZXDQUITIw3QmZ6oAj DyDDkJoXL0Mnb2jDb6K+3IMhvvV1Za70FdU0ZGfc0g8hwlWncUVRoQFFaNz2/irWatWg lDOBM2QV5iVzNrUUOL3Bd5J2/GTEyJ/Om1TMU= 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=gi8ZYLFEyvc4lsqOuaT0VBOKTKiEAoKKEaHVI4TQ0SU=; b=T/Gb/3LKaEw2uXILoTlmqakh/rdC3Pan1RnCQaZgkqQ6R7SORHb4TuCU/Y17lWVEZs iyPjNDdeoeqZvcFVC9xrRyy6T1mSkk2wtabdMY1W/Wn300T7ttvpTfSAfgQzapJD2crs 5CNp55h/XXBgrFqWKFA3txREVAki+gxCojF957iAjzxnaSH70lHMsZ4ewQfrbv5+E1w1 f9zsTz/j2+VtNfZhnTsROmHTcibkUXM8esSpgzCyG/fJKpcnmO2XdamcbvZde2p5oI65 UMI1wIWvzIugFBwIZtIiJoTtcZwmyKojhekB0igC1G93qn/vXrHl7U/F58T4XUHvVlI4 G1oA== X-Gm-Message-State: AIkVDXLBLuyDQMGFhMMT04JmnnKSmx8lCeTWf1u3ajn7JCiNiyML92DV88H4Su+9Uf8jK8kVySOcLNS7uvvkW0DC X-Received: by 10.55.165.141 with SMTP id o135mr2280257qke.119.1482281464849; Tue, 20 Dec 2016 16:51:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.88.51 with HTTP; Tue, 20 Dec 2016 16:51:04 -0800 (PST) In-Reply-To: References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> From: Reuben Thomas Date: Wed, 21 Dec 2016 00:51:04 +0000 Message-ID: Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore To: Noam Postavsky Content-Type: multipart/mixed; boundary=94eb2c062bd22b9dd00544208c11 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --94eb2c062bd22b9dd00544208c11 Content-Type: multipart/alternative; boundary=94eb2c062bd22b9dcc0544208c0f --94eb2c062bd22b9dcc0544208c0f Content-Type: text/plain; charset=UTF-8 I attach a patch for consideration, along the lines I previously proposed. It seems to work: at least, it deletes a single trailing extra newline, while still leaving a newline at the end of the buffer, and doesn't delete a single newline at the end of the buffer. --94eb2c062bd22b9dcc0544208c0f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I a= ttach a patch for consideration, along the lines I previously proposed. It = seems to work: at least, it deletes a single trailing extra newline, while = still leaving a newline at the end of the buffer, and doesn't delete a = single newline at the end of the buffer.
--94eb2c062bd22b9dcc0544208c0f-- --94eb2c062bd22b9dd00544208c11 Content-Type: text/x-patch; charset=UTF-8; name="0007-Fix-whitespace-cleanup-to-remove-single-trailing-new.patch" Content-Disposition: attachment; filename="0007-Fix-whitespace-cleanup-to-remove-single-trailing-new.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iwy7xd1l0 RnJvbSBmYjM5NmU3YTczMmYzNzc3NDdiMDEzZjdlNTg5MTMzYWNiMTIyNThmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBSZXViZW4gVGhvbWFzIDxycnRAc2MzZC5vcmc+CkRhdGU6IFdl ZCwgMjEgRGVjIDIwMTYgMDA6NDA6MTEgKzAwMDAKU3ViamVjdDogW1BBVENIIDcvN10gRml4IHdo aXRlc3BhY2UtY2xlYW51cCB0byByZW1vdmUgc2luZ2xlIHRyYWlsaW5nIG5ld2xpbmUKIChCdWcj MjUxNTcpCk1JTUUtVmVyc2lvbjogMS4wCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNl dD1VVEYtOApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA4Yml0CgoqIGxpc3Avd2hpdGVzcGFj ZS5lbCAod2hpdGVzcGFjZS1lbXB0eS1hdC1lb2ItcmVnZXhwKTogU2ltcGxpZnkgYW5kCmNvcnJl Y3QgdGhlIHJlZ2V4cCwgd2hpY2ggSSBicm9rZSB3aGVuIHRyeWluZyB0byBmaXggQnVnIzI0NzQ1 Lgood2hpdGVzcGFjZS1jbGVhbnVwKTogUmVtb3ZlIGEgRklYTUU6IHRoZSByZWFzb24gZm9yIHNh dmUtbWF0Y2gtZGF0YQppcyB0aGUgY2FsbCBvZiByZS1zZWFyY2gtZm9yd2FyZC4gIERldGVjdCBp ZiB3ZSBkZWxldGUgYXQgbGVhc3Qgb25lCm5ld2xpbmUgYXQgdGhlIGVuZCBvZiB0aGUgYnVmZmVy LCBhbmQgaWYgc28sIGFkZCBvbmUgYmFjay4gVGhpcyBpcwpuZWNlc3NhcnkgYmVjYXVzZSB0aGVy ZeKAmXMgbm8gd2F5IHRvIGNvbnN0cnVjdCB0aGUgdGhlIGVvYi1yZWdleHAgc28KdGhhdCBpdCBh bHdheXMgbGVhdmVzIGEgc2luZ2xlIG5ld2xpbmUgYXQgdGhlIGVuZCBvZiB0aGUgYnVmZmVyIGlm IGF0CmxlYXN0IG9uZSBuZXdsaW5lIHdhcyBwcmVzZW50IGFmdGVyIHRoZSBsYXN0IG5vbi13aGl0 ZXNwYWNlIGNoYXJhY3Rlci4KLS0tCiBsaXNwL3doaXRlc3BhY2UuZWwgfCA5ICsrKysrKy0tLQog MSBmaWxlIGNoYW5nZWQsIDYgaW5zZXJ0aW9ucygrKSwgMyBkZWxldGlvbnMoLSkKCmRpZmYgLS1n aXQgYS9saXNwL3doaXRlc3BhY2UuZWwgYi9saXNwL3doaXRlc3BhY2UuZWwKaW5kZXggMjlkNjBj OS4uMDA5NTExZiAxMDA2NDQKLS0tIGEvbGlzcC93aGl0ZXNwYWNlLmVsCisrKyBiL2xpc3Avd2hp dGVzcGFjZS5lbApAQCAtNzI5LDcgKzcyOSw3IEBAIHdoaXRlc3BhY2UtZW1wdHktYXQtYm9iLXJl Z2V4cAogICA6Z3JvdXAgJ3doaXRlc3BhY2UpCiAKIAotKGRlZmN1c3RvbSB3aGl0ZXNwYWNlLWVt cHR5LWF0LWVvYi1yZWdleHAgIl5cXChbIFx0XG5dKlxcKFxuXFx7MixcXH1cXHxbIFx0XStcXClc XClcXCciCisoZGVmY3VzdG9tIHdoaXRlc3BhY2UtZW1wdHktYXQtZW9iLXJlZ2V4cCAiXFwoWyBc dF0rXFx8XFwoWyBcdFxuXSpcblsgXHRcbl0rXFwpXFwpXFwnIgogICAiU3BlY2lmeSByZWdleHAg Zm9yIGVtcHR5IGxpbmVzIGF0IGVuZCBvZiBidWZmZXIuCiAKIFVzZWQgd2hlbiBgd2hpdGVzcGFj ZS1zdHlsZScgaW5jbHVkZXMgYGVtcHR5Jy4iCkBAIC0xMzk4LDcgKzEzOTgsNyBAQCB3aGl0ZXNw YWNlLWNsZWFudXAKICAgIDs7IHdob2xlIGJ1ZmZlcgogICAgKHQKICAgICAoc2F2ZS1leGN1cnNp b24KLSAgICAgIChzYXZlLW1hdGNoLWRhdGEgICAgICAgICAgICAgICAgO0ZJWE1FOiBXaHk/Cisg ICAgICAoc2F2ZS1tYXRjaC1kYXRhCiAJOzsgUFJPQkxFTSAxOiBlbXB0eSBsaW5lcyBhdCBib2IK IAk7OyBQUk9CTEVNIDI6IGVtcHR5IGxpbmVzIGF0IGVvYgogCTs7IEFDVElPTjogcmVtb3ZlIGFs bCBlbXB0eSBsaW5lcyBhdCBib2IgYW5kL29yIGVvYgpAQCAtMTQwOCw3ICsxNDA4LDEwIEBAIHdo aXRlc3BhY2UtY2xlYW51cAogCSAgICAod2hlbiAobG9va2luZy1hdCB3aGl0ZXNwYWNlLWVtcHR5 LWF0LWJvYi1yZWdleHApCiAJICAgICAgKGRlbGV0ZS1yZWdpb24gKG1hdGNoLWJlZ2lubmluZyAx KSAobWF0Y2gtZW5kIDEpKSkKIAkgICAgKHdoZW4gKHJlLXNlYXJjaC1mb3J3YXJkCi0gICAgICAg ICAgICAgICAgICAgd2hpdGVzcGFjZS1lbXB0eS1hdC1lb2ItcmVnZXhwIG5pbCB0KQorCQkgICB3 aGl0ZXNwYWNlLWVtcHR5LWF0LWVvYi1yZWdleHAgbmlsIHQpCisJICAgICAgOzsgSWYgd2UgZGVs ZXRlZCBhIHRyYWlsaW5nIG5ld2xpbmUsIHJlaW5zZXJ0IGl0CisJICAgICAgKGlmIChzdHJpbmct bWF0Y2gtcCAiXG4iIChtYXRjaC1zdHJpbmcgMCkpCisJCSAgKGluc2VydCA/XG4pKQogCSAgICAg IChkZWxldGUtcmVnaW9uIChtYXRjaC1iZWdpbm5pbmcgMSkgKG1hdGNoLWVuZCAxKSkpKSkpKQog ICAgIDs7IFBST0JMRU0gMzogYHRhYi13aWR0aCcgb3IgbW9yZSBTUEFDRXMgYXQgYm9sCiAgICAg OzsgUFJPQkxFTSA0OiBTUEFDRXMgYmVmb3JlIFRBQgotLSAKMi43LjQKCg== --94eb2c062bd22b9dd00544208c11-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 23:07:01 2016 Received: (at 25157) by debbugs.gnu.org; 21 Dec 2016 04:07:02 +0000 Received: from localhost ([127.0.0.1]:49542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJYBB-0002Bj-KM for submit@debbugs.gnu.org; Tue, 20 Dec 2016 23:07:01 -0500 Received: from mail-it0-f41.google.com ([209.85.214.41]:38379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJYB9-0002BK-N4 for 25157@debbugs.gnu.org; Tue, 20 Dec 2016 23:07:00 -0500 Received: by mail-it0-f41.google.com with SMTP id x2so41912481itf.1 for <25157@debbugs.gnu.org>; Tue, 20 Dec 2016 20:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=KIjGvG+1zyS59PQ2P6tFlkSEfOreaTfI8skcXxOcGhk=; b=phnxV+CvpIfC5ewI2yOVyiEW5bPQjGDcc+H9PAM/LLiYORAb+agzCyEw5zzckd00nr C0EK3NA1XTTRTJBpP0ulqF4XsMrwE03enue/KNCRVzg4h9wudGBbjJUMn/0bq2vM1qqy 4sxhCyrOPvtTq+GyAjEBwDkTRhuJnhOW6vapW61Tb0YvGs6GX70ZHi6AUyfc4KjcNeks seYudk3+YRtC3sbaVqGOd3xWdCko5zg6TcHTTCBRDH3kp+igIB16CKzawfytu6zvQ3vj aqRsGuPlXqOqQfjbqwWdt4pszl/7AAOf9FRfSbwc7xeTKP0XjfUXTwdn+Rlv4yYcpY9D nIqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=KIjGvG+1zyS59PQ2P6tFlkSEfOreaTfI8skcXxOcGhk=; b=Nj/RwMV9eIb72O7c16S/psxQuhEEHZ1SpB6y6v8FxCavwnMU6njfZISwcdaNNC/cME zNR/0xHRBaVvDDZBusxoSuS2dRvKcT8yGM/MmCziRR3lY/pPep5Sksucumu0p617BDdN Q0m9k848INRIzYvUQvCiRI8C//u4LCOoRw6E4LwY78dQOOupN7Hfiry1cp8JQiRcfKjB kz9bPddLrVtjlx/4OnxzedYn9vGUyLNjrxXhTGUhmUeSVhz6//qX+U62ZzFUvda9nhi3 UcXT7BNfzWME0mM2cNL1wXStMmqNU9PUGCufRcIwOkZ/OW94eW1rZdLV/EK7ct6dT8iA dSDA== X-Gm-Message-State: AIkVDXJMIIA5XNyokvxPTuvb/Im9ZD2DzSDLrQIT9582qyBqwJn6OESRf6V7Rz5WeWv3pQ== X-Received: by 10.36.11.65 with SMTP id 62mr1778725itd.118.1482293214219; Tue, 20 Dec 2016 20:06:54 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id k205sm10151670ita.15.2016.12.20.20.06.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Dec 2016 20:06:53 -0800 (PST) From: npostavs@users.sourceforge.net To: Reuben Thomas Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> Date: Tue, 20 Dec 2016 23:07:56 -0500 In-Reply-To: (Reuben Thomas's message of "Tue, 20 Dec 2016 18:37:29 +0000") Message-ID: <878tr9c4bn.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) --=-=-= Content-Type: text/plain Reuben Thomas writes: > > Given my previous error of reasoning, I'm submitting the above for your consideration before I prepare a patch! Sorry I didn't get around to looking at this before you wrote a patch, but I think you're overthinking this. AFAICT, your first fix (in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24745#5) was right. Here's a patch with some tests, let me know if I missed any cases. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=v1-0001-Fix-whitespace-eob-cleanup.patch Content-Description: patch >From e918857882733460a429f6a37344567a5021efa5 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 20 Dec 2016 23:02:48 -0500 Subject: [PATCH v1] Fix whitespace eob cleanup * lisp/whitespace.el (whitespace-empty-at-eob-regexp): Match any number of empty lines at end of buffer. * test/lisp/whitespace-tests.el (whitespace-cleanup-eob): New test. (whitespace-tests--cleanup-string): New helper function for tests. --- lisp/whitespace.el | 2 +- test/lisp/whitespace-tests.el | 52 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 test/lisp/whitespace-tests.el diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 29d60c9..a15308c 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -729,7 +729,7 @@ whitespace-empty-at-bob-regexp :group 'whitespace) -(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]*\\(\n\\{2,\\}\\|[ \t]+\\)\\)\\'" +(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)\\'" "Specify regexp for empty lines at end of buffer. Used when `whitespace-style' includes `empty'." diff --git a/test/lisp/whitespace-tests.el b/test/lisp/whitespace-tests.el new file mode 100644 index 0000000..ffd2e65 --- /dev/null +++ b/test/lisp/whitespace-tests.el @@ -0,0 +1,52 @@ +;;; whitespace-tests.el --- Test suite for whitespace -*- lexical-binding: t -*- + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) +(require 'whitespace) + +(defun whitespace-tests--cleanup-string (string) + (with-temp-buffer + (insert string) + (whitespace-cleanup) + (buffer-string))) + +(ert-deftest whitespace-cleanup-eob () + (let ((whitespace-style '(empty))) + (should (equal (whitespace-tests--cleanup-string "a\n") + "a\n")) + (should (equal (whitespace-tests--cleanup-string "a\n\n") + "a\n")) + (should (equal (whitespace-tests--cleanup-string "a\n\t\n") + "a\n")) + (should (equal (whitespace-tests--cleanup-string "a\n\t \n") + "a\n")) + (should (equal (whitespace-tests--cleanup-string "a\n\t \n\n") + "a\n")) + (should (equal (whitespace-tests--cleanup-string "\n\t\n") + "")) + ;; Whitespace at end of non-empty line is not covered by the + ;; `empty' style. + (should (equal (whitespace-tests--cleanup-string "a \n\t \n\n") + "a \n")))) + +(provide 'whitespace-tests) + +;;; whitespace-tests.el ends here -- 2.9.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 21 06:07:19 2016 Received: (at 25157) by debbugs.gnu.org; 21 Dec 2016 11:07:19 +0000 Received: from localhost ([127.0.0.1]:49703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJejv-0005ZB-Lw for submit@debbugs.gnu.org; Wed, 21 Dec 2016 06:07:19 -0500 Received: from mail-qk0-f178.google.com ([209.85.220.178]:36226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJeju-0005Yz-7C for 25157@debbugs.gnu.org; Wed, 21 Dec 2016 06:07:18 -0500 Received: by mail-qk0-f178.google.com with SMTP id n21so72399351qka.3 for <25157@debbugs.gnu.org>; Wed, 21 Dec 2016 03:07:18 -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=iMlXc/8aFUnurN1O7ChWQTKSXC460VYClI3sHifzMO0=; b=hpZuo7CFaDiytJ/S8+HVwf/X1sNQwbYvW0BewDqY/c8wjKrlIHa85I2pk9mh/3hXu/ ugVOr4NASmFY5cihrn6Y7Y36jJR7HHjyv32UykkuxlMQdWbM8ZtcNxoQhf/DyRCd84a0 elnG3P7ETsEYJ2O1OT3eu0M6q0sNWRgFppKR8= 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=iMlXc/8aFUnurN1O7ChWQTKSXC460VYClI3sHifzMO0=; b=c3eYq7XyIJxKPlxRNkwOvl2hYUpLLWDpwbh95fv1HM3equ6d96ehIreAPyipOOo8qR 4aNytFUg4EuFb/StDWC8iOAthR2yx4ivOHq7iFC2UNipPE1S4HrfjzkeAUHaQbQzaaun iZ19XLzlZDEo0GHOX88pMZNGgoyRXa63LQDMAmeweHR27vTghYV0UA6UCOAS8SwgJNqo Sgn8DE4n505XIwjDVP0unQijJWucariYiB8jcvAX7l+T2bijQ3GAp3Hj0+6kvnamDc8t WHT6Uzt74tatNiLb3/VE78tKAIzEHfrSgc4stwrd04zAtrJKLoXudNtD1aQ8nUjtjgC6 F/3g== X-Gm-Message-State: AIkVDXJfAgPlH1cAx+qVwG/QcN5j4BM2w9vVXbxUX2RFMAgmoi7ksof/H0qz+cPuGwoFtfnVJ4G60BzYHURqQWGT X-Received: by 10.55.185.133 with SMTP id j127mr3867975qkf.39.1482318432748; Wed, 21 Dec 2016 03:07:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.88.51 with HTTP; Wed, 21 Dec 2016 03:07:12 -0800 (PST) In-Reply-To: <878tr9c4bn.fsf@users.sourceforge.net> References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> <878tr9c4bn.fsf@users.sourceforge.net> From: Reuben Thomas Date: Wed, 21 Dec 2016 11:07:12 +0000 Message-ID: Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore To: Noam Postavsky Content-Type: multipart/alternative; boundary=94eb2c043920a14d3e05442927b2 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --94eb2c043920a14d3e05442927b2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 21 December 2016 at 04:07, wrote: > > Sorry I didn't get around to looking at this before you wrote a patch, > but I think you're overthinking this. I confirm that your patch seems to work, thanks very much. Adding some tests is particularly helpful: if I'd done that, I wouldn't have gotten in this mess in the first place! How can one overthink a logical problem? It's possible to underthink, but in this case, I believe I misunderstood what the whitespace-empty-at-eob-regexp was supposed to match: only empty lines, not trailing space at the end of non-empty lines (as one of your comments mentions). (I was trying to make it match ALL the whitespace at the end of the buffer, as you probably realised.) The only thing I'd change in your match is, as in mine, remove the FIXME after save-match-data.=E2=80=8B --94eb2c043920a14d3e05442927b2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
--94eb2c043920a14d3e05442927b2-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 21 21:17:50 2016 Received: (at 25157) by debbugs.gnu.org; 22 Dec 2016 02:17:50 +0000 Received: from localhost ([127.0.0.1]:50745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJsx4-0007Xr-08 for submit@debbugs.gnu.org; Wed, 21 Dec 2016 21:17:50 -0500 Received: from mail-it0-f53.google.com ([209.85.214.53]:36698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJsx2-0007Xf-Cf for 25157@debbugs.gnu.org; Wed, 21 Dec 2016 21:17:48 -0500 Received: by mail-it0-f53.google.com with SMTP id 75so91721410ite.1 for <25157@debbugs.gnu.org>; Wed, 21 Dec 2016 18:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=DnKliMFTRIJk2Km7hFnKfBmdo/kCpsZXG4toRZoZJ+Q=; b=EjqaLs01ELA3T5xSPECyIKaOFVZBV/8U4S3gMXdT5VAA1uUdPZku3tfJthCM7Ulsgs zd6xvjs08X2LVOLTMDbAx0qZ904tJm6wB6HJCGYsQcrsSo6Mi5Dp67CEVu1F93UkmuiH Gq5mdgfw33JYyyeYwqYy/JpXVV//1KqmWcMZ082Y+NbckPQ5rYE8ZOnC1KdgAmM1TJii JvrXYgfah9BAXMGRAe6Z5uIwE9ZjQKzKH1ILCwaeq+pdieydkhRz79KQxHIqlZ2UgxF+ WVVgtEEazAFfj5IXzyiCOoxqE1INudqznyvftJbh9u7HFnBOtYuxRxLMqoia/PiKQRM5 ckdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=DnKliMFTRIJk2Km7hFnKfBmdo/kCpsZXG4toRZoZJ+Q=; b=WivU6iiHyWMUCtYKzD6X5dJ6JzC0OkxDPdjT7YCj79AOUEghQ94QkNyk/MO+lk2ku8 AM3Te19sI+Xh4DXbtg2bV+0UH0sozSdMcH2zX5WrS7iUnXV7rE78u0BGGqULI2GQo8GE zMm3LUsVKM0EMVBtMiYtffTS5cRMAfSots91u2oc2fbQrDTY0XRWeoUtWQQ8UiQSKQqs E5yBxpsZccEH9olKvTDy4H7Us8X+D5B0oMcv01Vitzt2f+ktKMtzvyVTJpULI0l7jEyH 33b5GqbzfNbf9xYaHEAhXwf5zDp+rIXdO4oNlhzCPk85Lf8LGDCac7hMAg31vqz6aSHn 25rw== X-Gm-Message-State: AIkVDXK62bu6gFCFg1ErWAT6VNa7SpZeVfgvyXDNmN+vVDQV+2JK9p9TmqwFzTzTT26s5Q== X-Received: by 10.36.61.146 with SMTP id n140mr10791431itn.78.1482373062846; Wed, 21 Dec 2016 18:17:42 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e68sm13153022ioj.39.2016.12.21.18.17.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Dec 2016 18:17:42 -0800 (PST) From: npostavs@users.sourceforge.net To: Reuben Thomas Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> <878tr9c4bn.fsf@users.sourceforge.net> Date: Wed, 21 Dec 2016 21:18:45 -0500 In-Reply-To: (Reuben Thomas's message of "Wed, 21 Dec 2016 11:07:12 +0000") Message-ID: <8760mcbta2.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 22 07:53:45 2016 Received: (at 25157) by debbugs.gnu.org; 22 Dec 2016 12:53:45 +0000 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 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 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) MIME-Version: 1.0 Received: by 10.140.88.51 with HTTP; Thu, 22 Dec 2016 04:53:37 -0800 (PST) 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> References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> <878tr9c4bn.fsf@users.sourceforge.net> <8760mcbta2.fsf@users.sourceforge.net> From: Reuben Thomas Date: Thu, 22 Dec 2016 12:53:37 +0000 Message-ID: Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore To: Noam Postavsky Content-Type: multipart/alternative; boundary=94eb2c05a8300c981005443ec277 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --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-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 22 19:03:01 2016 Received: (at 25157) by debbugs.gnu.org; 23 Dec 2016 00:03:01 +0000 Received: from localhost ([127.0.0.1]:51940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKDK9-0002r3-8c for submit@debbugs.gnu.org; Thu, 22 Dec 2016 19:03:01 -0500 Received: from mail-it0-f42.google.com ([209.85.214.42]:35592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKDK6-0002qp-Rc for 25157@debbugs.gnu.org; Thu, 22 Dec 2016 19:02:59 -0500 Received: by mail-it0-f42.google.com with SMTP id c20so133533205itb.0 for <25157@debbugs.gnu.org>; Thu, 22 Dec 2016 16:02:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=acq3Zfxi4TghvHtUM9LDU94hz9YB+VuGAo9DwEScgwY=; b=aaSxK8GRmeZWmnExwhGiwV3IDqATLCUkSHbnQxY5/Oopq8g3+THe+DHeY1or/Dqt4S Q2+7c0khtFxJtxPgPeDZC/MXhxN0k9xjuFn2bxEj74HYO/k04/FoNp+iWWbhh07CmHvO jSs1uGacKkyw2u4MbhaQ1NaDUtObfmqcKJx3YgbD5mG5uQXAqRn4wuQR4ZGnqXAsDF3s 1W3QXd9InhAasykcF2NF/fcpnj+7AtXu3eykgSApzPDuqfRp524qE64/TeKF2SQYPiKc X/hLSgOQu2yogS5a7EVBamqE2+UCWachzIHhynxg97Oea1A/1c/WjTQCUgPvRdHsNdkF G5ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=acq3Zfxi4TghvHtUM9LDU94hz9YB+VuGAo9DwEScgwY=; b=kdsNZyPVueOr1UO3MxMfKN5f14i8pFu5UthlPCr0jz/1oktIlILYJgtIH5KJKNLjPU e8ZudZx4JC8r+9k9v7sE9iI9elPRCcYYoDyByTCYrOsVWeiuZDW6SDwHFxQq8afH+lL4 pfO8MhgIZYSTTjwZUOy1j4NNxi0gmXV18pppwhJeTxGOC/dJmLpP57hBTh9P3y8sOraA AtNHyEM/VaYk8O9Dk4IK2RZbKbefUGRCc4BSrbzIF/t1ag5b6aLDFYUCozh/uigNLeMG ueh8Rvn07d9gslGNonFfOeBB9S8LsqPaxnKyqaIERXp/6Vr5BzSBsUBAuAz33V+6t0fh ZNEg== X-Gm-Message-State: AIkVDXJbSXlUMwJlOiq1RtmXkP5MOTClZiNeVJlvB/Vf3xcsJCvpsv5zP43dweBeXnAteg== X-Received: by 10.36.53.211 with SMTP id k202mr14621092ita.72.1482451373312; Thu, 22 Dec 2016 16:02:53 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id j143sm11451821ita.1.2016.12.22.16.02.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Dec 2016 16:02:52 -0800 (PST) From: npostavs@users.sourceforge.net To: Reuben Thomas Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> <878tr9c4bn.fsf@users.sourceforge.net> <8760mcbta2.fsf@users.sourceforge.net> Date: Thu, 22 Dec 2016 19:03:53 -0500 In-Reply-To: (Reuben Thomas's message of "Thu, 22 Dec 2016 12:53:37 +0000") Message-ID: <87tw9va4uu.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Reuben Thomas writes: > On Dec 22, 2016 2:17 AM, wrote: >> > >> > The only thing I'd change in your match is, as in mine, remove the FIX= ME 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? Probably yes. > The only perhaps unexpected thing I can think of is that whitespace-clean= up can be called from a hook, such as save-file-hook, but that > doesn't seem to matter. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 23 05:45:02 2016 Received: (at 25157) by debbugs.gnu.org; 23 Dec 2016 10:45:03 +0000 Received: from localhost ([127.0.0.1]:52083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKNLS-00014g-MR for submit@debbugs.gnu.org; Fri, 23 Dec 2016 05:45:02 -0500 Received: from mail-qt0-f172.google.com ([209.85.216.172]:33384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKNLR-00013v-2J for 25157@debbugs.gnu.org; Fri, 23 Dec 2016 05:45:01 -0500 Received: by mail-qt0-f172.google.com with SMTP id p16so255192278qta.0 for <25157@debbugs.gnu.org>; Fri, 23 Dec 2016 02:45:01 -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=Owu4Py1Kykyjgez2mTeIMrkarEiO+Sy3cayco2KtF8o=; b=fbA/LobcHCDpT9fucloB4tfX7MeVTMFaQbDBAgFUggF8J0PPB+XC9OV8hVAwDsxHyg OdBHfsIEzFJRWdvmf0ba0Yyi1cb0Sf9w+dfzCFlNjeNFHdWMoBeOpSiWNn3KWUQUQDhQ JqhT4j/Mn/S5Cj18tASRh4k8c+szMxm5RJslA= 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=Owu4Py1Kykyjgez2mTeIMrkarEiO+Sy3cayco2KtF8o=; b=qGL060zOmE2UI2SEqIs2zmUeidGtoFreBHZDNtTwZMgo6CBp5nWmVICXjpeKDZYaND hbrcm1PGlMmtHDgNLz2YubtX+fHqHrhSMnsiebfmHLx7XZyZo718uDrGQsX6xwCV6AjW JcSf64qcVSyN9t4fhY+gpzFXdjszGuinjCBYDBMfSIqk3rs80dJGDcspqSKWY5/byc/3 Wy2GXKCxKIzcSq1Ynd5zoqDKypaj8d3Z2S7C243aiBgrV86qtieRoskpetbBBrLE3Z91 LhkDw3Iy7/xH6AD6V3tPQBp39RT4yDGA7olF4jGC2Pd2nFJDqsAxwtsCRy0ssGViFYZD HEmQ== X-Gm-Message-State: AIkVDXInAFBJxllUHgChTq9Avrjs1XiAiYgZ8CWKFRU1mJBFn/wG6+yyCR7SqAhdTC4InbgIKI6oTlH/siyqD2CZ X-Received: by 10.200.44.202 with SMTP id 10mr11386228qtx.156.1482489895464; Fri, 23 Dec 2016 02:44:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.88.51 with HTTP; Fri, 23 Dec 2016 02:44:54 -0800 (PST) In-Reply-To: <87tw9va4uu.fsf@users.sourceforge.net> References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> <878tr9c4bn.fsf@users.sourceforge.net> <8760mcbta2.fsf@users.sourceforge.net> <87tw9va4uu.fsf@users.sourceforge.net> From: Reuben Thomas Date: Fri, 23 Dec 2016 10:44:54 +0000 Message-ID: Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore To: Noam Postavsky Content-Type: multipart/alternative; boundary=001a113572ba9a604a05445113d5 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a113572ba9a604a05445113d5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 23 December 2016 at 00:03, wrote: > Reuben Thomas writes: > > > On Dec 22, 2016 2:17 AM, wrote: > >> > > >> > 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 i= s > >> needed. Usually in Emacs the caller is responsible for saving the matc= h > >> data, if it needs to. I don't really see the need here. > > > > Can it be removed then? > > Probably yes. =E2=80=8BGreat; can you then install a suitable patch, please? --=20 http://rrt.sc3d.org --001a113572ba9a604a05445113d5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On = 23 December 2016 at 00:03, <npostavs@users.sourceforge.net> wrote:
Reuben Thomas <= rrt@sc3d.org> writes:

> On Dec 22, 2016 2:17 AM, <npostavs@users.sourceforge.net> wrote:
>> >
>> > 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-da= ta
>> is the call of re-search-forward.
>>
>> I'm not sure this is a sufficient explanation of why save-matc= h-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?

Probably yes.

=E2=80=8BGreat; can you then install a suitable= patch, please?

--
--001a113572ba9a604a05445113d5-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 24 10:33:54 2016 Received: (at 25157) by debbugs.gnu.org; 24 Dec 2016 15:33:54 +0000 Received: from localhost ([127.0.0.1]:53883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKoKY-0006w9-L9 for submit@debbugs.gnu.org; Sat, 24 Dec 2016 10:33:54 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:33170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKoKW-0006vr-Il; Sat, 24 Dec 2016 10:33:53 -0500 Received: by mail-it0-f67.google.com with SMTP id c20so27146874itb.0; Sat, 24 Dec 2016 07:33:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=wdOGP3PMK6GD823KIl9HL8GvTT/25aBBhTYU3mobtyo=; b=rW4OGx2JEitGEv78pjrPVoGyMrX8Hmg7+stXMATbEY3yD/vJvqzfXpaRRAfwRKnWvN rSXY4p2OZn5QxrX15RHUpHTG3lcwmZhmyuCaY8mPdspzueLSumFYrL9J1td2rjdcFuOE QBX6R1LKDYI/47AD5AsK+nlN0TBvoju9Wmfaap3ktJMNhQM54Ioh14tC6sn0q0xaQ2aQ j/356C6344nD4TWdgg1yrGkdXo/tGNWm9z/3/GhMHbj+d9Gs0dYcfMtqqk14S1M5MPk/ TACIOvUH3oVAxwVOSTOGR9Q7tOUC+atDRC88STrkvrWHQgdNX1n+isr9owqYQJ16v/A8 QPfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=wdOGP3PMK6GD823KIl9HL8GvTT/25aBBhTYU3mobtyo=; b=DfxIlQa/EpcISgZoNo4Z1PjwhC3GKM7Gp3f7EEHhDXzDFKNBJN7yYkLNc1K2Vtdr4b abvpxnBFw+Vs54yLysi8GbPAkIyJqNoFSHYobkveur0+V7bFtaBoBzcw3HC8XLgq8ClQ WHLFv8AiavkcQNtS2BnShLOoB9hcHII4YGp5x79s1XzUtgul0iZpJPRsPlFfFoGyBv/z vCqSxtinYKnUZknOYy6AZ+Epqr8tfiWKCTUnWiSJ9cyUFH20gDNtPMD+vM7gFIP9X/Lw n9d/cKd2svz2UQXt2CB8Hp9jsh05ww6zLKHVQ2MmCV3RcEbJma3bkhifZG1uUL18Ho7F APbQ== X-Gm-Message-State: AIkVDXIbywvcjwDWSf9BUmo1cHhnTa7AWEfanStZcNAK5ULOZrH7NR/5WZxOvEIrf++0PQ== X-Received: by 10.36.105.14 with SMTP id e14mr19359694itc.115.1482593627090; Sat, 24 Dec 2016 07:33:47 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e143sm16283780itc.9.2016.12.24.07.33.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Dec 2016 07:33:46 -0800 (PST) From: npostavs@users.sourceforge.net To: Reuben Thomas Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> <878tr9c4bn.fsf@users.sourceforge.net> <8760mcbta2.fsf@users.sourceforge.net> <87tw9va4uu.fsf@users.sourceforge.net> Date: Sat, 24 Dec 2016 10:34:50 -0500 In-Reply-To: (Reuben Thomas's message of "Fri, 23 Dec 2016 10:44:54 +0000") Message-ID: <87fuld9w85.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) tags 25157 fixed close 25157 26.1 quit Reuben Thomas writes: > >> > >> (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 mat= ch > >> data, if it needs to. I don't really see the need here. > > > > Can it be removed then? > > Probably yes. > > =E2=80=8BGreat; can you then install a suitable patch, please? I've pushed the first patch as cf5417f02887 "Fix whitespace eob cleanup", removed save-match-data in da52e939aa26 "Remove redundant `save-match-data' in whitespace.el". From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 26 17:37:17 2016 Received: (at 25157) by debbugs.gnu.org; 26 Dec 2016 22:37:17 +0000 Received: from localhost ([127.0.0.1]:56085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLdtN-0001rB-08 for submit@debbugs.gnu.org; Mon, 26 Dec 2016 17:37:17 -0500 Received: from mail-qk0-f180.google.com ([209.85.220.180]:36169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLdtL-0001qy-6l for 25157@debbugs.gnu.org; Mon, 26 Dec 2016 17:37:15 -0500 Received: by mail-qk0-f180.google.com with SMTP id n21so201276619qka.3 for <25157@debbugs.gnu.org>; Mon, 26 Dec 2016 14:37:15 -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=j9RbhBgItfkW/egPrt2rEEF/QHgzwYA5VwbbjKQQyjI=; b=QwdODgfC8AYgU7c6Jf9bCDQX+aiJhIH+Irr5m+PObgtGFz8PRjdi0QX9eQxZHOyaRO cRKx+/gmdVxWHIkkcJpxWWVmCO3n2yKBSDqu/q9cA7RdPvpVOvNqd/dWBVLUWUEDvLWa uhPEgynwuv/zOy5ScSk1ihu5LSMa9+T4tCxW4= 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=j9RbhBgItfkW/egPrt2rEEF/QHgzwYA5VwbbjKQQyjI=; b=gRcEFK10eyyc1Zs6ZgmvDSoNu7aNUDV5k+ullQI1T0ZnwllaaeMO/VzGU1ChauUKwB R/EK8kRXTcIiV6yc5Q9/2GryCj1H2UcWylODAi6xe+xQ1+O8/cMfuLzjsmKdqexPcuxV TxHT450OE9Dq3SOij8ToyqZK4SzbPgU0INnjlaKvwuddX0OM8ZneZHS6b7ZThBgWkD/n 3KlOBPxJ9YnvxTNTd3XSyk8RIZ22f6st8L2ysU0MUiXVJhJR0ts2rmDYfYCaYu/mI3OH sdoQM/4LIuxKQtOTflzDmPaSUX2Vx8FEeF9jCTo8H3xe2njnaFGRTSdtR5jwzLL4Hips WsVA== X-Gm-Message-State: AIkVDXKQe14V+BWdwA3upyBZgU2Fuk/VNJLrqvmJRcNjbBD6MKIttRd2DumbloqSd0ZxTm9PmTDBtkbIZk6L/8I7 X-Received: by 10.55.220.69 with SMTP id v66mr28248773qki.264.1482791829712; Mon, 26 Dec 2016 14:37:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.88.51 with HTTP; Mon, 26 Dec 2016 14:37:09 -0800 (PST) In-Reply-To: <87fuld9w85.fsf@users.sourceforge.net> References: <8760mr26dr.fsf@openmailbox.org> <87eg13b4jk.fsf@users.sourceforge.net> <878tr9c4bn.fsf@users.sourceforge.net> <8760mcbta2.fsf@users.sourceforge.net> <87tw9va4uu.fsf@users.sourceforge.net> <87fuld9w85.fsf@users.sourceforge.net> From: Reuben Thomas Date: Mon, 26 Dec 2016 22:37:09 +0000 Message-ID: Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore To: Noam Postavsky Content-Type: multipart/alternative; boundary=94eb2c0cc9ac49504805449760b3 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25157 Cc: Mark Karpov , 25157@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --94eb2c0cc9ac49504805449760b3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 24 December 2016 at 15:34, wrote: > I've pushed the first patch as cf5417f02887 "Fix whitespace eob > cleanup", removed save-match-data in da52e939aa26 "Remove redundant > `save-match-data' in whitespace.el". > =E2=80=8BThanks very much for this, in particular digging my mis-analysis o= ut of a hole. --=20 http://rrt.sc3d.org --94eb2c0cc9ac49504805449760b3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable --94eb2c0cc9ac49504805449760b3-- From unknown Sat Aug 16 18:48:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 24 Jan 2017 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator