From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: removing white space highlight Date: Sat, 20 Feb 2016 18:34:17 -0700 Message-ID: <20160220183203963873857@bob.proulx.com> References: <20160220120357638044819@bob.proulx.com> <87vb5ilx7p.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1456018477 25844 80.91.229.3 (21 Feb 2016 01:34:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Feb 2016 01:34:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 21 02:34:32 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aXIuu-0005Ab-8u for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Feb 2016 02:34:32 +0100 Original-Received: from localhost ([::1]:36978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXIut-00021S-LR for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Feb 2016 20:34:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXIuj-00020V-Ur for help-gnu-emacs@gnu.org; Sat, 20 Feb 2016 20:34:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXIug-0006FP-MJ for help-gnu-emacs@gnu.org; Sat, 20 Feb 2016 20:34:21 -0500 Original-Received: from havoc.proulx.com ([96.88.95.61]:35964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXIug-0006FL-HL for help-gnu-emacs@gnu.org; Sat, 20 Feb 2016 20:34:18 -0500 Original-Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id EF47BEEB for ; Sat, 20 Feb 2016 18:34:17 -0700 (MST) Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 93446211DE for ; Sat, 20 Feb 2016 18:34:17 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 51F422DC5F; Sat, 20 Feb 2016 18:34:17 -0700 (MST) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87vb5ilx7p.fsf@debian.uxu> User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 96.88.95.61 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109233 Archived-At: Emanuel Berg wrote: > Of course, there shouldn't be any superfluous > whitespace trailing individual text lines *or* the > file contents itself. > > Here one way to do it: > > ;; (setq before-save-hook nil) > (defun before-save-hook-f () > (delete-trailing-whitespace) ) > (setq before-save-hook #'before-save-hook-f) That is one way to do it. However I don't think it is a good idea to do this automatically every time. I would rather see that it needs to be done and the do it intentionally. Usually I will do one whitespace only cleanup with no other changes and do it first. That way diff -b or -w or -B or other combination will show as clean with no non-whitespace changes. And then I make the change I want to make. If it is automatic then this mixes those two things both at the same time. I would rather see them distict. Bob