Subject: Re: bug#25157: 26.0.50; whitespace-cleanup does not remove single trailing empty line anymore

From: [email-masked]
Date: Mon, 19 Dec 2016 23:36:15 -0500

tags 25157 confirmed
quit

Mark Karpov <[email-masked]> writes:

> The ‘whitespace-cleanup’ command does not remove single trailing empty
> line anymore.

This seems to have been caused by the fix for #24745.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24745#5 has
 
-(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=24745#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?