branch: externals/pyim commit a18928829ffdda775cb6f506fd1fa6f2167425e0 Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@163.com>
Add pyim-process-last-created-word --- pyim-process.el | 3 +++ pyim.el | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pyim-process.el b/pyim-process.el index 7498836563..4fa8c1b533 100644 --- a/pyim-process.el +++ b/pyim-process.el @@ -991,6 +991,9 @@ alist 列表。" (setq pyim-process--last-created-words (remove word pyim-process--last-created-words))) +(defun pyim-process-last-created-word () + (car pyim-process--last-created-words)) + (defun pyim-process-last-created-words () pyim-process--last-created-words) diff --git a/pyim.el b/pyim.el index 5062e98b4a..3d79a74846 100644 --- a/pyim.el +++ b/pyim.el @@ -414,9 +414,10 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同, (defun pyim-delete-last-word () "从个人词库中删除最新创建的词条。" (interactive) - (when (pyim-process-last-created-words) - (pyim-process-delete-word (car (pyim-process-last-created-words))) - (message "pyim: 从个人词库中删除词条 “%s” !" (car (pyim-process-last-created-words))))) + (let ((word (pyim-process-last-created-word))) + (when word + (pyim-process-delete-word word) + (message "pyim: 从个人词库中删除词条 “%s” !" word)))) (defun pyim-delete-word-at-point (&optional number silent) "将光标前字符数为 NUMBER 的中文字符串从个人词库中删除