From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: [patch] make electric-pair-mode smarter/more useful Date: Thu, 12 Dec 2013 03:05:47 +0000 Message-ID: <87vbyuwyyc.fsf@gmail.com> References: <87haalh806.fsf@gmail.com> <87d2l9wfne.fsf@yandex.ru> <87fvq49xzp.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1386817639 29278 80.91.229.3 (12 Dec 2013 03:07:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Dec 2013 03:07:19 +0000 (UTC) Cc: Dmitry Gutov , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 12 04:07:24 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 1VqwcU-0000Pq-Sx for ged-emacs-devel@m.gmane.org; Thu, 12 Dec 2013 04:07:23 +0100 Original-Received: from localhost ([::1]:33034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqwcU-0003Te-Cb for ged-emacs-devel@m.gmane.org; Wed, 11 Dec 2013 22:07:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqwcM-0003TK-H5 for emacs-devel@gnu.org; Wed, 11 Dec 2013 22:07:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqwcH-0000uy-Gs for emacs-devel@gnu.org; Wed, 11 Dec 2013 22:07:14 -0500 Original-Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:40334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqwcH-0000uq-9S for emacs-devel@gnu.org; Wed, 11 Dec 2013 22:07:09 -0500 Original-Received: by mail-wg0-f46.google.com with SMTP id m15so7258994wgh.25 for ; Wed, 11 Dec 2013 19:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=JQAx245qqNSLeHEOxHWimlDKjH3TQoLt1ZiQzPzF4Ww=; b=RR/BqjUkjSL/l4+eJ3YbdFaxNT6Nm6F3pEwJh/3KPc695FCAsE05LK1Q0psKuEF6BS 3kLmmArTusM3olxdev9UKp3slaPtVtfjqOCpwrA8QgkckLk7d5J4gplqxbyE8Zbf1B6r y1AgVgb24LwBErhVtB2PwMjK+/jEfweCOw1TQscg2rPMGckPO1/6Zk6rgJKmD++8s+5B Q5cVelCksv9tu1VaRtvwlZ2t7kyuTemzmDDrl4svoLO+MgRgBYx4057sKr0V2y+MZcD9 IfNMJ9PSLGMdB6i1EN8t26Ew1XxmcA9Dr9FXpbFTZEDlOkxu6V9cUzBBlO2olZRs54yq NF+g== X-Received: by 10.180.14.134 with SMTP id p6mr27072143wic.6.1386817628505; Wed, 11 Dec 2013 19:07:08 -0800 (PST) Original-Received: from kitaj.yourcompany.com (66.207.108.93.rev.vodafone.pt. [93.108.207.66]) by mx.google.com with ESMTPSA id cx3sm572721wib.0.2013.12.11.19.07.06 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Dec 2013 19:07:07 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Sat, 07 Dec 2013 18:16:47 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22e 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:166315 Archived-At: Stefan Monnier writes: > We could remap backward-delete-char-untabify in > electric-pair-mode-map. Thanks, I did that and it seems to work OK. >>> I'm also partial to the `autopair-newline' feature. It would probably >>> serve best as an extension of `electric-layout-mode'. >> Yes, I agree that `electric-layout-mode' seems the place for this, but >> how to write these rules in the existing `electric-layout-rules' var? > > Indeed, it doesn't really fit in there. You could probably hack it in > brute-force style by adding the newline directly from > electric-layout-in-between-parenthesis (and then return nil rather than > `after'). 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. > Patch welcome. Patch sent. >> - additionally one should be able to customize if points ends up >> inside or outside the wrapped region. > > I don't see a strong need for such customization, but I wouldn't > object. Yeah, its overkill. Someone once requested it for autopair. Maybe I can add it.. Jo=C3=A3o