[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 2dcdeff: Improve pyim-dcache-init-variable and pyi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 2dcdeff: Improve pyim-dcache-init-variable and pyim-dcache-reload-variable |
Date: |
Tue, 14 Dec 2021 23:57:30 -0500 (EST) |
branch: externals/pyim
commit 2dcdeff0caaf1267ba5b75c7bc399276aac123e7
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Improve pyim-dcache-init-variable and pyim-dcache-reload-variable
---
pyim-dcache.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/pyim-dcache.el b/pyim-dcache.el
index 1df6718..2b88da6 100644
--- a/pyim-dcache.el
+++ b/pyim-dcache.el
@@ -91,15 +91,16 @@ dcache 文件的方法让 pyim 正常工作。")
如果 VARIABLE 的值为 nil, 则使用 ‘pyim-dcache-directory’ 中对应文
件的内容来设置 VARIABLE 变量, 如果此时 VARIABLE 取值还是 nil, 那
么就将 VARIABLE 的值设置为 FALLBACK-VALUE."
- `(unless ,variable
- (setf ,variable (or (pyim-dcache-get-value ',variable)
+ `(when (and (symbolp ',variable) (not ,variable))
+ (setq ,variable (or (pyim-dcache-get-value ',variable)
,fallback-value
(make-hash-table :test #'equal)))))
(defmacro pyim-dcache-reload-variable (variable)
"从 `pyim-dcache-directory' 重新读取并设置 VARIABLE 的值."
- `(setf ,variable (or (pyim-dcache-get-value ',variable)
- (make-hash-table :test #'equal))))
+ `(when (symbolp ',variable)
+ (setq ,variable (or (pyim-dcache-get-value ',variable)
+ (make-hash-table :test #'equal)))))
(defun pyim-dcache-get-value (variable)
"从 `pyim-dcache-directory' 中读取与 VARIABLE 对应的文件中保存的值."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/pyim 2dcdeff: Improve pyim-dcache-init-variable and pyim-dcache-reload-variable,
ELPA Syncer <=