branch: externals/pyim commit d84b3c6da8dcfdedd82552c84e3cbc8e553c1c83 Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@163.com>
Better handle pyim-dcache-auto-update --- pyim-dhashcache.el | 11 +++++------ pyim-dregcache.el | 19 +++++++++---------- pyim-process.el | 3 ++- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/pyim-dhashcache.el b/pyim-dhashcache.el index c9db0ce64a..07ad13ce3f 100644 --- a/pyim-dhashcache.el +++ b/pyim-dhashcache.el @@ -231,12 +231,11 @@ "读取并加载所有相关词库 dcache. 如果 FORCE 为真,强制加载。" - (when pyim-dcache-auto-update - (pyim-dhashcache-update-iword2priority force) - (pyim-dhashcache-update-personal-words force) - (let* ((dict-files (pyim-dict-get-enabled-dict-files)) - (dicts-md5 (pyim-dcache-create-files-md5 dict-files))) - (pyim-dhashcache-update-code2word dict-files dicts-md5 force)))) + (pyim-dhashcache-update-iword2priority force) + (pyim-dhashcache-update-personal-words force) + (let* ((dict-files (pyim-dict-get-enabled-dict-files)) + (dicts-md5 (pyim-dcache-create-files-md5 dict-files))) + (pyim-dhashcache-update-code2word dict-files dicts-md5 force))) (defun pyim-dhashcache-update-iword2priority (&optional force) "更新词条优先级表,如果 FORCE 为真,强制更新。" diff --git a/pyim-dregcache.el b/pyim-dregcache.el index b7d9055fac..038c58b38b 100644 --- a/pyim-dregcache.el +++ b/pyim-dregcache.el @@ -280,16 +280,15 @@ "读取并加载所有相关词库 dcache. 如果 FORCE 为真,强制加载。" - (when pyim-dcache-auto-update - (pyim-dregcache-update-personal-words force) - (let* ((dict-files (pyim-dict-get-enabled-dict-files)) - (dicts-md5 (pyim-dcache-create-files-md5 dict-files))) - (when pyim-debug - (message "pyim-dregcache-update: pyim-dicts=%s pyim-extra-dicts=%s dict-files=%s" - pyim-dicts - pyim-extra-dicts - dict-files)) - (pyim-dregcache-update-code2word dict-files dicts-md5 force)))) + (pyim-dregcache-update-personal-words force) + (let* ((dict-files (pyim-dict-get-enabled-dict-files)) + (dicts-md5 (pyim-dcache-create-files-md5 dict-files))) + (when pyim-debug + (message "pyim-dregcache-update: pyim-dicts=%s pyim-extra-dicts=%s dict-files=%s" + pyim-dicts + pyim-extra-dicts + dict-files)) + (pyim-dregcache-update-code2word dict-files dicts-md5 force))) (defun pyim-dregcache-update-personal-words (&optional force) "合并 `pyim-dregcache-icode2word' 磁盘文件. 加载排序后的结果. diff --git a/pyim-process.el b/pyim-process.el index b6b57c86e2..9d95b44d04 100644 --- a/pyim-process.el +++ b/pyim-process.el @@ -214,7 +214,8 @@ imobj 组合构成在一起,构成了 imobjs 这个概念。比如: (pyim-dcache-save-caches))) (defun pyim-process-update (&optional force) - (pyim-dcache-update force)) + (when pyim-dcache-auto-update + (pyim-dcache-update force))) (defun pyim-process-start-daemon () "启动 pyim 流程需要的 daemon."