From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Slass Newsgroups: gmane.emacs.help Subject: Re: Stop autoindenting! Date: Thu, 27 May 2004 18:07:33 GMT Organization: Comcast Online Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <5fa025ca.0405261852.1bb4fb9d@posting.google.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085682252 5354 80.91.224.253 (27 May 2004 18:24:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 May 2004 18:24:12 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 27 20:23:54 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTPXm-0005Mi-00 for ; Thu, 27 May 2004 20:23:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BTPTY-0008NZ-Uw for geh-help-gnu-emacs@m.gmane.org; Thu, 27 May 2004 14:19:33 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wns13feed!worldnet.att.net!attbi_s02.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:Hj9SwRUV1708fW4KjEwmRFa+ecs= Original-Lines: 28 Original-NNTP-Posting-Host: 24.18.253.35 Original-X-Complaints-To: abuse@comcast.net Original-X-Trace: attbi_s02 1085681253 24.18.253.35 (Thu, 27 May 2004 18:07:33 GMT) Original-NNTP-Posting-Date: Thu, 27 May 2004 18:07:33 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:123527 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:18818 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18818 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