[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim b83a4afc48 2/3: Fix pyim-export-* commands run err
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim b83a4afc48 2/3: Fix pyim-export-* commands run error. |
Date: |
Sun, 12 Jun 2022 08:57:51 -0400 (EDT) |
branch: externals/pyim
commit b83a4afc48afd431cf379eebb216165f4719afff
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Fix pyim-export-* commands run error.
---
pyim-dhashcache.el | 3 ---
pyim-dregcache.el | 2 --
pyim.el | 8 ++++++++
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/pyim-dhashcache.el b/pyim-dhashcache.el
index d79b0bf110..c9db0ce64a 100644
--- a/pyim-dhashcache.el
+++ b/pyim-dhashcache.el
@@ -231,7 +231,6 @@
"读取并加载所有相关词库 dcache.
如果 FORCE 为真,强制加载。"
- (pyim-dcache-init-variables)
(when pyim-dcache-auto-update
(pyim-dhashcache-update-iword2priority force)
(pyim-dhashcache-update-personal-words force)
@@ -710,7 +709,6 @@ pyim 使用的词库文件是简单的文本文件,编码 *强制* 为 \\='utf
(file &context ((pyim-dcache-backend) (eql pyim-dhashcache))
&optional confirm)
"导出个人词库到 FILE."
- (pyim-dcache-init-variables)
(pyim-dhashcache-export pyim-dhashcache-icode2word file confirm))
(defun pyim-dhashcache-export (dcache file &optional confirm)
@@ -741,7 +739,6 @@ pyim 使用的词库文件是简单的文本文件,编码 *强制* 为 \\='utf
(cl-defmethod pyim-dcache-export-words-and-counts
(file &context ((pyim-dcache-backend) (eql pyim-dhashcache))
&optional confirm ignore-counts)
- (pyim-dcache-init-variables)
(with-temp-buffer
(insert ";;; -*- coding: utf-8-unix -*-\n")
(maphash
diff --git a/pyim-dregcache.el b/pyim-dregcache.el
index f55bedf73a..b7d9055fac 100644
--- a/pyim-dregcache.el
+++ b/pyim-dregcache.el
@@ -280,7 +280,6 @@
"读取并加载所有相关词库 dcache.
如果 FORCE 为真,强制加载。"
- (pyim-dcache-init-variables)
(when pyim-dcache-auto-update
(pyim-dregcache-update-personal-words force)
(let* ((dict-files (pyim-dict-get-enabled-dict-files))
@@ -475,7 +474,6 @@ update-icode2word 目前只要是用于更新型码输入法的 code-prefix, 所
(file &context ((pyim-dcache-backend) (eql pyim-dregcache))
&optional confirm)
"将个人词库存入 FILE."
- (pyim-dcache-init-variables)
(when pyim-dregcache-icode2word
;; 按词频排序,把词频信息保存到用户词典
(pyim-dregcache-sort-icode2word)
diff --git a/pyim.el b/pyim.el
index 7ecabb869d..72c9a7b57e 100644
--- a/pyim.el
+++ b/pyim.el
@@ -442,6 +442,10 @@ MERGE-METHOD 是一个函数,这个函数需要两个数字参数,代表词
如果 FILE 为 nil, 提示用户指定导出文件位置, 如果 CONFIRM 为
non-nil,文件存在时将会提示用户是否覆盖,默认为覆盖模式"
(interactive "F将词条和词频信息导出到文件: ")
+ (pyim-dcache-init-variables)
+ ;; FIXME: 只运行一次 `pyim-dcache-init-variables' 会出现 hashtable nil 的错误,
+ ;; 不知道什么原因。
+ (pyim-dcache-init-variables)
(pyim-dcache-export-words-and-counts file confirm ignore-counts)
(message "PYIM: 词条和词频信息导出完成。"))
@@ -451,6 +455,10 @@ non-nil,文件存在时将会提示用户是否覆盖,默认为覆盖模式"
如果 FILE 为 nil, 提示用户指定导出文件位置, 如果 CONFIRM 为 non-nil,
文件存在时将会提示用户是否覆盖,默认为覆盖模式。"
(interactive "F将个人词条导出到文件:")
+ (pyim-dcache-init-variables)
+ ;; FIXME: 只运行一次 `pyim-dcache-init-variables' 会出现 hashtable nil 的错误,
+ ;; 不知道什么原因。
+ (pyim-dcache-init-variables)
(pyim-dcache-export-personal-words file confirm)
(message "PYIM: 个人词条导出完成。"))