all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Electric braces
Date: Wed, 19 Sep 2012 19:33:03 +0200	[thread overview]
Message-ID: <87obl1ex4g.fsf@kuiper.lan.informatimago.com> (raw)
In-Reply-To: CAEySM9HMKrH=XhGMdgEzkT61obU1mdR=Oqw9CVcF6pBw+YUBXQ@mail.gmail.com

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




  parent reply	other threads:[~2012-09-19 17:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 17:11 Electric braces Guido Van Hoecke
2012-09-19 17:17 ` Константин Куликов
2012-09-19 17:33 ` Pascal J. Bourguignon [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-09-19 18:22 Dmitry Gutov
     [not found] <mailman.9321.1348074746.855.help-gnu-emacs@gnu.org>
2012-09-20  3:47 ` Stefan Monnier
2012-09-20 14:58   ` Guido Van Hoecke
     [not found]   ` <mailman.9367.1348153122.855.help-gnu-emacs@gnu.org>
2012-09-20 17:38     ` Stefan Monnier
2012-09-21 16:56       ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87obl1ex4g.fsf@kuiper.lan.informatimago.com \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.