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

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

[elpa] externals/pyim 14050bcc7a 2/3: Add pyim--activate-pyim.


From: ELPA Syncer
Subject: [elpa] externals/pyim 14050bcc7a 2/3: Add pyim--activate-pyim.
Date: Thu, 30 Jun 2022 00:58:14 -0400 (EDT)

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

    Add pyim--activate-pyim.
---
 pyim.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pyim.el b/pyim.el
index c7e4b3dbf1..4688a5e4fb 100644
--- a/pyim.el
+++ b/pyim.el
@@ -579,13 +579,17 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
 (defun pyim-convert-string-at-point (&optional _)
   "将光标前的用户输入的字符串转换为中文."
   (interactive "P")
-  (unless (equal input-method-function 'pyim-input-method)
-    (activate-input-method 'pyim))
+  (pyim--activate-pyim)
   (or (pyim-create-word-from-selection)
       (pyim-process-trigger-feature-run-p)
       (pyim-process-feed-entered-at-point-into-pyim)
       (message "PYIM: `pyim-convert-string-at-point' did nothing.")))
 
+(defun pyim--activate-pyim ()
+  "如果当前输入法设置为 pyim, 就激活它。"
+  (unless (equal input-method-function 'pyim-input-method)
+    (activate-input-method 'pyim)))
+
 ;; ** 编码反查功能
 (defun pyim-search-word-code ()
   "选择词条,然后反查它的 code。"



reply via email to

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