[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 799fd800fe 2/3: Fix pyim-punctuation-p
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 799fd800fe 2/3: Fix pyim-punctuation-p |
Date: |
Tue, 28 Jun 2022 08:57:52 -0400 (EDT) |
branch: externals/pyim
commit 799fd800febb379a970ac4fa2bc5253434dcbff6
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Fix pyim-punctuation-p
---
pyim-punctuation.el | 4 +++-
tests/pyim-tests.el | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/pyim-punctuation.el b/pyim-punctuation.el
index 9d04c3fd6e..748c13ecdf 100644
--- a/pyim-punctuation.el
+++ b/pyim-punctuation.el
@@ -149,7 +149,9 @@ pyim 输入半角标点,函数列表中每个函数都有一个参数:char
(defun pyim-punctuation-p (punct)
"判断 PUNCT 是否是包含在 `pyim-punctuation-dict' 中的标点符号。"
- (assoc (char-to-string punct) pyim-punctuation-dict))
+ (cl-some (lambda (x)
+ (when (member (char-to-string punct) x) x))
+ pyim-punctuation-dict))
(defun pyim-punctuation-position (punct)
"返回 PUNCT 在 `pyim-punctuation-dict' 某一行中的位置。"
diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index 92acb66979..28a4c199f1 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -376,7 +376,7 @@
;; ** pyim-punctuation 相关单元测试
(ert-deftest pyim-tests-pyim-punctuation-p ()
(should (pyim-punctuation-p ?,))
- (should-not (pyim-punctuation-p ?,))
+ (should (pyim-punctuation-p ?,))
(should-not (pyim-punctuation-p ?a))
(should-not (pyim-punctuation-p ?1)))