emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9a74e56: * lisp/textmodes/sgml-mode.el (sgml-syntax


From: Stefan Monnier
Subject: [Emacs-diffs] master 9a74e56: * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Fix typo
Date: Wed, 15 May 2019 22:21:44 -0400 (EDT)

branch: master
commit 9a74e5666b022098c63d0047c0df90c66e1aa64a
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * 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.
---
 lisp/textmodes/sgml-mode.el            | 2 +-
 test/lisp/textmodes/sgml-mode-tests.el | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 11b3053..1b064fb 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -345,7 +345,7 @@ Any terminating `>' or `/' is not matched.")
      ;; the resulting number of calls to syntax-ppss made it too slow
      ;; (bug#33887), so we're now careful to leave alone any pair
      ;; of quotes that doesn't hold a < or > char, which is the vast majority.
-     ("\\(?:\\(1:\"\\)[^\"<>]*[<>\"]\\|\\(1:'\\)[^'<>]*[<>']\\)"
+     ("\\(?:\\(?1:\"\\)[^\"<>]*[<>\"]\\|\\(?1:'\\)[^'<>]*[<>']\\)"
       (1 (unless (memq (char-before) '(?\' ?\"))
            ;; Be careful to call `syntax-ppss' on a position before the one
            ;; 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 4355e1c..a900e8d 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."
       (sgml-quote (point-min) (point-max) t)
       (should (string= "&&" (buffer-string))))))
 
+(ert-deftest sgml-tests--quotes-syntax ()
+  (with-temp-buffer
+    (sgml-mode)
+    (insert "a\"b <tag>c'd</tag>")
+    (should (= 1 (car (syntax-ppss (1- (point-max))))))
+    (should (= 0 (car (syntax-ppss (point-max)))))))
+
 (provide 'sgml-mode-tests)
 ;;; sgml-mode-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]