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: Mon, 15 Apr 2002 11:47:33 -0700 Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <3CB7662B.82AA21D9@hiwaay.net> <3CBB052E.4B5C6FAB@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 1018896578 26330 127.0.0.1 (15 Apr 2002 18:49:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 15 Apr 2002 18:49:38 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16xBXl-0006qZ-00 for ; Mon, 15 Apr 2002 20:49:37 +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 16xBWz-0005xG-00; Mon, 15 Apr 2002 14:48:49 -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 16xBVs-0005tv-00 for ; Mon, 15 Apr 2002 14:47:40 -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 LAA10962; Mon, 15 Apr 2002 11:47:34 -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 LAA01773; Mon, 15 Apr 2002 11:48:39 -0700 In-Reply-To: <3CBB052E.4B5C6FAB@hiwaay.net> Original-To: Tony Harbin , Greg Hill 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:89 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:89 Tony, It just takes more of the same, e.g.: (add-hook 'c-mode-hook (function (lambda () (substitute-key-definition 'c-indent-command 'self-insert-command c-mode-map) (substitute-key-definition 'c-electric-paren 'self-insert-command c-mode-map)))) M-x apropos c-electric will give you a list of all the c-electric- commands. Just use substitute-key-definition in your c-mode-hook and c++-mode-hook lambdas to replace any of them that you don't want with self-insert-command. If you want to keep the automatic indentation performed by the TAB key and ditch only the "electric" stuff, then just leave the substitution for c-indent-command out of your lambdas. --Greg At 11:51 AM -0500 4/15/02, Tony Harbin wrote: >Not quite. C/C++ mode binds open-paren, open-brace, colon, and slash (among > >others) to "electric" functions that, when the key is typed, automatically >change >the spacing and/or indentation on the line. I would like to >disable/override/turn off this behavior. I was able to do this in an older >version where I had to explicitly load the C/C++ mode modules, but in my >current version (20.7.1), the stuff was already compiled in and the same >tricks no longer work. > >Basically, I would just like those keys above to just self-insert and not >run the >"electric" functions. Is there a way to do this?