From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode Date: Wed, 10 Jul 2019 13:24:19 +0100 Message-ID: References: <20190708100539.GD4529@ACM> <20190708164501.GB5244@ACM> <20190708180551.GD5244@ACM> <20190709160022.GC5230@ACM> <20190709182646.GD5230@ACM> <20190710103242.GB4109@ACM> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000068ec78058d52c2e6" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="9643"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Alan Mackenzie , Stefan Monnier , emacs-devel To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 10 14:26:02 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 1hlBfd-0002Nq-Om for ged-emacs-devel@m.gmane.org; Wed, 10 Jul 2019 14:26:01 +0200 Original-Received: from localhost ([::1]:60750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlBfc-0006Hl-PD for ged-emacs-devel@m.gmane.org; Wed, 10 Jul 2019 08:26:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58305) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlBeJ-0006Hc-Va for emacs-devel@gnu.org; Wed, 10 Jul 2019 08:24:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlBeH-0004hO-Gs for emacs-devel@gnu.org; Wed, 10 Jul 2019 08:24:39 -0400 Original-Received: from mail-io1-xd44.google.com ([2607:f8b0:4864:20::d44]:42074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hlBeD-0004cM-MK for emacs-devel@gnu.org; Wed, 10 Jul 2019 08:24:35 -0400 Original-Received: by mail-io1-xd44.google.com with SMTP id u19so4190852ior.9 for ; Wed, 10 Jul 2019 05:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=APfoQbFizvJqF+E7+/AR9veExDP/PrqsVU72NGQmC9A=; b=AeRHd0n0fIc0571nvcLNAISSRp5FBnGZEe4reQlYvVnwi92Q/nY8gPOkgwyiglI16c 2N5s0rZvLwX0uXgQyhc5CbBSTpuoLkMcOi0y6npFYrWTxqUio2OWYEghcIB/3JWBMyyR C7wgOwDLogml66nAdKD+zAKVJWkttjdWcfiWN3phDDsMMbiHU5uavA+iJMCHX23zQeg3 wHhyQTws4DBKxul8XoJ9xPpLotE4fTY7ceBXxR6C0GN5m1ZJDt8gHJ7rSA0q5ZmOFBHh Bglvcz6iidvnrsuxNPo2vPi1RWArA5x5KPJd2czCZHTVNSODj+ubQN+iV6uCLWR2Ktwo eLfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=APfoQbFizvJqF+E7+/AR9veExDP/PrqsVU72NGQmC9A=; b=EDz3bFT3EQ4k95+IcEQXN/dfwfgzBJr0cgz5UJB+5LqgKmX4ag09mKx26Dei5d6g8d VgxCYW4DFj9RHfCXI0XY7DBUozMI0RLOBAb/7YD4P0PKj4a7ADsszEj5il2S1X0aYBHP XwdaZsua4kWzCniGFcEfGxQsXhSMpY7sGpAMcYoo2GjZL8obrqOOyT1Abi39+lchU2ax ognkYV8Z/HNyWrY2mk4POx3ZPP8edhB79EyrN9B+rzHTQSRNKls0/6+C4UfIHH9F1zOm iTZ6vdZ2jxEGvVRVaLBffUwrb2Xy4Yx4EQKGoM0JajDVqi/3avUNXJ8PwWzsUlM6JDe9 LLcA== X-Gm-Message-State: APjAAAVnsWXRE86VymHF6564u8TUqAn1MNbZFgWvNSgBBf6nLd+2atjb VJy6chu9CcSk8h1B3N/KlVr5QlHP3Fk78KC7OAc= X-Google-Smtp-Source: APXvYqyTW4MJgvzKJB8N9ymmYyG6dkNUKxfgWIwqb9PTDDiczfNsfRVU2XkidygNO12QBmYLaNaazaNjutKgzPBEnus= X-Received: by 2002:a02:69d1:: with SMTP id e200mr35231191jac.138.1562761472042; Wed, 10 Jul 2019 05:24:32 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d44 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:238499 Archived-At: --00000000000068ec78058d52c2e6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jul 10, 2019 at 11:41 AM Lars Ingebrigtsen wrote: > > Alan Mackenzie writes: > > > That's fine for users of electric-pair-mode, but that's a minority > > sport. Many, likely most, users don't use that mode. For that > > majority, CC Mode no longer fontifies arbitrarily large pieces of code > > as a string. > > That sounds like a good thing to me. I'd be mostly OK with the purely visual fontification change, but if there is an accompanying change in syntax it breaks some of the tools available to fix the situation, that is a bad thing. > It feels... unfriendly... when Emacs marks most of the buffer as > suddenly invalid when you're just trying to write a string. Sure, and in languages such as elisp or ruby, CC-mode's approach would be useless: you would still see the blinking. In languages such as python and js even more complex to implement (some strings can be multi-line and some not). I do understand the suffering of those that don't use e-p-m. It's one of the reasons that I started using it. But if you don't want to for any reason, I posted a patch to jit-lock.el in the split thread that should reduce if not eliminate the blinking you suffer. I invite you (or anyone) to try it and post feedback. It will work for any major mode, and won't introduce any breakage in the C-M-stuff. Jo=C3=A3o --00000000000068ec78058d52c2e6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jul 10, 2019 at 11:41 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
>= ; Alan Mackenzie <acm@muc.de> write= s:
>
> > That's fine for users of electric-pair-mode, bu= t that's a minority
> > sport.=C2=A0 Many, likely most, users = don't use that mode.=C2=A0 For that
> > majority, CC Mode no l= onger fontifies arbitrarily large pieces of code
> > as a string.<= br>>
> That sounds like a good thing to me.

I'd be mostly OK with the purely visual fontification change, b= ut
if there is an accompanying change in syntax it breaks so= me
of the tools available to fix the situation, that is a ba= d thing.

> It feels... =C2=A0unfriendly... =C2=A0when Emacs= marks most of the buffer as
> suddenly invalid when you're = just trying to write a string.

Sure, and in langua= ges such as elisp or ruby, CC-mode's approach
would be useles= s: you would still see the blinking. In languages
such as py= thon and js even more complex to implement (some
strings can= be multi-line and some not).

I do unde= rstand the suffering of those that don't use e-p-m. It's
= one of the reasons that I started using it.=C2=A0 But if you don't want=
to for any reason, I posted a patch to jit-lock.el in the split = thread
that should=C2=A0 reduce if not eliminate the blinkin= g you suffer.=C2=A0

I invite you (or anyone) = to try it and post feedback. It will work
for any major mode, and= won't introduce any breakage in
the C-M-stuff.

Jo=C3=A3o
--00000000000068ec78058d52c2e6--