aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2019-05-15 22:21:36 -0400
committerStefan Monnier2019-05-15 22:21:36 -0400
commit9a74e5666b022098c63d0047c0df90c66e1aa64a (patch)
treea9d16e63deaf424dde86a05842343017447c0a1e
parente7e92dc5d24ac3bcde69732bab6a6c3c0d9de97b (diff)
downloademacs-9a74e5666b022098c63d0047c0df90c66e1aa64a.tar.gz
emacs-9a74e5666b022098c63d0047c0df90c66e1aa64a.zip
* lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Fix typo
* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax): New corresponding test.
-rw-r--r--lisp/textmodes/sgml-mode.el2
-rw-r--r--test/lisp/textmodes/sgml-mode-tests.el7
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 11b30537e67..1b064fb825f 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -345,7 +345,7 @@ Any terminating `>' or `/' is not matched.")
345 ;; the resulting number of calls to syntax-ppss made it too slow 345 ;; the resulting number of calls to syntax-ppss made it too slow
346 ;; (bug#33887), so we're now careful to leave alone any pair 346 ;; (bug#33887), so we're now careful to leave alone any pair
347 ;; of quotes that doesn't hold a < or > char, which is the vast majority. 347 ;; of quotes that doesn't hold a < or > char, which is the vast majority.
348 ("\\(?:\\(1:\"\\)[^\"<>]*[<>\"]\\|\\(1:'\\)[^'<>]*[<>']\\)" 348 ("\\(?:\\(?1:\"\\)[^\"<>]*[<>\"]\\|\\(?1:'\\)[^'<>]*[<>']\\)"
349 (1 (unless (memq (char-before) '(?\' ?\")) 349 (1 (unless (memq (char-before) '(?\' ?\"))
350 ;; Be careful to call `syntax-ppss' on a position before the one 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 351 ;; we're going to change, so as not to need to flush the data we
diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el
index 4355e1c8658..a900e8dcf22 100644
--- a/test/lisp/textmodes/sgml-mode-tests.el
+++ b/test/lisp/textmodes/sgml-mode-tests.el
@@ -160,5 +160,12 @@ The point is set to the beginning of the buffer."
160 (sgml-quote (point-min) (point-max) t) 160 (sgml-quote (point-min) (point-max) t)
161 (should (string= "&&" (buffer-string)))))) 161 (should (string= "&&" (buffer-string))))))
162 162
163(ert-deftest sgml-tests--quotes-syntax ()
164 (with-temp-buffer
165 (sgml-mode)
166 (insert "a\"b <tag>c'd</tag>")
167 (should (= 1 (car (syntax-ppss (1- (point-max))))))
168 (should (= 0 (car (syntax-ppss (point-max)))))))
169
163(provide 'sgml-mode-tests) 170(provide 'sgml-mode-tests)
164;;; sgml-mode-tests.el ends here 171;;; sgml-mode-tests.el ends here