[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in H
From: |
Stefan Monnier |
Subject: |
bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file |
Date: |
Fri, 24 Dec 2021 09:23:06 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
> -(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.
No, this was intentional: `start` is used by passing it to
`syntax-ppss` which will move point to `start`. After that some of the
text may/will be handled by `sgml-syntax-propertize-inside` which
indicates it by moving point past the part that it handled (if any) and
the (or rules-function sgml--syntax-propertize) should only apply to the
remaining part.
Stefan