emacs-devel
[Top][All Lists]
Advanced

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

Re: paren-close-dwim: elisp function of a newbie; feedback welcome


From: Andreas Röhler
Subject: Re: paren-close-dwim: elisp function of a newbie; feedback welcome
Date: Fri, 27 Sep 2013 07:51:11 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

Am 26.09.2013 22:44, schrieb Florian:

I'm not sure what you mean about "repairing ... code".  This command
simply inserts ')', ']', or '}' (and perhaps '>' or so) to match the
most recent unclosed ([{<.

(If it is "really useful", know that it's not my idea; you just quoted
my reimplementation of Florian's code.)

But yours is much cleaner, I like it. Thanks for that.

Here is a small example to illustrate what it does:

If you are writing a nested expression, like the following, and '_' is
your cursor,

{ (a * [(b) - (c) _

and you have bound ')' to paren-close-dwim (dwim = do what I mean),
three succeeding presses of ')' will produce the sequence: ])}. Or in
other words: ')' will produce the correct next matching closing
bracket regarding the position of your cursor.

Florian




Really great. So we may have an electric-close, where C-j does all remaining 
before reaching the next line.





reply via email to

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