emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/pyim 35bf05ce3e 19/41: pyim-scheme-common -> pyim-schem


From: ELPA Syncer
Subject: [elpa] externals/pyim 35bf05ce3e 19/41: pyim-scheme-common -> pyim-scheme
Date: Sat, 4 Jun 2022 09:57:46 -0400 (EDT)

branch: externals/pyim
commit 35bf05ce3ee2f713df322ee88d38d16a74edc2de
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    pyim-scheme-common -> pyim-scheme
---
 pyim-codes.el       |  2 +-
 pyim-cregexp.el     |  2 +-
 pyim-cstring.el     |  2 +-
 pyim-liberime.el    |  8 ++++----
 pyim-outcome.el     |  4 ++--
 pyim-process.el     |  6 +++---
 pyim-scheme.el      | 14 +++++++-------
 pyim.el             |  4 ++--
 tests/pyim-tests.el | 14 +++++++-------
 9 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/pyim-codes.el b/pyim-codes.el
index 2f59429411..7c0bc0a277 100644
--- a/pyim-codes.el
+++ b/pyim-codes.el
@@ -65,7 +65,7 @@
 (cl-defmethod pyim-codes-create (imobj (scheme pyim-scheme-xingma) &optional 
first-n)
   "用于处理形码输入法的 `pyim-codes-create' 方法。"
   (when scheme
-    (let ((code-prefix (pyim-scheme-common-code-prefix scheme)))
+    (let ((code-prefix (pyim-scheme-code-prefix scheme)))
       (mapcar
        (lambda (x)
          (concat (or code-prefix "")
diff --git a/pyim-cregexp.el b/pyim-cregexp.el
index 7ecab6a6a4..9140b94ade 100644
--- a/pyim-cregexp.el
+++ b/pyim-cregexp.el
@@ -112,7 +112,7 @@ regexp, 所以搜索单字的时候一般可以搜到生僻字,但搜索句子
 (defun pyim-cregexp-build-1 (str &optional char-level-num chinese-only)
   (let* ((num (pyim-cregexp-char-level-num char-level-num))
          (scheme (pyim-scheme-current))
-         (code-prefix (pyim-scheme-common-code-prefix scheme))
+         (code-prefix (pyim-scheme-code-prefix scheme))
          (sep "#####&&&&#####")
          (lst (remove "" (split-string
                           (replace-regexp-in-string
diff --git a/pyim-cstring.el b/pyim-cstring.el
index 92801c5cbb..c90b78afec 100644
--- a/pyim-cstring.el
+++ b/pyim-cstring.el
@@ -177,7 +177,7 @@ BUG: 当 STRING 中包含其它标点符号,并且设置 SEPERATER 时,结
 返回的形码不包括 code-prefix。当 RETURN-LIST 设置为 t 时,返回一
 个形码 list。"
   (when (string-match-p "^\\cc+\\'" string)
-    (let* ((prefix (pyim-scheme-common-code-prefix scheme))
+    (let* ((prefix (pyim-scheme-code-prefix scheme))
            (dcache-codes
             (mapcar (lambda (x)
                       (when (string-prefix-p prefix x)
diff --git a/pyim-liberime.el b/pyim-liberime.el
index 44135487ab..b573c3c417 100644
--- a/pyim-liberime.el
+++ b/pyim-liberime.el
@@ -47,7 +47,7 @@
 (require 'liberime nil t)
 
 (cl-defstruct (pyim-scheme-rime
-               (:include pyim-scheme-common)
+               (:include pyim-scheme)
                (:constructor pyim-scheme-rime-create)
                (:copier nil))
   "Rime 输入法方案。"
@@ -119,7 +119,7 @@
 
 (cl-defmethod pyim-codes-create (imobj (scheme pyim-scheme-rime) &optional 
first-n)
   (when scheme
-    (let ((code-prefix (pyim-scheme-common-code-prefix scheme)))
+    (let ((code-prefix (pyim-scheme-code-prefix scheme)))
       (mapcar
        (lambda (x)
          (concat (or code-prefix "")
@@ -131,7 +131,7 @@
 (cl-defmethod pyim-candidates-create (imobjs (scheme pyim-scheme-rime))
   "适用于 rime 的 `pyim-candidates-create' 方法。"
   (let* ((code (car (pyim-codes-create (car imobjs) scheme)))
-         (code-prefix (pyim-scheme-common-code-prefix scheme))
+         (code-prefix (pyim-scheme-code-prefix scheme))
          (s (replace-regexp-in-string "-" "" code))
          ;; `liberime-search' 搜索的时候不需要 code-prefix, 去除。
          (s (if code-prefix
@@ -143,7 +143,7 @@
 (cl-defmethod pyim-candidates-create-async (imobjs (scheme pyim-scheme-rime))
   "适用于 rime 的 `pyim-candidates-create-async' 方法。"
   (let* ((code (car (pyim-codes-create (car imobjs) scheme)))
-         (code-prefix (pyim-scheme-common-code-prefix scheme))
+         (code-prefix (pyim-scheme-code-prefix scheme))
          (s (replace-regexp-in-string "-" "" code))
          ;; `liberime-search' 搜索的时候不需要 code-prefix, 去除。
          (s (if code-prefix
diff --git a/pyim-outcome.el b/pyim-outcome.el
index d30434f439..cf8f40a18b 100644
--- a/pyim-outcome.el
+++ b/pyim-outcome.el
@@ -165,8 +165,8 @@ pyim 的 translate-trigger-char 要占用一个键位,为了防止用户
               (char-to-string user-trigger)
             (when (= (length user-trigger) 1)
               user-trigger)))
-         (first-char (pyim-scheme-common-first-chars (pyim-scheme-current)))
-         (prefer-triggers (pyim-scheme-common-prefer-triggers
+         (first-char (pyim-scheme-first-chars (pyim-scheme-current)))
+         (prefer-triggers (pyim-scheme-prefer-triggers
                            (pyim-scheme-current))))
     (if (pyim-string-match-p (regexp-quote user-trigger) first-char)
         (progn
diff --git a/pyim-process.el b/pyim-process.el
index 1ae1463ad6..c7bf898f33 100644
--- a/pyim-process.el
+++ b/pyim-process.el
@@ -243,8 +243,8 @@ entered (nihaom) 的第一个候选词。
 (defun pyim-process-input-chinese-p ()
   "确定 pyim 是否需要启动中文输入模式."
   (let* ((scheme (pyim-scheme-current))
-         (first-chars (pyim-scheme-common-first-chars scheme))
-         (rest-chars (pyim-scheme-common-rest-chars scheme)))
+         (first-chars (pyim-scheme-first-chars scheme))
+         (rest-chars (pyim-scheme-rest-chars scheme)))
     (and (or (pyim-process-force-input-chinese-p)
              (and (not pyim-process-input-ascii)
                   (not (pyim-process-auto-switch-english-input-p))))
@@ -630,7 +630,7 @@ BUG:拼音无法有效地处理多音字。"
     (setq pyim-process-last-created-words
           (cons word (remove word pyim-process-last-created-words)))
     (let* ((scheme (pyim-scheme-current))
-           (code-prefix (pyim-scheme-common-code-prefix scheme))
+           (code-prefix (pyim-scheme-code-prefix scheme))
            (codes (pyim-cstring-to-codes
                    word scheme
                    (or criteria pyim-process-code-criteria))))
diff --git a/pyim-scheme.el b/pyim-scheme.el
index 8d9d2f9d6e..718ad82bae 100644
--- a/pyim-scheme.el
+++ b/pyim-scheme.el
@@ -53,8 +53,8 @@
 (defvar pyim-schemes nil
   "Pyim 支持的所有拼音方案.")
 
-(cl-defstruct (pyim-scheme-common
-               (:constructor pyim-scheme-common-create)
+(cl-defstruct (pyim-scheme
+               (:constructor pyim-scheme-create)
                (:copier nil))
   "输入法方案通用的 slots."
   class
@@ -66,7 +66,7 @@
   prefer-triggers)
 
 (cl-defstruct (pyim-scheme-quanpin
-               (:include pyim-scheme-common)
+               (:include pyim-scheme)
                (:constructor pyim-scheme-quanpin-create)
                (:copier nil))
   "全拼输入法方案类型。")
@@ -82,7 +82,7 @@
   keymaps)
 
 (cl-defstruct (pyim-scheme-xingma
-               (:include pyim-scheme-common)
+               (:include pyim-scheme)
                (:constructor pyim-scheme-xingma-create)
                (:copier nil))
   "形码输入法方案类型。"
@@ -102,7 +102,7 @@
 ;;;###autoload
 (defun pyim-default-scheme (&optional scheme-name)
   (interactive)
-  (let* ((scheme-names (mapcar #'pyim-scheme-common-name pyim-schemes))
+  (let* ((scheme-names (mapcar #'pyim-scheme-name pyim-schemes))
          (scheme-name
           (or scheme-name
               (intern (completing-read "PYIM: 将 pyim-default-scheme 设置为:" 
scheme-names)))))
@@ -125,7 +125,7 @@
         (when (and (symbolp scheme-name)
                    (functionp func))
           (dolist (x pyim-schemes)
-            (push (if (equal (pyim-scheme-common-name x) scheme-name)
+            (push (if (equal (pyim-scheme-name x) scheme-name)
                       (progn (setq update-p t)
                              scheme)
                     x)
@@ -148,7 +148,7 @@
   (when scheme-name
     (cl-find-if
      (lambda (x)
-       (equal (pyim-scheme-common-name x) scheme-name))
+       (equal (pyim-scheme-name x) scheme-name))
      pyim-schemes)))
 
 (pyim-scheme-add
diff --git a/pyim.el b/pyim.el
index b8bdd19416..eda4526175 100644
--- a/pyim.el
+++ b/pyim.el
@@ -748,8 +748,8 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
     (activate-input-method 'pyim))
   (let* ((case-fold-search nil)
          (scheme (pyim-scheme-current))
-         (first-chars (pyim-scheme-common-first-chars scheme))
-         (rest-chars (pyim-scheme-common-rest-chars scheme))
+         (first-chars (pyim-scheme-first-chars scheme))
+         (rest-chars (pyim-scheme-rest-chars scheme))
          (string (if mark-active
                      (buffer-substring-no-properties
                       (region-beginning) (region-end))
diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index 8d97e52113..032e452d7f 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -59,36 +59,36 @@
 ;; ** pyim-schemes 相关单元测试
 (ert-deftest pyim-tests-pyim-schemes ()
   (let ((pyim-default-scheme 'wubi))
-    (should (equal (pyim-scheme-common-name
+    (should (equal (pyim-scheme-name
                     (pyim-scheme-current))
                    'wubi)))
 
   (let ((pyim-default-scheme 'wuci))
-    (should (equal (pyim-scheme-common-name
+    (should (equal (pyim-scheme-name
                     (pyim-scheme-current))
                    'quanpin)))
 
   (let ((pyim-default-scheme 'wubi)
         (pyim-assistant-scheme 'cangjie)
         (pyim-assistant-scheme-enable t))
-    (should (equal (pyim-scheme-common-name
+    (should (equal (pyim-scheme-name
                     (pyim-scheme-current))
                    'cangjie)))
 
   (let ((pyim-default-scheme 'wubi)
         (pyim-assistant-scheme 'cangjie)
         (pyim-assistant-scheme-enable nil))
-    (should (equal (pyim-scheme-common-name
+    (should (equal (pyim-scheme-name
                     (pyim-scheme-current))
                    'wubi)))
 
-  (should (equal (pyim-scheme-common-name
+  (should (equal (pyim-scheme-name
                   (pyim-scheme-get 'quanpin))
                  'quanpin))
 
   (should-not (pyim-scheme-get 'quanpin1))
 
-  (should (equal (pyim-scheme-common-name
+  (should (equal (pyim-scheme-name
                   (pyim-scheme-get 'wubi))
                  'wubi)))
 
@@ -120,7 +120,7 @@
 
     (pyim-scheme-add "error")
 
-    (should (equal (mapcar #'pyim-scheme-common-document pyim-schemes)
+    (should (equal (mapcar #'pyim-scheme-document pyim-schemes)
                    '("test2" "test3")))))
 
 ;; ** pyim-common 相关单元测试



reply via email to

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