From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [patch] make electric-pair-mode smarter/more useful Date: Sat, 07 Dec 2013 18:16:47 -0500 Message-ID: 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 X-Trace: ger.gmane.org 1386458223 24402 80.91.229.3 (7 Dec 2013 23:17:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Dec 2013 23:17:03 +0000 (UTC) Cc: emacs-devel@gnu.org, Dmitry Gutov To: joaotavora@gmail.com (=?windows-1252?B?Sm/jbyBU4XZvcmE=?=) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 08 00:17:08 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 1VpR7S-0001T8-M8 for ged-emacs-devel@m.gmane.org; Sun, 08 Dec 2013 00:17:06 +0100 Original-Received: from localhost ([::1]:37706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpR7S-0003LP-8K for ged-emacs-devel@m.gmane.org; Sat, 07 Dec 2013 18:17:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpR7I-0003LA-8x for emacs-devel@gnu.org; Sat, 07 Dec 2013 18:17:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpR7A-0003yw-UW for emacs-devel@gnu.org; Sat, 07 Dec 2013 18:16:56 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:48518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpR7A-0003yS-QJ for emacs-devel@gnu.org; Sat, 07 Dec 2013 18:16:48 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFLd/UW/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAs0EhQYDYhCBsEtkQoDiGGcGYFegxU X-IPAS-Result: Av4EABK/CFFLd/UW/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAs0EhQYDYhCBsEtkQoDiGGcGYFegxU X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="41409242" Original-Received: from 75-119-245-22.dsl.teksavvy.com (HELO pastel.home) ([75.119.245.22]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 07 Dec 2013 18:16:48 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 0061E60078; Sat, 7 Dec 2013 18:16:47 -0500 (EST) In-Reply-To: <87fvq49xzp.fsf@gmail.com> (=?windows-1252?Q?=22Jo=E3o_T=E1vo?= =?windows-1252?Q?ra=22's?= message of "Sat, 07 Dec 2013 21:01:30 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:166192 Archived-At: >> Autobackspacing two adjacent parens sounds good. > How should one approach this in electric.el? Should a hook be added to > `backward-delete-char-untabify`? Should this be included in the > `electric-layout-mode' somehow? We could remap backward-delete-char-untabify in electric-pair-mode-map. >> 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'). > - both openers and closers should cause a wrap (currently only > openers do). A closer should move point to after the wrapping. Patch welcome. > - 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. Stefan