From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: CC Mode and electric-pair "problem". Date: Mon, 18 Jun 2018 17:41:24 -0500 Message-ID: <86d0wng1kb.fsf@stephe-leake.org> References: <20180531123747.GA24752@ACM> <20180617201351.GA4580@ACM> <20180618103654.GA9771@ACM> <20180618154227.GB3973@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1529361580 9875 195.159.176.226 (18 Jun 2018 22:39:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Jun 2018 22:39:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 19 00:39:36 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fV2oB-0002Q4-5G for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2018 00:39:35 +0200 Original-Received: from localhost ([::1]:37135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV2qG-0004OI-97 for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2018 18:41:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV2q6-0004O3-Ow for emacs-devel@gnu.org; Mon, 18 Jun 2018 18:41:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fV2q3-0003Zc-Mc for emacs-devel@gnu.org; Mon, 18 Jun 2018 18:41:34 -0400 Original-Received: from smtp73.iad3b.emailsrvr.com ([146.20.161.73]:60432) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fV2q3-0003Wj-Hl for emacs-devel@gnu.org; Mon, 18 Jun 2018 18:41:31 -0400 Original-Received: from smtp10.relay.iad3b.emailsrvr.com (localhost [127.0.0.1]) by smtp10.relay.iad3b.emailsrvr.com (SMTP Server) with ESMTP id E47DAE006A for ; Mon, 18 Jun 2018 18:41:29 -0400 (EDT) X-Auth-ID: board-president@tomahawk-creek-hoa.com Original-Received: by smtp10.relay.iad3b.emailsrvr.com (Authenticated sender: board-president-AT-tomahawk-creek-hoa.com) with ESMTPSA id B1D13E0063 for ; Mon, 18 Jun 2018 18:41:29 -0400 (EDT) X-Sender-Id: board-president@tomahawk-creek-hoa.com Original-Received: from Takver4 (76-218-37-33.lightspeed.kscymo.sbcglobal.net [76.218.37.33]) (using TLSv1.2 with cipher AES256-GCM-SHA384) by 0.0.0.0:25 (trex/5.7.12); Mon, 18 Jun 2018 18:41:29 -0400 In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vor?= =?utf-8?Q?a=22's?= message of "Mon, 18 Jun 2018 18:01:18 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 146.20.161.73 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:226474 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > Alan Mackenzie writes: > >>> > OK, here goes. Why should major modes tie themselves in knots, just = so >>> > that electric-pair-mode can work? What CC Mode is doing is natural, = and >>> > matches the reality. >> >>> I think you mean "mode", in the singular form :-). >> >> No. CC Mode comprises lots of modes, not all of them maintained by me. >> But even aside from that, CC Mode has often been a pioneer, developing >> new techniques, which the rest of Emacs has then followed. Examples are >> hungry deletion and electric indentation. > > But they are all children of cc-mode.el right? I meant singular as in, > afaik, nobody else independently thought of doing that besides you. For what it's worth, I'm planning on adding "new line terminates string" to ada-mode. As Alan says, that is the way the compiler works. I was initially inspired independently, while working on an error-correcting parser, and found it in cc-mode while looking for ways to implement it. If electric-pair mode wants to support users splitting a string across lines, it should insert " before and after the newline; that's what I would expect from it. For me, it's more common to forget the closing " (possibly due to copy/paste), in which case terminating the string at the new line is more friendly. --=20 -- Stephe