[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 24705a2dee 6/6: Add pyim-outcome-diff
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 24705a2dee 6/6: Add pyim-outcome-diff |
Date: |
Mon, 27 Jun 2022 18:57:52 -0400 (EDT) |
branch: externals/pyim
commit 24705a2dee8c3bc0ac677eda9b57a7ecedd028d3
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Add pyim-outcome-diff
---
pyim-liberime.el | 3 +--
pyim-outcome.el | 13 +++++++++++--
pyim-process.el | 3 +--
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/pyim-liberime.el b/pyim-liberime.el
index 48200b9470..79c354ef64 100644
--- a/pyim-liberime.el
+++ b/pyim-liberime.el
@@ -186,8 +186,7 @@
"从选词框中选择当前词条,然后删除该词条对应拼音。"
(pyim-process-select-word-without-save 'do-not-terminate)
(let* ((entered (pyim-entered-get 'point-before))
- (word (string-remove-prefix
- (or (pyim-outcome-get 1) "") (pyim-outcome-get)))
+ (word (pyim-outcome-diff))
(code (pyim-liberime--get-code word entered))
(to-be-translated
(string-remove-prefix code entered)))
diff --git a/pyim-outcome.el b/pyim-outcome.el
index 3ed942c793..80395e413a 100644
--- a/pyim-outcome.el
+++ b/pyim-outcome.el
@@ -126,14 +126,23 @@ pyim 使用函数 `pyim-process-select-handle-char' 来处理特殊功能触发
(pyim-register-local-variables '(pyim-outcome--history))
;; ** 选词框相关函数
-(defun pyim-outcome-get (&optional n)
+(defun pyim-outcome-get ()
"获取 outcome"
- (nth (or n 0) pyim-outcome--history))
+ (pyim-outcome--get 0))
+
+(defun pyim-outcome--get (n)
+ "获取 outcome"
+ (nth n pyim-outcome--history))
(defun pyim-outcome-add (outcome)
"添加 OUTCOME."
(push outcome pyim-outcome--history))
+(defun pyim-outcome-diff ()
+ "OUTCOME 的变化。"
+ (string-remove-prefix
+ (or (pyim-outcome--get 1) "") (pyim-outcome--get 0)))
+
(defun pyim-outcome-erase ()
"清除 OUTCOME."
(setq pyim-outcome--history nil))
diff --git a/pyim-process.el b/pyim-process.el
index a572549f52..fdd4bafc6c 100644
--- a/pyim-process.el
+++ b/pyim-process.el
@@ -730,8 +730,7 @@ xiaolifeidao
选择。"
(let* ((imobj (pyim-process-get-first-imobj))
(length-selected-word-in-this-step
- (- (length (pyim-outcome-get))
- (length (pyim-outcome-get 1)))))
+ (length (pyim-outcome-diff))))
(when (< length-selected-word-in-this-step (length imobj))
(string-join
(mapcar (lambda (w)
- [elpa] externals/pyim updated (e1aeac91ee -> 24705a2dee), ELPA Syncer, 2022/06/27
- [elpa] externals/pyim cc581e6318 5/6: Add pyim-process--select-word-in-next-step, ELPA Syncer, 2022/06/27
- [elpa] externals/pyim b764d12b76 4/6: Improve pyim-process--entered-to-be-translated, ELPA Syncer, 2022/06/27
- [elpa] externals/pyim 24705a2dee 6/6: Add pyim-outcome-diff,
ELPA Syncer <=
- [elpa] externals/pyim b26e96e93c 3/6: Add pyim-process--multi-step-select-word-p, ELPA Syncer, 2022/06/27
- [elpa] externals/pyim 3561e298ba 1/6: Add pyim-outcome-add/erase, ELPA Syncer, 2022/06/27
- [elpa] externals/pyim b4ba990092 2/6: Add pyim-process--entered-to-be-translated, ELPA Syncer, 2022/06/27