From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode Date: Thu, 4 Jul 2019 16:42:33 +0000 Message-ID: <20190704164233.GE5564@ACM> References: <20190702131632.GA30597@ACM> <20190702160410.GB30597@ACM> <20190702182811.GC30597@ACM> <20190703105804.GA11238@ACM> <20190704152451.GD5564@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="195593"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 04 18:53:20 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hj4z1-000oaQ-JT for ged-emacs-devel@m.gmane.org; Thu, 04 Jul 2019 18:53:19 +0200 Original-Received: from localhost ([::1]:47676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hj4p8-0000FS-Gs for ged-emacs-devel@m.gmane.org; Thu, 04 Jul 2019 12:43:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48894) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hj4oi-0000CZ-DN for emacs-devel@gnu.org; Thu, 04 Jul 2019 12:42:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hj4oh-0007uu-4H for emacs-devel@gnu.org; Thu, 04 Jul 2019 12:42:40 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:25699 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hj4og-0007uA-UR for emacs-devel@gnu.org; Thu, 04 Jul 2019 12:42:39 -0400 Original-Received: (qmail 89535 invoked by uid 3782); 4 Jul 2019 16:42:34 -0000 Original-Received: from acm.muc.de (p4FE15EDB.dip0.t-ipconnect.de [79.225.94.219]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 04 Jul 2019 18:42:33 +0200 Original-Received: (qmail 16019 invoked by uid 1000); 4 Jul 2019 16:42:33 -0000 Content-Disposition: inline In-Reply-To: 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.23 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:238356 Archived-At: Hello, Stefan. On Thu, Jul 04, 2019 at 11:52:32 -0400, Stefan Monnier wrote: > Hi Alan, > > Thanks. That's part of the problem. Another part is that syntax > > fontification will have wrongly fontified the bits beyond the end of the > > invalid string with font-lock-string-face. > We've gone through that several times already. > We don't and can't know if it's wrong or not, because it depends on what > is the error: is there a missing closing " on the line, or should the > newline be preceded by \ ? The error is clear: There is an opening quote without a matching closing quote. The former part of the error is at the opening quote, so we must indicate its position somehow, most simply by marking it with warning-face. The latter part of the error happens at the first unescaped EOL; this is what defines the string as invalid. We must indicate this position as well, and the best way of doing this is terminating the string-face at that position. It is not arbitrary. We are not trying to guess the intention of the user; we are pointing out the objective error. [ .... ] > Stefan -- Alan Mackenzie (Nuremberg, Germany).