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

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

Re: Emacs: Suppressing auto indentation for C source files


From: Alan Mackenzie
Subject: Re: Emacs: Suppressing auto indentation for C source files
Date: Mon, 17 Oct 2005 13:53:27 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

[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").



reply via email to

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