From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file Date: Thu, 9 Dec 2021 10:31:08 +0000 Message-ID: References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000065890a05d2b41b33" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31750"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49629@debbugs.gnu.org, monnier@iro.umontreal.ca To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 09 11:34:01 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvGkS-000848-Rq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Dec 2021 11:34:01 +0100 Original-Received: from localhost ([::1]:44076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvGkR-00043T-Ph for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Dec 2021 05:33:59 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvGiZ-0001Cd-31 for bug-gnu-emacs@gnu.org; Thu, 09 Dec 2021 05:32:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvGiY-0005jA-N7 for bug-gnu-emacs@gnu.org; Thu, 09 Dec 2021 05:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mvGiY-00028W-G4 for bug-gnu-emacs@gnu.org; Thu, 09 Dec 2021 05:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Dec 2021 10:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49629 X-GNU-PR-Package: emacs Original-Received: via spool by 49629-submit@debbugs.gnu.org id=B49629.16390458888170 (code B ref 49629); Thu, 09 Dec 2021 10:32:02 +0000 Original-Received: (at 49629) by debbugs.gnu.org; 9 Dec 2021 10:31:28 +0000 Original-Received: from localhost ([127.0.0.1]:42520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvGhz-00027i-Gx for submit@debbugs.gnu.org; Thu, 09 Dec 2021 05:31:27 -0500 Original-Received: from mail-ua1-f47.google.com ([209.85.222.47]:44689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvGhw-00027R-UY for 49629@debbugs.gnu.org; Thu, 09 Dec 2021 05:31:26 -0500 Original-Received: by mail-ua1-f47.google.com with SMTP id p2so9790495uad.11 for <49629@debbugs.gnu.org>; Thu, 09 Dec 2021 02:31:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VHc71by0Ylpfhy7gRzi28IyR/+rnExgGv4T25UQXozY=; b=va70MppzolOI0mNBpfk1UzonqARRAMozYPkahaxOSYST2Ke1esPOUdpvpU7Mlge0pT w+kXZ/PrJqdIRAg6yhlNmPlGyB5WJJuSXhpA/tjZ5ZBeQic0O7a9Zf0RRDk+4EO99/g3 IDnOGm9lWB1SB6JdmMmURjxBd2cg6kFncPvwCE/8JmsWlxRVRWnQ92h4GSMtPQt9etGO o62x0IP2iIezl8WEaUDyYmclhAnODxRH0sC85ZOuWT8lvmRkOq6e/v1fuRtnNqhHw9tY cwB3zbft5brtyh8G45M2LVsK+4HNuHZtPwBUJzl2HSUdOgoFctAlSfqtFni51fjqOeWp ch3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VHc71by0Ylpfhy7gRzi28IyR/+rnExgGv4T25UQXozY=; b=0VeWe3wzJ9hLsiqACg6Os1ptHFVdWPfOVzLLdJ6aOUQbPmHIC5rP9KPEl26tSlvSx+ c+rab02iohSZeGWN0+mK5nAEJnArshCmU1YfNM/b1LUtj2PO9W3bSDrNYdtaVZLx43SM DCfM9ylPtgRDOaBVZAOeCjeEEKat7JzFgbDOQ9EB7jZu2SwN+/EII75fwn6IhMokQ2G7 6bHM5H91Ow6Diu5jihrTqFjzTf/aht0nY1B/01VdzkwaYZ/U4gb4ZhHCleOOBlLefaWI TcoGbOxUsjZh46b/zrYwFdLUKtn01cgAi5AEBXkRXTc2dQTmz+GotfjX9GIaz43W8+Y0 Grww== X-Gm-Message-State: AOAM533lScDRbErg8vOSRt5eVsluLOdad4Ynx5R9/MR2JDAYkVsw5MNU Ry4o9F++8H1f0ZSODGo1zep9bu+Yng22bF++PQll+yevip7zmA== X-Google-Smtp-Source: ABdhPJw5CXkXFIJKdkjsL/gvAZCiAwEj+xehwAf6L9nlmTPD2KR8wgwLIt2b1Urw/VwV6M07awZTvsj+w38O4/17zzM= X-Received: by 2002:ab0:2616:: with SMTP id c22mr17879709uao.6.1639045879133; Thu, 09 Dec 2021 02:31:19 -0800 (PST) In-Reply-To: <87tuk978gm.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221994 Archived-At: --00000000000065890a05d2b41b33 Content-Type: text/plain; charset="UTF-8" I have bisected this regression to 7fff418edf56244a1fcf54718523aa9b5cb3a854 I will cc Stefan on the miniscule chance he still remembers anything about this and can save me time. Otherwise, I will see if I can pinpoint the regression (or if I messed up the bisect). Author: Stefan Monnier Date: Fri Nov 29 11:51:48 2019 -0500 * lisp/textmodes/mhtml-mode.el: Fix bug#38372 The `sgml-syntax-propertize-rules` rely on the `sgml--syntax-propertize-ppss` setup by `sgml-syntax-propertize` so it is not correct/safe to use them directly like html used to do. Change `sgml-syntax-propertize` so it can be used by mhtml, and then adjust mhtml-mode accordingly. * lisp/textmodes/mhtml-mode.el: Remove redundant `eval-and-compile`. Only require cl-lib at compile-time. (mhtml--syntax-propertize): New const, extracted from mhtml-syntax-propertize. (mhtml-syntax-propertize): Use `sgml-syntax-propertize`. * lisp/textmodes/sgml-mode.el (sgml--syntax-propertize): New const, extracted from sgml-syntax-propertize. (sgml-syntax-propertize): Add optional `rules-function` arg. lisp/textmodes/mhtml-mode.el | 44 ++++++++++++++++++++------------------------ lisp/textmodes/sgml-mode.el | 13 ++++++++----- 2 files changed, 28 insertions(+), 29 deletions(-) On Sun, Aug 1, 2021 at 10:41 AM Lars Ingebrigtsen wrote: > Allen Li writes: > > > Thus, I resorted to actually trying to understand the code. > > Darn, I hate it when that happens. > > > I've tracked down the bug to unexpected behavior from the `scan-sexps` > > call in this part of `electric-pair--balance-info`: > > I can reproduce exactly what you're seeing -- when edebugging, the > problem goes away, etc. > > I put a > > (redisplay t) > > into the function, and that also made the problem go away, but that's as > far as I've gotten so far. So the problem does indeed seem to be > something related to a cache/table somewhere not having been updated... > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --00000000000065890a05d2b41b33 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have bisected this regression to=C2=A07fff418edf562= 44a1fcf54718523aa9b5cb3a854

I will cc Stefan on th= e miniscule chance he still remembers anything about this and can save me t= ime.
Otherwise, I will see if I can pinpoint the regression (or i= f I messed up the bisect).

Author: Stefan Monnier = <monnier@iro.umontreal.ca>
Date: =C2=A0 Fri Nov 29 11:51:48 2019 -0500
=C2=A0 =C2=A0 * lis= p/textmodes/mhtml-mode.el: Fix bug#38372
=C2=A0 =C2=A0
=C2=A0 =C2=A0= The `sgml-syntax-propertize-rules` rely on the `sgml--syntax-propertize-pp= ss`
=C2=A0 =C2=A0 setup by `sgml-syntax-propertize` so it is not correct= /safe to use
=C2=A0 =C2=A0 them directly like html used to do.
=C2=A0= =C2=A0
=C2=A0 =C2=A0 Change `sgml-syntax-propertize` so it can be used= by mhtml,
=C2=A0 =C2=A0 and then adjust mhtml-mode accordingly.
=C2= =A0 =C2=A0
=C2=A0 =C2=A0 * lisp/textmodes/mhtml-mode.el: Remove redunda= nt `eval-and-compile`.
=C2=A0 =C2=A0 Only require cl-lib at compile-time= .
=C2=A0 =C2=A0 (mhtml--syntax-propertize): New const, extracted from mh= tml-syntax-propertize.
=C2=A0 =C2=A0 (mhtml-syntax-propertize): Use `sgm= l-syntax-propertize`.
=C2=A0 =C2=A0
=C2=A0 =C2=A0 * lisp/textmodes/s= gml-mode.el (sgml--syntax-propertize): New const,
=C2=A0 =C2=A0 extracte= d from sgml-syntax-propertize.
=C2=A0 =C2=A0 (sgml-syntax-propertize): A= dd optional `rules-function` arg.
=C2=A0lisp/textmodes/mhtml-mode.el | 4= 4 ++++++++++++++++++++------------------------
=C2=A0lisp/textmodes/sgml= -mode.el =C2=A0| 13 ++++++++-----
=C2=A02 files changed, 28 insertions(+= ), 29 deletions(-)

<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Allen Li <darkfeline@fe= lesatra.moe> writes:

> Thus, I resorted to actually trying to understand the code.

Darn, I hate it when that happens.

> I've tracked down the bug to unexpected behavior from the `scan-se= xps`
> call in this part of `electric-pair--balance-info`:

I can reproduce exactly what you're seeing -- when edebugging, the
problem goes away, etc.

I put a

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (redisplay t)

into the function, and that also made the problem go away, but that's a= s
far as I've gotten so far.=C2=A0 So the problem does indeed seem to be<= br> something related to a cache/table somewhere not having been updated...

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--00000000000065890a05d2b41b33--