aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorNoam Postavsky2019-05-26 11:07:14 -0400
committerNoam Postavsky2019-06-04 08:42:50 -0400
commit438e4804d107720f526d0c7c367cbd029f264676 (patch)
tree3b8a3561bc86f6a67a65d918c1f064e21445cbd0 /lisp
parent7aaf500701be3b51c686b7d86c9b505ef5fa9b8f (diff)
downloademacs-438e4804d107720f526d0c7c367cbd029f264676.tar.gz
emacs-438e4804d107720f526d0c7c367cbd029f264676.zip
Fix some SGML syntax edge cases (Bug#33887)
* lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Handle single and double quotes symmetrically. Don't skip quoted comment enders. * test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax): Add more test cases. (sgml-mode-quote-in-long-text): New test.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/sgml-mode.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 75f20722b05..1df7e78afc5 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -363,9 +363,12 @@ Any terminating `>' or `/' is not matched.")
363 ;; the resulting number of calls to syntax-ppss made it too slow 363 ;; the resulting number of calls to syntax-ppss made it too slow
364 ;; (bug#33887), so we're now careful to leave alone any pair 364 ;; (bug#33887), so we're now careful to leave alone any pair
365 ;; of quotes that doesn't hold a < or > char, which is the vast majority. 365 ;; of quotes that doesn't hold a < or > char, which is the vast majority.
366 ("\\(?:\\(?1:\"\\)[^\"<>]*\\|\\(?1:'\\)[^'\"<>]*\\)" 366 ("\\([\"']\\)[^\"'<>]*"
367 (1 (if (eq (char-after) (char-after (match-beginning 0))) 367 (1 (if (eq (char-after) (char-after (match-beginning 0)))
368 (forward-char 1) 368 (forward-char 1)
369 ;; Avoid skipping comment ender.
370 (when (eq (char-after) ?>)
371 (skip-chars-backward "-"))
369 ;; Be careful to call `syntax-ppss' on a position before the one 372 ;; Be careful to call `syntax-ppss' on a position before the one
370 ;; we're going to change, so as not to need to flush the data we 373 ;; we're going to change, so as not to need to flush the data we
371 ;; just computed. 374 ;; just computed.