help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: In "C" mode, how do I turn off electric mode?


From: Alan Mackenzie
Subject: Re: In "C" mode, how do I turn off electric mode?
Date: Sat, 24 Nov 2007 21:18:19 +0000
User-agent: Mutt/1.5.9i

Hi, Bruce!

On Sat, Nov 24, 2007 at 09:42:13AM -0800, Bruce Korb wrote:
> c-toggle-electric-state does not seem to do the trick.  I try to put
> text into a comment, and the electric mode is so helpful, it is
> impossible to do it, except by using text mode in another buffer and
> pasting it into my C code.

OK, calm down please!  We'll get your CC Mode working reasonably for you,
don't worry!  All "helpful" features in CC Mode can be turned off.

Have you got the latest version of Emacs/CC Mode?  If you do M-x
c-version, you should hopefully get 5.31.n, where n is probably 4.  If
not, you might want to upgrade your Emacs.

And just to make sure we're speaking the same language: "electric mode"
in CC Mode means things like your code being automatically re-indented
when you type a semicolon or brace.  You can toggle this with C-c C-l.
See the page "Getting Started" in the CC Mode manual if you want to
disable it more permanently.  The page "Electric Keys" gives a complete
run down of the electric mode.  

> What is going on?  What are the emacs developers thinking?
> STOP BEING SO HELPFUL.

Hey, I don't think you mean that!  I'm being as helpful as I can, right
now.  ;-)

> IT IS NOT HELPFUL.  I JUST WANT TO EDIT MY TEXT.  SOME ASSISTS ARE NICE
> BUT THIS IS WAY OVER THE LINE.  ARGHHHH!!!!!!!!!!!

Really, these things _are_ helpful.  Honest!  The problem is that you
don't feel in control of what Emacs is doing.  So the way to go is to
disable the particular features which are biting, and once you feel like
you've got control back again, you can then start experimenting with them
slowly, if you want.  You might even like them if they're not being
forced on you.

We need to identify these features.  You've said:

> I try to put text into a comment, and the electric mode is so helpful,
> it is impossible to do it, except by using text mode in another buffer
> and pasting it into my C code.

Could you please give as a keystroke-by-keystroke description of what
you're doing and what you see:
o - Is it an existing comment or a new one?
o - If it's new, how did you create it?
o - How are you putting the text into the comment?  Typing a character at
  a time, or with C-y, or how?
o - What happens, and what do you want to happen instead?

Have you configured any CC Mode stuff in your .emacs?  If so, would you
post the relevant bits here, please.

-- 
Alan Mackenzie (Ittersbach, Germany).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]