[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 7c75e04a0c 2/2: Set fallback pyim-page-info-format
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 7c75e04a0c 2/2: Set fallback pyim-page-info-format method. |
Date: |
Sat, 4 Jun 2022 19:57:47 -0400 (EDT) |
branch: externals/pyim
commit 7c75e04a0cd1aadb521268750b433181fc084bf6
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Set fallback pyim-page-info-format method.
* tests/pyim-tests.el (pyim-tests-pyim-page-info-format): update.
* pyim-page.el (pyim-page-info-format): set fallback method.
---
pyim-page.el | 2 +-
tests/pyim-tests.el | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/pyim-page.el b/pyim-page.el
index c68c3f9a46..6315913e1a 100644
--- a/pyim-page.el
+++ b/pyim-page.el
@@ -329,7 +329,7 @@ page 的概念,比如,上面的 “nihao” 的 *待选词列表* 就可以
(cl-defgeneric pyim-page-info-format (style page-info)
"将 PAGE-INFO 按照 STYLE 格式化为选词框中显示的字符串。")
-(cl-defmethod pyim-page-info-format ((_style (eql two-lines)) page-info)
+(cl-defmethod pyim-page-info-format (_style page-info)
"将 PAGE-INFO 格式化为选词框中显示的字符串.
样式类似:
diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index dcf094f7c2..50a964ebad 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -1512,6 +1512,11 @@ Transfer-Encoding: chunked
(should (equal (pyim-page-info-format 'two-lines page-info)
"=> | [1/26]:
1.你好 2.尼耗 3[您耗]4.您好 5.你 "))
+
+ (should (equal (pyim-page-info-format 'no-exist-style page-info)
+ "=> | [1/26]:
+1.你好 2.尼耗 3[您耗]4.您好 5.你 "))
+
(should (equal (pyim-page-info-format 'one-line page-info)
"[|]: 1.你好 2.尼耗 3[您耗]4.您好 5.你 (1/26)"))
(should (equal (pyim-page-info-format 'vertical page-info)