From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: Preserving trailing spaces Date: Thu, 19 Apr 2007 02:34:04 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <87tzvds1eb.fsf@kobe.laptop> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1176939347 23830 80.91.229.12 (18 Apr 2007 23:35:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2007 23:35:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 19 01:35:41 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HeJgY-00018v-J0 for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Apr 2007 01:35:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HeJlR-00005R-5k for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Apr 2007 19:40:41 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news.astraweb.com!newsrouter-eu.astraweb.com!193.201.147.67.MISMATCH!feeder2.cambrium.nl!feed.tweaknews.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!uio.no!hist.no!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (berkeley-unix) Cancel-Lock: sha1:Jn4mcTxCoa+y+7mjilM5lRUFgOg= Original-Lines: 41 Original-NNTP-Posting-Host: 62.103.39.229 Original-X-Trace: news.sunsite.dk DXC=>6iZB>[B3a9@g6i]76MRQ6YSB=nbEKnk; 9KI=c`M<`]; L^Mj72:ak; I7eU]7Gb30c[>DY7; BM>QOi:7Ca0 Original-X-Complaints-To: staff@sunsite.dk Original-Xref: shelby.stanford.edu gnu.emacs.help:147205 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42809 Archived-At: jgombos writes: > I know it's a strange request to want to preserve trailing spaces; > most folks want to nuke them. I'm working on a project where trailing > spaces actually have meaning (it's how the developer prevents the > automated semantecize tool from concatenating a long line of code > that's intended to span multiple lines for readability). > > They have (probably inadvertently) installed Apex Emacs (aka aemacs), > which is essentially plain old emacs 20.7.1 with Rational's Apex > functionality integrated into the menu. I'm glad they provided it, > but I'm the only emacs user on the team, as everyone else is using the > Rational's proprietary and very basic editor. > > So to get to the issue, emacs wipes out the trailing whitespace on > every file I make a change to, and the semantizer rearranges code that > I didn't touch, adding substantial noise to the diffs - which could > frustrate reviewers. How do I prevent emacs from nuking the trailing > whitespace? > > Everything I've read indicates that emacs automatically preserves > whitespace, and that it must be proactively configured to delete > trailing whitespace. My .emacs file is clean. So somewhere in this > aemacs installation, there must be a hook or something that I need to > override. How would I discover where that's happening? Is it the > lisp code for Ada-mode? It looks like your `write-file-hooks' deletes whitespace. Can you check the value of this variable when you have opened a buffer with your source code? I don't have any local write-file-hooks loaded right now, so when I type `M-: (list write-file-hooks)' my message buffer shows: (nil) If yours shows a non-nil list of hooks, you should examine the hooks to see if one (or more) of them calls `delete-trailing-whitespace' or some other custom function with a similar effect. - Giorgos