[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Preserving trailing spaces
From: |
Giorgos Keramidas |
Subject: |
Re: Preserving trailing spaces |
Date: |
Thu, 19 Apr 2007 02:34:04 +0300 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (berkeley-unix) |
jgombos <nabble.forum.jog@spamgourmet.com> 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