From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [patch] make electric-pair-mode smarter/more useful Date: Thu, 12 Dec 2013 06:29:13 +0200 Message-ID: <52A93B99.8040308@yandex.ru> References: <87haalh806.fsf@gmail.com> <87d2l9wfne.fsf@yandex.ru> <87fvq49xzp.fsf@gmail.com> <87vbyuwyyc.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1386822573 9739 80.91.229.3 (12 Dec 2013 04:29:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Dec 2013 04:29:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 12 05:29:38 2013 Return-path: Envelope-to: ged-emacs-devel@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 1Vqxu5-00073N-74 for ged-emacs-devel@m.gmane.org; Thu, 12 Dec 2013 05:29:37 +0100 Original-Received: from localhost ([::1]:33272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vqxu4-00082E-Ru for ged-emacs-devel@m.gmane.org; Wed, 11 Dec 2013 23:29:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vqxtu-000826-M2 for emacs-devel@gnu.org; Wed, 11 Dec 2013 23:29:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vqxtm-0006Ox-7w for emacs-devel@gnu.org; Wed, 11 Dec 2013 23:29:26 -0500 Original-Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]:48236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vqxtm-0006Ot-0x for emacs-devel@gnu.org; Wed, 11 Dec 2013 23:29:18 -0500 Original-Received: by mail-ee0-f50.google.com with SMTP id c41so3236679eek.37 for ; Wed, 11 Dec 2013 20:29:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=EBZE7kebrH/hNMZdZObO6Ig2SQGqHgEW3YvtzV7WXlk=; b=p6eJHYAMkaqMZckzzhWRE6BH3OmLMBB8DSLDC0TtGLMY1ThM/AgYZP+57SDQ5l7sce EbPvAnNgd/PWgmpagyZhzGMc6gXTTKc1xbm3aCSc8oxmRqQ1NloxmbntustLy3Ggm8hM 3myzGEFkTeFvzjrf7watXZOfkc7jSTfT2+N4irGKP5/r2t2GKjHgmBUYJRcuVN4/sSXy kuEbc4OkNj3QXKQEiyopoqTDYbXvUFWSg/GeQ+uyRuwFiwuOVO5eJscHPC83b5RFTwKb I2WdEaobAEhVZermlnpp9OWl2jL2+P1W3cIgiyyDV64KfAHC7vs+2WKeyNYayePKAIF6 cLxQ== X-Received: by 10.15.86.75 with SMTP id h51mr5315143eez.44.1386822557037; Wed, 11 Dec 2013 20:29:17 -0800 (PST) Original-Received: from [192.168.10.2] (213-241-09.netrun.cytanet.com.cy. [213.7.241.9]) by mx.google.com with ESMTPSA id 44sm61013597eek.5.2013.12.11.20.29.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 20:29:15 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 In-Reply-To: <87vbyuwyyc.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166321 Archived-At: 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!