From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode Date: Tue, 09 Jul 2019 13:11:51 -0400 Message-ID: References: <20190704165846.GF5564@ACM> <20190704190100.GG5564@ACM> <20190708100539.GD4529@ACM> <20190708164501.GB5244@ACM> <20190708180551.GD5244@ACM> <20190709160022.GC5230@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="214396"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: =?windows-1252?B?Sm/jbyBU4XZvcmE=?= , emacs-devel To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 09 19:13:45 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 1hktgV-000tXl-UZ for ged-emacs-devel@m.gmane.org; Tue, 09 Jul 2019 19:13:44 +0200 Original-Received: from localhost ([::1]:52212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hktgU-0008Hg-Vs for ged-emacs-devel@m.gmane.org; Tue, 09 Jul 2019 13:13:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52330) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkteq-0007G2-Do for emacs-devel@gnu.org; Tue, 09 Jul 2019 13:12:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hktep-0001mv-F1 for emacs-devel@gnu.org; Tue, 09 Jul 2019 13:12:00 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:65077) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hktep-0001lA-74 for emacs-devel@gnu.org; Tue, 09 Jul 2019 13:11:59 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DCF9D80D6B; Tue, 9 Jul 2019 13:11:57 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 565E580A46; Tue, 9 Jul 2019 13:11:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1562692315; bh=WHQA3aL3a3VyEd/2TlD2ZIaUr5aqruOb1FDUBFoXkt8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=E56+BBBjIuapO2MljDO1mJp8l+IebeIAjiibH4vAUHiR/m0QPvIPwFXlTfqC9NQNt +6nkldvDTD8iqx0Widgko7aqYFk6dqXb87idsERi2mndoEe91HbfOdsM6lF3oahzl7 IVww5l8DWE5BRUcBdVcFrlv5xLveLosEJtpIHoqmoxDpDa8sLNNVCuXp5Ltx4pLP3J i3jtK/wa+NxstMi6H0NoSK7h+O1n/FjXKM8420S249bu3/vVsLRjqkvz2kntC0KCEA 7RbbP8UhJMijiORmBcnhke4XFmnUqur1508O3VnA3fvqvaFo2HTnY+EdnZW3hAseSg rxqL+L8z8p0aw== Original-Received: from alfajor (76-10-138-228.dsl.teksavvy.com [76.10.138.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 795881201D0; Tue, 9 Jul 2019 13:11:53 -0400 (EDT) In-Reply-To: <20190709160022.GC5230@ACM> (Alan Mackenzie's message of "Tue, 9 Jul 2019 16:00:22 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:238470 Archived-At: >> Both are wrong sometimes and right at other times. > Not really. Yes, really. Depending on your usage pattern one will be more frequent than the other. Maybe in your usage pattern the second almost never happens, but that's definitely not the case in general. > The overwhelmingly most common use case is typing in a > short string which fits on one line, when the next line is (almost) > always a line of code. It is not sensible to fontify arbitrarily large > pieces of code as a string, just because the user hasn't yet reached her > closing double quote. You can't know that "the user hasn't yet reached her closing double quote". > It is not up to the major mode to second guess the user. On that we agree. > It is the major mode's job to indicate the presence and position of an > error as clearly as possible. The error is on the first line of the string and it's indeed good to highlight it (and font-lock.el should probably provide support for that). What happens with the subsequent lines is a completely different question. > CC Mode's fontification does this. Yes, that's good (on the first line). Stefan