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

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

[elpa] externals/pyim b56ee61 4/7: Add pyim-dcache-update-shortcode2word


From: ELPA Syncer
Subject: [elpa] externals/pyim b56ee61 4/7: Add pyim-dcache-update-shortcode2word.
Date: Sat, 24 Apr 2021 09:57:10 -0400 (EDT)

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

    Add pyim-dcache-update-shortcode2word.
    
        * pyim.el (pyim-start): Use pyim-dcache-update-shortcode2word.
    
        * pyim-dcache.el (pyim-dcache-update-shortcode2word): New function.
---
 pyim-dcache.el | 7 +++++++
 pyim.el        | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/pyim-dcache.el b/pyim-dcache.el
index 4d02a64..7ac2377 100644
--- a/pyim-dcache.el
+++ b/pyim-dcache.el
@@ -192,6 +192,13 @@ VARIABLE 变量,FORCE-RESTORE 设置为 t 时,强制恢复,变量原来的
   (when pyim-dcache-auto-update
     (pyim-dcache-call-api 'update-personal-words force)))
 
+(defun pyim-dcache-update-shortcode2word (&optional force)
+  "更新 shortcode2word 缓存。
+
+如果 FORCE non-nil, 则强制更新。"
+  (when pyim-dcache-auto-update
+    (pyim-dcache-call-api 'update-shortcode2word force)))
+
 (defun pyim-dcache-init-variables ()
   "初始化 dcache 缓存相关变量."
   (pyim-dcache-call-api 'init-variables))
diff --git a/pyim.el b/pyim.el
index d555a75..ced219e 100644
--- a/pyim.el
+++ b/pyim.el
@@ -211,7 +211,7 @@ pyim 使用函数 `pyim-start' 启动输入法的时候,会将变量
   (when pyim-dcache-auto-update
     (pyim-dcache-update-code2word refresh-common-dcache)
     ;; 这个命令 *当前* 主要用于五笔输入法。
-    (pyim-dcache-call-api 'update-shortcode2word restart))
+    (pyim-dcache-update-shortcode2word restart))
 
   ;; Make sure personal or other dcache are saved to file before kill emacs.
   (add-hook 'kill-emacs-hook #'pyim-dcache-save-caches)



reply via email to

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