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: Sat, 2 Jun 2018 13:02:28 +0000 Message-ID: <20180602130228.GB4392@ACM> References: <20180531123747.GA24752@ACM> <87bmcvbygg.fsf@gmail.com> <20180531172841.GB24752@ACM> <8736y7brj1.fsf@gmail.com> 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 1527944646 12119 195.159.176.226 (2 Jun 2018 13:04:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Jun 2018 13:04:06 +0000 (UTC) User-Agent: Mutt/1.9.4 (2018-02-28) Cc: 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 Sat Jun 02 15:04:02 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 1fP6CP-00030D-3K for ged-emacs-devel@m.gmane.org; Sat, 02 Jun 2018 15:04:01 +0200 Original-Received: from localhost ([::1]:59822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fP6EW-00082r-16 for ged-emacs-devel@m.gmane.org; Sat, 02 Jun 2018 09:06:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fP6EP-00082X-4T for emacs-devel@gnu.org; Sat, 02 Jun 2018 09:06:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fP6EL-0007cT-TR for emacs-devel@gnu.org; Sat, 02 Jun 2018 09:06:05 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:51316 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1fP6EL-0007Z0-H9 for emacs-devel@gnu.org; Sat, 02 Jun 2018 09:06:01 -0400 Original-Received: (qmail 68045 invoked by uid 3782); 2 Jun 2018 13:05:59 -0000 Original-Received: from acm.muc.de (p5B1464B2.dip0.t-ipconnect.de [91.20.100.178]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 02 Jun 2018 15:05:59 +0200 Original-Received: (qmail 6857 invoked by uid 1000); 2 Jun 2018 13:02:28 -0000 Content-Disposition: inline In-Reply-To: <8736y7brj1.fsf@gmail.com> 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:225921 Archived-At: Hello, Joćo. On Thu, May 31, 2018 at 19:37:22 +0100, Joćo Tįvora wrote: > Alan Mackenzie writes: > > Hello, Joćo > > > > On Thu, May 31, 2018 at 17:07:43 +0100, Joćo Tįvora wrote: [ .... ] > > Yes. A string in C(++) mode extending over several lines is only > > valid when the newlines are escaped. The generic string syntax is > > partly an artifice to get font-lock-warning-face, but is also > > deliberately intended to cut the opener of the invalid string off > > from any subsequent double quote. > But is there another goal here, apart from the goal of visually > annotating the error? Well, "error" might be putting it a bit strongly. Mainly, it's a reminder to somebody typing in a string to close it off properly. > If the intent is only to annotate the error visually, I'd rather leave > that to something like Flymake. Admiteddly, it's not practical now, > since Flymake usually works by running the whole buffer through an > external syntax check tool, which may take ages compared to using syntax > hints from within emacs. > But that could be changed, my goal is to let Flymake call backends with > only recently changed parts of the buffer, and a much faster > syntax-checking backend could be devised. All I can reply with, at the moment, is ... Hmmmm. :-) > Which reminds me, I never did get an answer to > https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00448.html > did I? No, but you've got one now. :-) > > OK. I'll need to mull this over. > OK, do. If you come to the conclusion that it is very important, and > when the code becomes stable, I can can increase the complexity of > elec-pair.el a bit to make it work in c++-mode. I think the increase in complexity would be quite small, and very local. > BTW do all cc-based modes "forbid" multi-line strings? No. Pike Mode has a special feature whereby a string starting with #" is a multiline string. I think in D Mode (not maintained here), strings simply are multiline, and there is no such thing as an escaped EOL. The writer of the mode sets the CC Mode "language variable" c-multiline-string-start-char to the character # for Pike Mode, or some non-character non-nil value for D Mode (usually t, of course). [ .... ] > Joćo -- Alan Mackenzie (Nuremberg, Germany).