aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2019-06-04 12:26:52 -0400
committerStefan Monnier2019-06-04 12:26:52 -0400
commitffb7bbdf6824054316a6f63df22eea6d8887bdbd (patch)
tree83077d3a4e85ba3d95b80810a11b312d4da72d21
parentea09b9fe34d2d715bf72a25e3f69ae2baff0b89c (diff)
downloademacs-ffb7bbdf6824054316a6f63df22eea6d8887bdbd.tar.gz
emacs-ffb7bbdf6824054316a6f63df22eea6d8887bdbd.zip
* sgml-mode.el (sgml-syntax-propertize-rules): More verbose comments
-rw-r--r--lisp/textmodes/sgml-mode.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index da25665e62e..0c5d5e56a69 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -368,11 +368,24 @@ Any terminating `>' or `/' is not matched.")
368 ;; if it's outside of tags, but there are too many quotes and 368 ;; if it's outside of tags, but there are too many quotes and
369 ;; the resulting number of calls to syntax-ppss made it too slow 369 ;; the resulting number of calls to syntax-ppss made it too slow
370 ;; (bug#33887), so we're now careful to leave alone any pair 370 ;; (bug#33887), so we're now careful to leave alone any pair
371 ;; of quotes that doesn't hold a < or > char, which is the vast majority. 371 ;; of quotes that doesn't hold a < or > char, which is the vast majority:
372 ;; either they're both within a tag (or a comment), in which case it's
373 ;; indeed correct to leave them as is, or they're both outside of tags, in
374 ;; which case they arguably should have punctuation syntax, but it is
375 ;; harmless to let them have string syntax because they won't "hide" any
376 ;; tag or comment from us (and we use the
377 ;; font-lock-syntactic-face-function to make sure those spurious "strings
378 ;; within text" aren't highlighted as strings).
372 ("\\([\"']\\)[^\"'<>]*" 379 ("\\([\"']\\)[^\"'<>]*"
373 (1 (if (eq (char-after) (char-after (match-beginning 0))) 380 (1 (if (eq (char-after) (char-after (match-beginning 0)))
381 ;; Fast-track case.
374 (forward-char 1) 382 (forward-char 1)
375 ;; Avoid skipping comment ender. 383 ;; Point has moved to the end of the text we matched after the
384 ;; quote, but this risks overlooking a match to one of the other
385 ;; regexp in the rules. We could just (goto-char (match-end 1))
386 ;; to solve this, but that would be too easy, so instead we
387 ;; only move back enough to avoid skipping comment ender, which
388 ;; happens to be the only one that we could have overlooked.
376 (when (eq (char-after) ?>) 389 (when (eq (char-after) ?>)
377 (skip-chars-backward "-")) 390 (skip-chars-backward "-"))
378 ;; Be careful to call `syntax-ppss' on a position before the one 391 ;; Be careful to call `syntax-ppss' on a position before the one