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: Johna
Subject: Re: how do you strip leading white spaces in c-mode or similar?
Date: Thu, 05 Jul 2007 18:29:06 -0700
User-agent: G2/1.0

On Jul 5, 1:48 pm, Peter Lee <pete.a....@gmail.com> wrote:
> >>>> Johna  writes:
>
>     > Basically I am frustrated with the default indentation in c-mode (or
>     > similar modes) because it inserts unnecessary white space(s) on empty
>     > lines.  I want all empty lines to contain nothing but '\n'.  Instead 
> they
>     > contain "\n\t" or "\n ".
>
> If you are only concerned about the extraneous spaces being persisted you 
> could:
>
> 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?
I added the above line to the end of my .emacs file, restarted emacs
but it had no effect.

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



reply via email to

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