[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 0c0bd79 1/3: * pyim-scheme.el (pyim-default-scheme
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 0c0bd79 1/3: * pyim-scheme.el (pyim-default-scheme): Deal with invalid scheme-name. |
Date: |
Wed, 9 Jun 2021 02:57:13 -0400 (EDT) |
branch: externals/pyim
commit 0c0bd79147475b8784825bc0e9dd9bb4ab9fecdb
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
* pyim-scheme.el (pyim-default-scheme): Deal with invalid scheme-name.
---
pyim-scheme.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/pyim-scheme.el b/pyim-scheme.el
index e0a35ca..da6369e 100644
--- a/pyim-scheme.el
+++ b/pyim-scheme.el
@@ -60,10 +60,13 @@
(scheme-name
(or scheme-name
(intern (completing-read "PYIM: 将 pyim-default-scheme 设置为:"
scheme-names)))))
- (when (memq scheme-name scheme-names)
- (setq pyim-default-scheme scheme-name)
- (message "PYIM: `pyim-default-scheme' 已经设置为 %s." scheme-name)
- scheme-name)))
+ (if (memq scheme-name scheme-names)
+ (progn
+ (setq pyim-default-scheme scheme-name)
+ (message "PYIM: `pyim-default-scheme' 已经设置为 %s." scheme-name)
+ scheme-name)
+ (message "PYIM: %s 不是一个有效的 scheme 名称, 继续使用 %s." scheme-name
pyim-default-scheme)
+ nil)))
(defun pyim-scheme-add (scheme)
"Add SCHEME to `pyim-schemes'"