From: Lars Ingebrigtsen Date: Mon, 28 Feb 2022 09:30:31 +0000 (+0100) Subject: Don't throw errors while propertizing in sgml-mode X-Git-Tag: emacs-29.0.90~2084 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=15a76160bba87da9cef11c017d90c4e94f37d817;p=emacs.git Don't throw errors while propertizing in sgml-mode * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize): Don't throw an error when propertizing (bug#54195). --- diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 83631e64752..b49541f47d4 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -419,11 +419,11 @@ These have to be run via `sgml-syntax-propertize'")) (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 (or rules-function sgml--syntax-propertize) (point) end) - ;; Catch any '>' after the last quote. - (sgml--syntax-propertize-ppss end)) + (when (>= (cadr sgml--syntax-propertize-ppss) 0) + (sgml-syntax-propertize-inside end) + (funcall (or rules-function sgml--syntax-propertize) (point) end) + ;; Catch any '>' after the last quote. + (sgml--syntax-propertize-ppss end))) (defun sgml-syntax-propertize-inside (end) (let ((ppss (syntax-ppss)))