[Top][All Lists]

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

Re: C-mode electric braces

From: Carsten Burstedde
Subject: Re: C-mode electric braces
Date: Wed, 11 Sep 2002 11:37:12 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020607

>> 2. After having typed
>> for (i = 0; i < 3; ++i)
>> I want that hitting the opening brace places it on the next line,
>> then inserts an empty line and the closing brace, and places the
>> cursor in >>between:
>>  {
>>    <point>
>>  }
>> Any suggestions for my .emacs?

> I'm afraid you'll have to hack it yourself.  There is (AFAIK) no
> predefined functionality in CC mode for doing this.
> You could look at the function that gets called when you hit a brace
> and then write a new function that looks whether newlines should be
> inserted.

hmm, I am already happy enough that I can set some key bindings and variables in my .emacs, this kind of stuff is probably beyond my el skills. Anyone feels challenged to code this?

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?

This might be simple, any ideas?



reply via email to

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