all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Johna <nnn4431@mailc.net>
To: help-gnu-emacs@gnu.org
Subject: Re: how do you strip leading white spaces in c-mode or similar?
Date: Thu, 05 Jul 2007 18:29:06 -0700	[thread overview]
Message-ID: <1183685346.183441.17470@n60g2000hse.googlegroups.com> (raw)
In-Reply-To: <uabuaspvb.fsf@gmail.com>

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	other threads:[~2007-07-06  1:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-05  0:34 how do you strip leading white spaces in c-mode or similar? Johna
2007-07-05  8:49 ` brianjiang
2007-07-05 13:20 ` Eli Zaretskii
2007-07-05 17:48 ` Peter Lee
2007-07-06  1:29   ` Johna [this message]
2007-07-06 10:35     ` Tassilo Horn
2007-07-06 12:32       ` Eli Zaretskii
2007-07-06 12:48         ` Nikolaj Schumacher
2007-07-06 15:52           ` Eli Zaretskii
2007-07-08  9:16             ` Nikolaj Schumacher
2007-07-06 12:41     ` Nikolaj Schumacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1183685346.183441.17470@n60g2000hse.googlegroups.com \
    --to=nnn4431@mailc.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.