From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: Electric braces Date: Wed, 19 Sep 2012 19:33:03 +0200 Organization: Informatimago Message-ID: <87obl1ex4g.fsf@kuiper.lan.informatimago.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1348076009 19730 80.91.229.3 (19 Sep 2012 17:33:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Sep 2012 17:33:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 19 19:33:33 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TEO9T-0003Lf-PO for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Sep 2012 19:33:31 +0200 Original-Received: from localhost ([::1]:35727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEO9P-0007kf-FE for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Sep 2012 13:33:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEO9K-0007kZ-3a for help-gnu-emacs@gnu.org; Wed, 19 Sep 2012 13:33:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEO9I-0001i4-Nx for help-gnu-emacs@gnu.org; Wed, 19 Sep 2012 13:33:22 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:44979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEO9I-0001hW-H7 for help-gnu-emacs@gnu.org; Wed, 19 Sep 2012 13:33:20 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TEO9I-0003Fq-Th for help-gnu-emacs@gnu.org; Wed, 19 Sep 2012 19:33:20 +0200 Original-Received: from 81.202.16.46.dyn.user.ono.com ([81.202.16.46]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Sep 2012 19:33:20 +0200 Original-Received: from pjb by 81.202.16.46.dyn.user.ono.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Sep 2012 19:33:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 81.202.16.46.dyn.user.ono.com Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:NzM2MmMxMTMyODM4MGNmYTVlZTE3ZjhlNjJkMzhhNGQzYjA4YThhMA== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86836 Archived-At: Guido Van Hoecke 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 {}.