Skip to contentSkip to conversation

trailing white space...

Linux-ia64 David Mosberger 4 participants 4 messages May 31, 2003 – Jun 2, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Chris Wedgwood

Chris> On Fri, May 30, 2003 at 05:34:31PM -0700, David Mosberger

Quoted 3 lines · Chris> wrote:
Quoted 3 lines

Nah, that's OK. With patches it's much easier to make trivial changes, such as deleting the trailing whitespace that everybody seems to love so much... ;-)

Chris> One of my pet gripes :)

Chris> Emacs users can (and should!) consider:

Chris> (setq show-trailing-whitespace t)

Yeah, that does make it pretty hard to ignore, doesn't it? ;-)

	--david
#1 lore raw
Quoted 3 lines · Chris Wedgwood

Emacs users can (and should!) consider:

(setq show-trailing-whitespace t)

Anything similar for vi and gvim?

Sam

#2 lore raw
In reply to David Mosberger
Quoted 5 lines
Quoted 3 lines

Emacs users can (and should!) consider:

(setq show-trailing-whitespace t)

Anything similar for vi and gvim?

:set list

but in either case this just shows you the stuff, it doesn't remove it.
If it's a persistent problem, a simple filter is easier to use. I find Python's rstrip string method useful for this, i.e. if you have a line of text in 'line',

line = line.rstrip()

saves a new copy of the line with the trailing whitespace removed.

#3 lore raw
In reply to David Mosberger
Quoted 2 lines · Mats D

but in either case this just shows you
the stuff, it doesn't remove it.

I think that's how it should be... removing it on existing files w/o care is bad.

Quoted 2 lines

If it's a persistent problem, a simple
filter is easier to use.

For new files sure, for existing files I would rather people ensure hunsk they edit and linees they edit contain no/few whitespace changes.

Quoted 7 lines

I find Python's rstrip string method useful for this, i.e. if you have a line of text in 'line',

line = line.rstrip()

saves a new copy of the line with the
trailing whitespace removed.

What's wrong with sed?

--cw