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

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

Re: C-mode electric braces


From: Alan Mackenzie
Subject: Re: C-mode electric braces
Date: Wed, 11 Sep 2002 17:54:18 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Carsten Burstedde <bursted@iam.uni-bonn.de> wrote on Wed, 11 Sep 2002
11:37:12 +0200:

> Concerning my first question (quote):
> 1. When I define array constants, I do not want emacs to put the closing 
> braces on an extra line, which it currently does. When I hit } after
> int a[3] = { 1, 2, 3
> the closing brace jumps to the next line. How can I switch this off?
> (/quote)

> This might be simple, any ideas?

Go to the cc-mode info page, then find the page "Hanging Braces".  What
this says is that there is an association list called
"c-hanging-braces-alist".  In that alist, somehow, you'll have an entry
something like (brace-list-close before) which says "if the } just typed
was syntactically a brace-list-close, insert an extra newline _before_
the }".

Remove or modify this, and your problem will be solved (as opposed to
merely being work around).

By the way, to discover that the } was actually a "brace-list-close", you
make it the first symbol on a line (if it weren't there already :-) then
type C-c C-s.

> Carsten

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").



reply via email to

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