From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Loris Bennett" Newsgroups: gmane.emacs.help Subject: Re: delete-trailing-whitespace behavior change? Date: Wed, 12 Dec 2018 16:40:50 +0100 Organization: Freie Universitaet Berlin Message-ID: <87a7lawy65.fsf@hornfels.zedat.fu-berlin.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1544631038 1689 195.159.176.226 (12 Dec 2018 16:10:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Dec 2018 16:10:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 12 17:10:34 2018 Return-path: Envelope-to: geh-help-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 1gX75m-0000Kj-KA for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Dec 2018 17:10:34 +0100 Original-Received: from localhost ([::1]:45822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX77t-0007I5-9w for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Dec 2018 11:12:45 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-X-Trace: news.uni-berlin.de JHUynV07EWarz1Ylv1NpOgPggkWZrMobGYfRMnfYALkOfR Cancel-Lock: sha1:EeW8dLGFZPHM2oKFPLH7tBTWzQ8= Original-Xref: usenet.stanford.edu gnu.emacs.help:224850 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118979 Archived-At: Skip Montanaro writes: > I've defined this hook in ~/.emacs for ages (a decade or so, I suspect): > > (add-hook 'before-save-hook 'delete-trailing-whitespace) > > Recently, I've noticed that the last newline of files seems to be deleted. > Not always, but pretty frequently. I'm running 25.2.2 at home and 25.3.2 at > work. I think I switched from 24 to 25 in the past few months. I can't seem > to quickly lay my hands on Emacs 24 without going through a > download/install cycle, but I wonder if delete-trailing-whitespace might > have changed between 24 and 25? > > Any insight would be appreciated... I have this setting too and my Emacs 25.1.1 deletes all empty newlines at the end of a file, which it is what it says on the tin: If this command acts on the entire buffer (i.e. if called interactively with the mark inactive, or called from Lisp with END nil), it also deletes all trailing lines at the end of the buffer if the variable ‘delete-trailing-lines’ is non-nil. The 24.5.1 tins say the same thing. Cheers, Loris -- This signature is currently under construction.