diff options
author | Noam Postavsky <npostavs@gmail.com> | 2019-06-23 21:27:43 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2019-06-25 18:58:23 -0400 |
commit | e62ad04963982ea9cc7622b32484778845bc2ec1 (patch) | |
tree | 70e80f572dce3f269acdf6136278fb29e049cdd9 /lisp/textmodes/sgml-mode.el | |
parent | 06b35b2f922150a11d6b4b5c68a40e9957a69e52 (diff) | |
download | emacs-e62ad04963982ea9cc7622b32484778845bc2ec1.tar.gz emacs-e62ad04963982ea9cc7622b32484778845bc2ec1.tar.bz2 emacs-e62ad04963982ea9cc7622b32484778845bc2ec1.zip |
Fix sgml-mode handling of quotes within parens (Bug#36347)
* lisp/textmodes/sgml-mode.el (sgml-syntax-propertize): Use
syntax-ppss-table if set. This is only needed on the release branch,
on master the caller (syntax-propertize) already does this.
(sgml-mode): Set syntax-ppss-table to sgml-tag-syntax-table. This
correctly classifies parens as punctuation, so they won't confuse the
parser.
* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax):
New test copied from master, with two cases added for this bug.
Diffstat (limited to 'lisp/textmodes/sgml-mode.el')
-rw-r--r-- | lisp/textmodes/sgml-mode.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 128e58810e5..c9724e0e3f7 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -357,10 +357,11 @@ Any terminating `>' or `/' is not matched.") (defun sgml-syntax-propertize (start end) "Syntactic keywords for `sgml-mode'." (goto-char start) - (sgml-syntax-propertize-inside end) - (funcall - (syntax-propertize-rules sgml-syntax-propertize-rules) - start end)) + (with-syntax-table (or syntax-ppss-table (syntax-table)) + (sgml-syntax-propertize-inside end) + (funcall + (syntax-propertize-rules sgml-syntax-propertize-rules) + start end))) (defun sgml-syntax-propertize-inside (end) (let ((ppss (syntax-ppss))) @@ -568,6 +569,7 @@ Do \\[describe-key] on the following bindings to discover what they do. sgml-font-lock-keywords-2) nil t)) (setq-local syntax-propertize-function #'sgml-syntax-propertize) + (setq-local syntax-ppss-table sgml-tag-syntax-table) (setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function) (setq-local sgml-xml-mode (sgml-xml-guess)) (unless sgml-xml-mode |