all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Greg Hill <ghill@synergymicro.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: automatic indentation in C,C++ modes
Date: Mon, 15 Apr 2002 11:47:33 -0700	[thread overview]
Message-ID: <p04310100b8e0c6cc1639@[198.17.100.22]> (raw)
In-Reply-To: <3CBB052E.4B5C6FAB@hiwaay.net>

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?

  reply	other threads:[~2002-04-15 18:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-12 22:56 automatic indentation in C,C++ modes Tony Harbin
2002-04-13  1:06 ` Greg Hill
2002-04-15 16:51   ` Tony Harbin
2002-04-15 18:47     ` Greg Hill [this message]
2002-04-19 17:30       ` Tony Harbin
2002-04-22 17:08         ` Emacs as web server Greg Hill
2002-04-23  2:01         ` automatic indentation in C,C++ modes G Anna
2002-04-24 15:53           ` Tony Harbin

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='p04310100b8e0c6cc1639@[198.17.100.22]' \
    --to=ghill@synergymicro.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.