From b4336b2832cad22603f14f114d97abd95bdccc8c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 19 Jan 2022 14:42:39 +0100 Subject: [PATCH] Make textsec-suspicious-nonspacing-p work on marks * 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 | 2 +- test/lisp/international/textsec-tests.el | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/international/textsec.el b/lisp/international/textsec.el index ebd67e42371..394da44e9ab 100644 --- a/lisp/international/textsec.el +++ b/lisp/international/textsec.el @@ -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")) diff --git a/test/lisp/international/textsec-tests.el b/test/lisp/international/textsec-tests.el index aeb8bc72839..817264ec5f9 100644 --- a/test/lisp/international/textsec-tests.el +++ b/test/lisp/international/textsec-tests.el @@ -138,11 +138,11 @@ "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 -- 2.39.2