Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Electric braces
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Guido Van Hoecke  
View profile  
 More options Sep 19 2012, 1:12 pm
Newsgroups: gnu.emacs.help
From: Guido Van Hoecke <gui...@gmail.com>
Date: Wed, 19 Sep 2012 19:11:55 +0200
Local: Wed, Sep 19 2012 1:11 pm
Subject: Electric braces
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,

Guido

--
Expect a letter from a friend who will ask a favor of you.

http://vanhoecke.org ... and go2 places!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Константин Куликов  
View profile  
 More options Sep 19 2012, 1:24 pm
Newsgroups: gnu.emacs.help
From: Константин Куликов <zxnotd...@gmail.com>
Date: Wed, 19 Sep 2012 21:17:41 +0400
Local: Wed, Sep 19 2012 1:17 pm
Subject: Re: Electric braces

google autopair.el

2012/9/19 Guido Van Hoecke <gui...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile  
 More options Sep 19 2012, 1:33 pm
Newsgroups: gnu.emacs.help
From: "Pascal J. Bourguignon" <p...@informatimago.com>
Date: Wed, 19 Sep 2012 19:33:03 +0200
Local: Wed, Sep 19 2012 1:33 pm
Subject: Re: Electric braces
Guido Van Hoecke <gui...@gmail.com> writes:

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 {}.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dmitry Gutov  
View profile  
 More options Sep 19 2012, 2:22 pm
Newsgroups: gnu.emacs.help
From: Dmitry Gutov <dgu...@yandex.ru>
Date: Wed, 19 Sep 2012 22:22:21 +0400
Local: Wed, Sep 19 2012 2:22 pm
Subject: Re: Electric braces

Константин Куликов <zxnotd...@gmail.com> writes:

 > google autopair.el

Why google? Here's the home page: http://code.google.com/p/autopair/

And yes, it's the most popular package for this purpose.

I especially like the newline behavior (the fourth bullet point).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Sep 19 2012, 11:47 pm
Newsgroups: gnu.emacs.help
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Wed, 19 Sep 2012 23:47:20 -0400
Local: Wed, Sep 19 2012 11:47 pm
Subject: Re: Electric braces

> 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.

The built-in electric-pair-mode does that.

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Guido Van Hoecke  
View profile  
 More options Sep 20 2012, 10:58 am
Newsgroups: gnu.emacs.help
From: Guido Van Hoecke <gui...@gmail.com>
Date: Thu, 20 Sep 2012 16:58:08 +0200
Local: Thurs, Sep 20 2012 10:58 am
Subject: Re: Electric braces
Hi Stefan, Pascal and Constantin

On 20 September 2012 05:47, Stefan Monnier <monn...@iro.umontreal.ca> wrote:

>> 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.

> The built-in electric-pair-mode does that.

>         Stefan

Thanks for your kind replies.

I tried the built-inelectric-pair-mode and it does what I want.

With kind regards,

Guido

--
Death is nature's way of saying `Howdy'.

http://vanhoecke.org ... and go2 places!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Sep 20 2012, 1:38 pm
Newsgroups: gnu.emacs.help
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Thu, 20 Sep 2012 13:38:43 -0400
Local: Thurs, Sep 20 2012 1:38 pm
Subject: Re: Electric braces

> I tried the built-in electric-pair-mode and it does what I want.

I'm glad you like it,

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
João Távora  
View profile  
 More options Sep 21 2012, 12:56 pm
Newsgroups: gnu.emacs.help
From: João Távora <joaotav...@gmail.com>
Date: Fri, 21 Sep 2012 17:56:19 +0100
Local: Fri, Sep 21 2012 12:56 pm
Subject: Re: Electric braces
(originally forgot to cc: help-gnu-em...@gnu.org)

I'd just like to add that autopair:

* is now hosted at github.com/capitaomorte/autopair
* out of the box, does  a bit more than electric-pair-mode, like
deleting 0-width paren pairs when backspacing and helping to keep the
buffer balanced (for example typing 3 opening "{" consecutively makes
"{{{}}}" instead of electric pair's "{{{}".
* can be customized to behave differently in comments and strings,
pair characters, and more

I'm quite positively surprised how electric-pair-mode has evolved
though, but still find it awkward in how it sometimes pairs and
sometimes doesn't.

--
João Távora

On Thu, Sep 20, 2012 at 6:38 PM, Stefan Monnier


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »