From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.help Subject: Re: automatic indentation in C,C++ modes Date: Fri, 12 Apr 2002 18:06:55 -0700 Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <3CB7662B.82AA21D9@hiwaay.net> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Trace: main.gmane.org 1018660373 29374 127.0.0.1 (13 Apr 2002 01:12:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 13 Apr 2002 01:12:53 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16wC60-0007df-00 for ; Sat, 13 Apr 2002 03:12:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16wC2V-0005pR-00; Fri, 12 Apr 2002 21:09:15 -0400 Original-Received: from renfield.synergymicro.com ([153.105.4.30] helo=synergymicro.com) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16wC0I-0005lz-00 for ; Fri, 12 Apr 2002 21:06:58 -0400 Original-Received: from synergy.synergy.encinitas.ca.us ([153.105.4.29]) by synergymicro.com (8.9.3/8.9.3) with ESMTP id SAA25866; Fri, 12 Apr 2002 18:06:57 -0700 Original-Received: from [198.17.100.22] (G_Hill_Mac [198.17.100.22]) by synergy.synergy.encinitas.ca.us (8.9.3/8.8.7) with ESMTP id SAA20768; Fri, 12 Apr 2002 18:07:53 -0700 In-Reply-To: <3CB7662B.82AA21D9@hiwaay.net> Original-To: Tony Harbin , help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:81 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:81 At 5:56 PM -0500 4/12/02, Tony Harbin wrote: >How do I turn off all automatic indentation in C and C++ modes? I find >this >behavior *VERY* annoying and would like to disable it permanently (i.e. >in the >.emacs file) > >Thanks for your time. Tony, If all you want is to insert a tab character at the beginning of a line when you type the tab key, try adding this to your .emacs file: (add-hook 'c-mode-hook (function (lambda () (substitute-key-definition 'c-indent-command 'self-insert-command c-mode-map)))) (add-hook 'c++-mode-hook (function (lambda () (substitute-key-definition 'c-indent-command 'self-insert-command c++-mode-map)))) If, while you are at it, you also want to define the size of a tab as, say, 3 spaces, make it: (add-hook 'c-mode-hook (function (lambda () (substitute-key-definition 'c-indent-command 'self-insert-command c-mode-map) (setq tab-width 3)))) --Greg