unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alan Mackenzie <acm@muc.de>
Subject: Re: Emacs: Suppressing auto indentation for C source files
Date: Mon, 17 Oct 2005 13:53:27 +0000	[thread overview]
Message-ID: <nca0jd.76.ln@acm.acm> (raw)
In-Reply-To: 1129301630.992659.11520@z14g2000cwz.googlegroups.com

[Newsgroups: trimmed - Followupto: set]

In gnu.emacs.help Generic Usenet Account <usenet@sta.samsung.com> wrote:
> My apologies if this posting is off topic.

None needed.  The posting is bang on topic.

> I want to suppress the auto indentation for C source files in my emacs
> editor (GNU Emacs 21.2.1, XEmacs 21.4).

The term "auto indentation" covers several aspects in CC Mode.
(i) There's the indentation which happens when you type <TAB> or C-j.
(ii) There's the "electric indentation" which happens when you type a
semicolon or parenthesis or ....

In the current versions of CC Mode (5.28 or 5.30.n:  use M-x c-version to
see which one you've got), there isn't much control you can exercise over
these.  In the soon-to-be-released CC Mode 5.31, you can independently
disable the "electric indentation".

> I have added the following two lines in my .emacs file, but that does
> not seem to help:

> (setq indent-tabs-mode nil)
> (setq c-indent-line nil)

`c-indent-line' doesn't exist.  `indent-tabs-mode' merely says whether
you want to use (mainly) tabs to indent with or only spaces.

> Any suggestions?

Try (setq c-syntactic-indentation nil).  If you still want to be able to
indent with <TAB> or C-j, wait for CC Mode 5.31, which will be available
on <http://www.sourceforge.net/release.php> some time "soon".

> Thanks,
> Gus

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

  parent reply	other threads:[~2005-10-17 13:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-14 14:53 Emacs: Suppressing auto indentation for C source files Generic Usenet Account
2005-10-14 18:28 ` J. David Boyd
2005-10-17 13:53 ` Alan Mackenzie [this message]
2005-11-11 10:26 ` Faried Nawaz

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=nca0jd.76.ln@acm.acm \
    --to=acm@muc.de \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).