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

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

[elpa] externals/pyim 97c95520f7 07/22: Add functions about pyim-process


From: ELPA Syncer
Subject: [elpa] externals/pyim 97c95520f7 07/22: Add functions about pyim-process-translating
Date: Fri, 24 Jun 2022 16:57:51 -0400 (EDT)

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

    Add functions about pyim-process-translating
---
 pyim-process.el | 10 ++++++++--
 pyim.el         |  4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/pyim-process.el b/pyim-process.el
index 0230165282..82b5deb30b 100644
--- a/pyim-process.el
+++ b/pyim-process.el
@@ -477,13 +477,19 @@ imobj 组合构成在一起,构成了 imobjs 这个概念。比如:
      pyim-process--imobjs scheme
      (lambda (async-return)
        (with-current-buffer buffer
-         (when (and pyim-process-translating
+         (when (and (pyim-process-translating-p)
                     (not (input-pending-p))
                     (equal (car async-return) pyim-process--imobjs))
            (setq pyim-process--candidates
                  (pyim-process--merge-candidates (cdr async-return) 
pyim-process--candidates))
            (pyim-process-ui-refresh)))))))
 
+(defun pyim-process-translating-p ()
+  pyim-process-translating)
+
+(defun pyim-process-set-translating-flag (value)
+  (setq pyim-process-translating value))
+
 (defun pyim-process-get-candidates ()
   pyim-process--candidates)
 
@@ -793,7 +799,7 @@ BUG:拼音无法有效地处理多音字。"
   "Terminate the translation of the current key.")
 
 (cl-defmethod pyim-process-terminate-really (_scheme)
-  (setq pyim-process-translating nil)
+  (pyim-process-set-translating-flag nil)
   (pyim-entered-erase-buffer)
   (setq pyim-process--code-criteria nil)
   (setq pyim-process--force-input-chinese nil)
diff --git a/pyim.el b/pyim.el
index cc71672902..aa994ed322 100644
--- a/pyim.el
+++ b/pyim.el
@@ -189,13 +189,13 @@ Tip: 用户也可以利用 `pyim-outcome-trigger-function-default' 函数
              (modified-p (buffer-modified-p))
              last-command-event last-command this-command)
 
-        (setq pyim-process-translating t)
+        (pyim-process-set-translating-flag t)
         (pyim-process-cleanup-input-output)
 
         (when key
           (pyim-add-unread-command-events key))
 
-        (while pyim-process-translating
+        (while (pyim-process-translating-p)
           (set-buffer-modified-p modified-p)
           (let* ((keyseq (read-key-sequence nil nil nil t))
                  (cmd (lookup-key pyim-mode-map keyseq)))



reply via email to

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