[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Electric braces
From: |
Pascal J. Bourguignon |
Subject: |
Re: Electric braces |
Date: |
Wed, 19 Sep 2012 19:33:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
Guido Van Hoecke <guivho@gmail.com> writes:
> Hi,
>
> When using 'electric braces' in Visual Studio, MonoDevelop and other
> tools, I like the behaviour where the closing brace is auto-detected.
>
> (In the example, I show the insertion point as a bar)
> If I type
>
> if (|
>
> the screen shows
>
> if (|)
>
> I then key in my test expression, say isFalse (or whatever):
>
> if (isFalse|)
>
> At this point, Visual studio and MonoDevelop realise that the next ')'
> key I hit, really represents the ')' which is already there. It does not
> add an additional ')' :
>
> if (isFalse)|
>
> But in Emacs, currently using cperl, but also when using c#-mode, or
> IIRC ruby-mode, emacs does add an additional ')' which leads to
> following erroneous code:
>
> if (isFalse)|)
>
> I am pretty cinfident that Emacs can mimic the VS/MD behaviour. I just
> did not find yet how to request it from good old Emacs.
>
> Thanks in advance for any suggestions,
paredit-mode does that, but perhaps some more since it's for lisp
editing. You'll want to extract parts of it.
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.