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

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

[elpa] externals/pyim 426e06c 1/7: Add pyim-dcache-delete-word.


From: ELPA Syncer
Subject: [elpa] externals/pyim 426e06c 1/7: Add pyim-dcache-delete-word.
Date: Sat, 24 Apr 2021 09:57:09 -0400 (EDT)

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

    Add pyim-dcache-delete-word.
    
        * pyim.el (pyim-delete-words-in-file, pyim-delete-last-word)
        (pyim-delete-word-at-point, pyim-delete-word): use 
pyim-dcache-delete-word.
        (pyim-delete-word-1): Removed.
    
        * pyim-dcache.el (pyim-dcache-delete-word): New function.
---
 pyim-dcache.el |  4 ++++
 pyim.el        | 12 ++++--------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/pyim-dcache.el b/pyim-dcache.el
index c96a6d1..80ccbdf 100644
--- a/pyim-dcache.el
+++ b/pyim-dcache.el
@@ -273,6 +273,10 @@ MERGE-METHOD 是一个函数,这个函数需要两个数字参数,代表
 
   (message "pyim: 词条相关信息导入完成!"))
 
+(defun pyim-dcache-delete-word (word)
+  "将中文词条 WORD 从个人词库中删除"
+  (pyim-dcache-call-api 'delete-word word))
+
 ;; * Footer
 (provide 'pyim-dcache)
 
diff --git a/pyim.el b/pyim.el
index 2c7fb31..623b769 100644
--- a/pyim.el
+++ b/pyim.el
@@ -377,7 +377,7 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
     (while (not (eobp))
       (let ((word (car (pyim-dline-parse))))
         (when (and word (not (pyim-string-match-p "\\CC" word)))
-          (pyim-delete-word-1 word)))
+          (pyim-dcache-delete-word word)))
       (forward-line 1)))
   (message "pyim: 批量删词完成!"))
 
@@ -385,7 +385,7 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
   "从个人词库中删除最新创建的词条。"
   (interactive)
   (when pyim-last-created-word
-    (pyim-delete-word-1 pyim-last-created-word)
+    (pyim-dcache-delete-word pyim-last-created-word)
     (message "pyim: 从个人词库中删除词条 “%s” !" pyim-last-created-word)))
 
 (defun pyim-delete-word-at-point (&optional number silent)
@@ -393,7 +393,7 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
 当 SILENT 设置为 t 是,不显示提醒信息。"
   (let* ((string (pyim-cstring-at-point (or number 2))))
     (when string
-      (pyim-delete-word-1 string)
+      (pyim-dcache-delete-word string)
       (unless silent
         (message "词条: \"%s\" 已经从个人词库缓冲中删除。" string)))))
 
@@ -405,14 +405,10 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
                      (region-beginning) (region-end))))
         (when (and (< (length string) 6)
                    (> (length string) 0))
-          (pyim-delete-word-1 string)
+          (pyim-dcache-delete-word string)
           (message "将词条: %S 从 personal 缓冲中删除。" string)))
     (message "请首先高亮选择需要删除的词条。")))
 
-(defun pyim-delete-word-1 (word)
-  "将中文词条 WORD 从个人词库中删除"
-  (pyim-dcache-call-api 'delete-word word))
-
 ;; ** 处理用户输入字符的相关函数
 (defun pyim-input-method (key)
   "得到需要插入到 buffer 的字符串, 并将其插入到待输入 buffer.



reply via email to

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