]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/char-fold.el: Rename char-fold-make-table to char-fold--make-table.
authorJuri Linkov <juri@linkov.net>
Sun, 28 Jul 2019 22:55:34 +0000 (01:55 +0300)
committerJuri Linkov <juri@linkov.net>
Sun, 28 Jul 2019 22:55:34 +0000 (01:55 +0300)
lisp/char-fold.el
test/lisp/char-fold-tests.el

index b05d37455b9b11681fe37ae97462b42495bf9a1b..d8d2ebc72baf5026f47a9f7f11c5d64c3e9ee5b1 100644 (file)
@@ -44,7 +44,7 @@
 
 \f
 (eval-and-compile
-  (defun char-fold-make-table ()
+  (defun char-fold--make-table ()
     (let* ((equiv (make-char-table 'char-fold-table))
            (equiv-multi (make-char-table 'char-fold-table))
            (table (unicode-property-table-internal 'decomposition)))
 
 (defconst char-fold-table
   (eval-when-compile
-    (char-fold-make-table))
+    (char-fold--make-table))
   "Used for folding characters of the same group during search.
 This is a char-table with the `char-fold-table' subtype.
 
@@ -237,7 +237,7 @@ Exceptionally for the space character (32), ALIST is ignored.")
                    (or (bound-and-true-p char-fold-symmetric)
                        char-fold--default-symmetric))))
     (unless (equal char-fold--previous new)
-      (setq char-fold-table (char-fold-make-table)
+      (setq char-fold-table (char-fold--make-table)
             char-fold--previous new))))
 
 (defcustom char-fold-include char-fold--default-include
index 0efbdcf988c4062f88259cea26f5b2610e22a170..241f7bf16c84d973cb810466c55aa1c1daab91ed 100644 (file)
 (ert-deftest char-fold--test-with-customization ()
   :tags '(:expensive-test)
   ;; FIXME: move some language-specific settings to defaults
-  (let* ((char-fold-include
-          (append char-fold-include
-                  '(
-                    (?o "ø") ;; da no nb nn
-                    (?l "ł") ;; pl
-                    (?æ "ae")
-                    (?→ "->")
-                    (?⇒ "=>")
-                    )))
-         (char-fold-exclude
-          (append char-fold-exclude
-                  '(
-                    (?a "å") ;; da no nb nn sv
-                    (?a "ä") ;; et fi sv
-                    (?o "ö") ;; et fi sv
-                    (?n "ñ") ;; es
-                    )))
-         (char-fold-symmetric t)
-         (char-fold-table (char-fold-make-table))
-         (matches
-          '(
-            ("e" "ℯ" "ḗ" "ë" "ë")
-            ("е" "ё" "ё")
-            ("ι" "ί" "ί" "ΐ")
-            ("ß" "ss")
-            ("o" "ø")
-            ("l" "ł")
-            ("æ" "ae")
-            ("→" "->")
-            ("⇒" "=>")
-            ))
-         (no-matches
-          '(
-            ("a" "å")
-            ("a" "ä")
-            ("o" "ö")
-            ("n" "ñ")
-            ("и" "й")
-            )))
+  (let ((char-fold-include
+         (append char-fold-include
+                 '(
+                   (?o "ø")  ;; da no nb nn
+                   (?l "ł")  ;; pl
+                   (?æ "ae")
+                   (?→ "->")
+                   (?⇒ "=>")
+                   )))
+        (char-fold-exclude
+         (append char-fold-exclude
+                 '(
+                   (?a "å")  ;; da no nb nn sv
+                   (?a "ä")  ;; et fi sv
+                   (?o "ö")  ;; et fi sv
+                   (?n "ñ")  ;; es
+                   )))
+        (char-fold-symmetric t)
+        (matches
+         '(
+           ("e" "ℯ" "ḗ" "ë" "ë")
+           ("е" "ё" "ё")
+           ("ι" "ί" "ί" "ΐ")
+           ("ß" "ss")
+           ("o" "ø")
+           ("l" "ł")
+           ("æ" "ae")
+           ("→" "->")
+           ("⇒" "=>")
+           ))
+        (no-matches
+         '(
+           ("a" "å")
+           ("a" "ä")
+           ("o" "ö")
+           ("n" "ñ")
+           ("и" "й")
+           ))
+        ;; Don't override global value by char-fold-update-table below
+        char-fold-table)
+    (char-fold-update-table)
     (dolist (strings matches)
       (dolist (permutation (char-fold--permutation strings))
         (apply 'char-fold--test-match-exactly permutation)))