From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: CC Mode and electric-pair "problem". Date: Tue, 26 Jun 2018 18:52:35 +0000 Message-ID: <20180626185235.GC4464@ACM> References: <20180531123747.GA24752@ACM> <20180617201351.GA4580@ACM> <20180618103654.GA9771@ACM> <20180618154227.GB3973@ACM> <20180619050244.GA3946@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1530039587 4071 195.159.176.226 (26 Jun 2018 18:59:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Jun 2018 18:59:47 +0000 (UTC) User-Agent: Mutt/1.9.4 (2018-02-28) Cc: Glenn Morris , Emacs developers , Tino Calancha To: =?iso-8859-1?Q?Jo=E3o_T=E1vora?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 26 20:59:43 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 1fXtBm-0000yX-QW for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2018 20:59:42 +0200 Original-Received: from localhost ([::1]:54644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXtDu-0006Ga-BI for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2018 15:01:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXtDD-0006Fo-Jw for emacs-devel@gnu.org; Tue, 26 Jun 2018 15:01:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXtDA-0003A6-B3 for emacs-devel@gnu.org; Tue, 26 Jun 2018 15:01:11 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:10988 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1fXtDA-00039W-4Q for emacs-devel@gnu.org; Tue, 26 Jun 2018 15:01:08 -0400 Original-Received: (qmail 65820 invoked by uid 3782); 26 Jun 2018 19:01:06 -0000 Original-Received: from acm.muc.de (p5B1471C9.dip0.t-ipconnect.de [91.20.113.201]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 26 Jun 2018 21:01:05 +0200 Original-Received: (qmail 28539 invoked by uid 1000); 26 Jun 2018 18:52:35 -0000 Content-Disposition: inline In-Reply-To: <20180619050244.GA3946@ACM> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:226749 Archived-At: Hello, Joćo. On Tue, Jun 19, 2018 at 05:02:44 +0000, Alan Mackenzie wrote: > On Mon, Jun 18, 2018 at 18:01:18 +0100, Joćo Tįvora wrote: > [ .... ] > Maybe we're looking at this the wrong way. > How about this idea: we add a new syntax flag to Emacs, ", which > terminates any open string, the same way the syntax > terminates any > open comment. We could then set this syntax flag on newline. This isn't a sensible idea. because it wouldn't solve any of the problems we have with the string-fence syntax. Instead, maybe we should add a new syntactic symbol to Emacs, "one-line string quote". A string opened by such a delimiter would be terminated either by the same quote again, or a newline. This would have the advantage of making fontification easy, whilst still allowing syntactic operations within an invalid string. For example, in char *foo = "( )" , the "s would have "one-line string quote" syntax and be fontified with warning face, but a C-M-n from the ( would still move point to after the ), and all the electric-pair-mode stuff would still work. > This would have the disadvantage (for CC Mode) that it wouldn't work > with older Emacsen. But it might solve the various problems we've > stumbled over in the last few days. This paragraph would still hold. > > Joćo -- Alan Mackenzie (Nuremberg, Germany).