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

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

[elpa] externals/pyim 03ad867 1/2: * pyim-cstring.el (pyim-cstring-to-co


From: ELPA Syncer
Subject: [elpa] externals/pyim 03ad867 1/2: * pyim-cstring.el (pyim-cstring-to-codes): test string-distance exist before call it.
Date: Sat, 8 May 2021 04:57:11 -0400 (EDT)

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

    * pyim-cstring.el (pyim-cstring-to-codes): test string-distance exist 
before call it.
---
 pyim-cstring.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pyim-cstring.el b/pyim-cstring.el
index 7a8131e..08cbbdf 100644
--- a/pyim-cstring.el
+++ b/pyim-cstring.el
@@ -367,7 +367,9 @@ code-prefix)。当RETURN-LIST 设置为 t 时,返回一个 code list。"
           ;;拼音使用了多音字校正
           (t (let ((codes (pyim-cstring-to-pinyin string nil "-" t nil t))
                    codes-sorted)
-               (if (< (length criteria) 1)
+               (if (or (< (length criteria) 1)
+                       ;; Emacs 27.1 include `string-distance'.
+                       (not (functionp 'string-distance)))
                    codes
                  ;; 将 所有 codes 与 criteria 字符串比对,选取相似度最高的一个
                  ;; code. 这种处理方式适合拼音输入法。



reply via email to

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