|
From: | Dmitry Gutov |
Subject: | Re: [patch] make electric-pair-mode smarter/more useful |
Date: | Thu, 12 Dec 2013 06:29:13 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 |
On 12.12.2013 05:05, João Távora wrote:
Didn't try it yet. Anyway, in latest emacs, js-mode layout rules already have reasonable behaviour, opening newlines after when you "{" and before them when you "}". That might be enough.
I don't think this is sufficient: what if I want to type a one-line function or object literal (say, an empty one)? Or an empty for, while or catch body? I'd have to remove the added newline(s) and whitespace in each such instance.
I'd much prefer a workflow where electric-layout-mode doesn't do anything until I press Return, and then does the autopair-newline thing if point is directly between two parens.
Patch welcome.Patch sent.
Thank you!
[Prev in Thread] | Current Thread | [Next in Thread] |