]> git.eshelyaron.com Git - emacs.git/commitdiff
Make textsec-suspicious-nonspacing-p work on marks
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jan 2022 13:42:39 +0000 (14:42 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jan 2022 13:42:39 +0000 (14:42 +0100)
* lisp/international/textsec.el (textsec-suspicious-nonspacing-p):
We're only interested in nonspacing marks, not control characters
in this test.

lisp/international/textsec.el
test/lisp/international/textsec-tests.el

index ebd67e423719e16e5cd45bc78fd18f23f1c1fb55..394da44e9ab891efa394fe6ef46445444b680297 100644 (file)
@@ -310,7 +310,7 @@ consecutive nonspacing characters."
        (lambda (char)
          (let ((nonspacing
                 (memq (get-char-code-property char 'general-category)
-                      '(Cf Cc Mn))))
+                      '(Mn Me))))
            (when (and nonspacing
                       (equal char prev))
              (throw 'found "Two identical consecutive nonspacing characters"))
index aeb8bc7283928421eec4f00f3ab6565177249ea7..817264ec5f91fa33037f788454699648be6828f5 100644 (file)
                "Lars Ingebrigtsen\N{LEFT-TO-RIGHT MARK}"))
 
   (should (textsec-name-suspicious-p
-           "\N{LEFT-TO-RIGHT MARK}\N{LEFT-TO-RIGHT MARK}Lars Ingebrigtsen"))
+           "\N{COMBINING GRAVE ACCENT}\N{COMBINING GRAVE ACCENT}Lars Ingebrigtsen"))
   (should-not (textsec-name-suspicious-p
-               "\N{LEFT-TO-RIGHT MARK}\N{RIGHT-TO-LEFT MARK}Lars Ingebrigtsen"))
+               "\N{COMBINING GRAVE ACCENT}\N{COMBINING ENCLOSING CIRCLE}Lars Ingebrigtsen"))
   (should (textsec-name-suspicious-p
-               "\N{LEFT-TO-RIGHT MARK}\N{RIGHT-TO-LEFT MARK}\N{LEFT-TO-RIGHT MARK}\N{RIGHT-TO-LEFT MARK}\N{LEFT-TO-RIGHT MARK}Lars Ingebrigtsen")))
+               "\N{COMBINING GRAVE ACCENT}\N{COMBINING ENCLOSING CIRCLE}\N{COMBINING GRAVE ACCENT}\N{COMBINING ENCLOSING CIRCLE}\N{COMBINING GRAVE ACCENT}Lars Ingebrigtsen")))
 
 (ert-deftest test-suspicious-email ()
   (should-not