help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how do you strip leading white spaces in c-mode or similar?


From: Tassilo Horn
Subject: Re: how do you strip leading white spaces in c-mode or similar?
Date: Fri, 06 Jul 2007 12:35:12 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Johna <nnn4431@mailc.net> writes:

Hi Johna,

>> insert
>>
>> (add-hook 'before-save-hook 'delete-trailing-whitespace t t)
>>
>> into your mode-hook... which will strip them on each save.
>
> Sorry I am too dumb to do that.
> Can you post a more complete example?

That is complete.

> I added the above line to the end of my .emacs file, restarted emacs
> but it had no effect.

That's all what is needed. As soon as you save the file, all trailing
whitespaces will be deleted.

> The white space usually is added when I press TAB and then ENTER
> for those who wonder where it comes from.

That's strange, anyway. Here, my emacs (22.1) removes trailing
whitespaces in the current line as soon as I go to the next line...

Bye,
Tassilo
-- 
The  desire  to  be  rewarded  for one's  creativity  does  not  justify
depriving  the world  in  general of  all  or part  of that  creativity.
(Richard M. Stallman)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]