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

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

Re: Stop autoindenting!


From: Michael Slass
Subject: Re: Stop autoindenting!
Date: Thu, 27 May 2004 18:07:33 GMT
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

astone42@simla.colostate.edu (SomeDude) writes:

>I've got a pretty unique coding style for C\C++ that I like. I think
>it makes my code easy to read and understand (especially once syntax
>highlighting is enabled). Unfortunatly, it doesn't conform to any of
>the predefined styles set by emacs. What I'd like to do is turn off
>all forms of autoindentation and get the tab key to work like it would
>in any normal word processor so that I can manually format my code.
>Things like braces seem to jump around to odd places whenever I type
>them in. Rebinding tab and entering text mode makes it work exactly
>like I want it to except text mode doesn't include syntax highlighting
>which I'd like to have. If it were possible to somehow program emacs
>to my own style that'd be cool too, but I don't know how to do that\if
>it'd be possible.

It is almost certainly possible to make emacs indent your c/c++ code
exactly the way you want it to, and you'd be well-advised to let it,
rather than committing to a life of hand-indentation.  I would
recommend reading Kai's excellent tutorial on syntax-driven
indentation available here:

ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tutorials/tutorials_toc.html

If, after reading the tutorial, you still want to do it by hand then
you can bind the TAB, {, }, and what ever other keys produce electric
effects to 'self-insert-command, and they'll do just that. 
-- 
Mike Slass


reply via email to

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