aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2019-05-15 18:51:30 -0400
committerNoam Postavsky2019-05-15 19:04:14 -0400
commite7e92dc5d24ac3bcde69732bab6a6c3c0d9de97b (patch)
treeb84c65ba64a40bf9f94787f56b8f939c8a938374
parent520aca2d890a051621b730b0a7e97dd07a546df4 (diff)
downloademacs-e7e92dc5d24ac3bcde69732bab6a6c3c0d9de97b.tar.gz
emacs-e7e92dc5d24ac3bcde69732bab6a6c3c0d9de97b.zip
Fix merge of sgml-syntax-propertize-rules
During the merge of emacs-26, the sgml-syntax-propertize-rules part of 2019-01-17 "* lisp/textmodes/sgml-mode.el: Try and fix bug#33887." got lost in the conflict against 2019-05-09 "Recognize single quote attribute values in nxml and sgml (Bug#35381)". * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Reapply the 2019-01-17 change to speed up sgml-syntax-propertize-rules, taking into account the 2019-05-09 which means we have to handle single quotes as well.
-rw-r--r--lisp/textmodes/sgml-mode.el21
1 files changed, 15 insertions, 6 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 6dc1b9e727e..11b30537e67 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -339,12 +339,21 @@ Any terminating `>' or `/' is not matched.")
339 ("--[ \t\n]*\\(>\\)" (1 "> b")) 339 ("--[ \t\n]*\\(>\\)" (1 "> b"))
340 ("\\(<\\)[?!]" (1 (prog1 "|>" 340 ("\\(<\\)[?!]" (1 (prog1 "|>"
341 (sgml-syntax-propertize-inside end)))) 341 (sgml-syntax-propertize-inside end))))
342 ;; Quotes outside of tags should not introduce strings. 342 ;; Quotes outside of tags should not introduce strings which end up
343 ;; Be careful to call `syntax-ppss' on a position before the one we're 343 ;; hiding tags. We used to test every quote and mark it as "."
344 ;; going to change, so as not to need to flush the data we just computed. 344 ;; if it's outside of tags, but there are too many quotes and
345 ("[\"']" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) 345 ;; the resulting number of calls to syntax-ppss made it too slow
346 (goto-char (match-end 0))) 346 ;; (bug#33887), so we're now careful to leave alone any pair
347 (string-to-syntax "."))))))) 347 ;; of quotes that doesn't hold a < or > char, which is the vast majority.
348 ("\\(?:\\(1:\"\\)[^\"<>]*[<>\"]\\|\\(1:'\\)[^'<>]*[<>']\\)"
349 (1 (unless (memq (char-before) '(?\' ?\"))
350 ;; Be careful to call `syntax-ppss' on a position before the one
351 ;; we're going to change, so as not to need to flush the data we
352 ;; just computed.
353 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0))))
354 (goto-char (1- (match-end 0))))
355 (string-to-syntax ".")))))
356 )))
348 357
349(defun sgml-syntax-propertize (start end) 358(defun sgml-syntax-propertize (start end)
350 "Syntactic keywords for `sgml-mode'." 359 "Syntactic keywords for `sgml-mode'."