unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Slass <miknrene@drizzle.com>
Subject: Re: Stop autoindenting!
Date: Thu, 27 May 2004 18:07:33 GMT	[thread overview]
Message-ID: <m3zn7t4ucb.fsf@eric.rossnet.com> (raw)
In-Reply-To: 5fa025ca.0405261852.1bb4fb9d@posting.google.com

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	other threads:[~2004-05-27 18:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-27  2:52 Stop autoindenting! SomeDude
2004-05-27 18:07 ` Michael Slass [this message]
2004-05-27 19:28 ` Stefan Monnier
2004-05-27 20:42 ` Alan Mackenzie

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=m3zn7t4ucb.fsf@eric.rossnet.com \
    --to=miknrene@drizzle.com \
    /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).