GNU bug report logs - #49629
27.2; electric-pair-mode doesn't work for angle brackets in HTML file

Previous Next

Package: emacs;

Reported by: Allen Li <darkfeline <at> felesatra.moe>

Date: Sun, 18 Jul 2021 23:53:01 UTC

Severity: normal

Found in version 27.2

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Allen Li <darkfeline <at> felesatra.moe>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 49629 <at> debbugs.gnu.org
Subject: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file
Date: Fri, 24 Dec 2021 02:07:54 -0800
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> 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).
>
> Hmm... I do vaguely remember the change.  I don't see the immediate
> connection, but...

Stefan, I think I found an unrelated regression in your commit and I'd
like to double-check with you (or anyone else reading).

    modified   lisp/textmodes/sgml-mode.el
    @@ -395,16 +395,19 @@ sgml--syntax-propertize-ppss
                             (car (sgml--syntax-propertize-ppss
                                   (match-beginning 0)))))
                    (string-to-syntax ".")))))
    -     )))
    +     )
    +    "Syntax-propertize rules for sgml text.
    +These have to be run via `sgml-syntax-propertize'"))

    -(defun sgml-syntax-propertize (start end)
    +(defconst sgml--syntax-propertize
    +  (syntax-propertize-rules sgml-syntax-propertize-rules))
    +
    +(defun sgml-syntax-propertize (start end &optional rules-function)
       "Syntactic keywords for `sgml-mode'."
       (setq sgml--syntax-propertize-ppss (cons start (syntax-ppss start)))
       (cl-assert (>= (cadr sgml--syntax-propertize-ppss) 0))
       (sgml-syntax-propertize-inside end)
    -  (funcall
    -   (syntax-propertize-rules sgml-syntax-propertize-rules)
    -   start end)
    +  (funcall (or rules-function sgml--syntax-propertize) (point) end)
       ;; Catch any '>' after the last quote.
       (sgml--syntax-propertize-ppss end))

In the final `funcall`, the `start` argument was changed to `(point)`.
Looking at the overall commit, this seems unintentional to me.

Unless this was intentional, I will upload a patch to fix it (this still
exists in master).  Unfortunately, this does not fix the bug I am
interested in, but may as well fix it while I'm here.




This bug report was last modified 3 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.