]> git.eshelyaron.com Git - emacs.git/commitdiff
Make textsec-mixed-numbers-p actually work
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jan 2022 17:50:40 +0000 (18:50 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jan 2022 17:50:40 +0000 (18:50 +0100)
* lisp/international/textsec.el (textsec-mixed-numbers-p): Fix the
test.

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

index 62885ae15daf3f81f2df92779306079d4e1f15df..bf90afb7c0081b7faaee3bfe80f5323484b5bd95 100644 (file)
@@ -169,7 +169,8 @@ Levels are (in decreasing order of restrictiveness) `ascii-only',
     (seq-uniq
      (mapcar
       (lambda (char)
-        (get-char-code-property char 'numeric-value))
+        ;; Compare zeros in the respective decimal systems.
+        (- char (get-char-code-property char 'numeric-value)))
       (seq-filter (lambda (char)
                     ;; We're selecting the characters that
                     ;; have a numeric property.
index 416490aa085f283c44de69b09dde86cf181a14b4..acd779715012c87eff968094d3f640e4f2ce16ca 100644 (file)
@@ -84,6 +84,7 @@
 (ert-deftest test-mixed-numbers ()
   (should-not (textsec-mixed-numbers-p "foo"))
   (should-not (textsec-mixed-numbers-p "8foo8"))
+  (should-not (textsec-mixed-numbers-p "foo20@foo.org"))
   (should (textsec-mixed-numbers-p "8foo৪")))
 
 (ert-deftest test-resolved ()