[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim d7952b08ef 03/26: Add pyim-page-plan-to-select-wor
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim d7952b08ef 03/26: Add pyim-page-plan-to-select-word |
Date: |
Sun, 26 Jun 2022 10:57:51 -0400 (EDT) |
branch: externals/pyim
commit d7952b08efc1cf2b892f82a4edbbaf9a2ab36406
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Add pyim-page-plan-to-select-word
---
pyim-page.el | 9 ++++-----
pyim.el | 6 ++----
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/pyim-page.el b/pyim-page.el
index 74973763cb..f6bdfba445 100644
--- a/pyim-page.el
+++ b/pyim-page.el
@@ -562,17 +562,16 @@ pyim-page 的核心的功能,为此增加代码的复杂度和测试的难度
result)))
(string-join (nreverse result) (or separator ""))))
-(defun pyim-page-get-candidate-position-by-numeric-key (num-key)
- "根据 NUM-KEY 获取一个有效的 candidate position.
-
-如果获取不到,返回 nil."
+(defun pyim-page-plan-to-select-word (num-key)
+ "按照 NUM-KEY 预选词条,如果预选不成功,则返回 nil."
(let ((index (if (numberp num-key)
(- num-key 1)
0))
(end (pyim-page--end)))
(when (= index -1) (setq index 9))
(when (<= (+ index (pyim-page--start)) end)
- (+ (pyim-page--start) index))))
+ (pyim-process-plan-to-select-word
+ (+ (pyim-page--start) index)))))
(defun pyim-page-next-page (arg)
"Pyim page 翻页命令."
diff --git a/pyim.el b/pyim.el
index d9869d5eae..1ff8c99ad6 100644
--- a/pyim.el
+++ b/pyim.el
@@ -630,10 +630,8 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
(progn
(pyim-process-outcome-handle 'last-char)
(pyim-process-terminate))
- (let ((position (pyim-page-get-candidate-position-by-numeric-key num)))
- (when position
- (pyim-process-plan-to-select-word position)
- (pyim-select-word))))
+ (when (pyim-page-plan-to-select-word num)
+ (pyim-select-word)))
;; 有些输入法使用数字键编码,这种情况下,数字键就
;; 不能用来选词了。
(call-interactively #'pyim-self-insert-command)))
- [elpa] externals/pyim 63d7b16f46 05/26: Add pyim-process-select-last-char, (continued)
- [elpa] externals/pyim 63d7b16f46 05/26: Add pyim-process-select-last-char, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim b769c97469 13/26: Add pyim-select-word-by-number-1, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim eb585d56d1 10/26: Simplify pyim-select-word-by-number, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 74fdade342 16/26: Add ignore-errors in pyim-process-with-entered-buffer., ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 7e80507f17 25/26: pyim-process-next-word-position, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 009c56fd15 21/26: Update comment., ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 1ec45c77bb 08/26: Simplify pyim-select-word-simple, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim e7c8d3782a 14/26: Use pyim-process-select-last-char in pyim-page.el, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 862776bf21 24/26: Add pyim-process-plan-to-select-next-word, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 2f9cfb058a 17/26: Add pyim-process-select-nothing, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim d7952b08ef 03/26: Add pyim-page-plan-to-select-word,
ELPA Syncer <=
- [elpa] externals/pyim 95a4d01768 09/26: Simplify pyim-select-word, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 011b87a78f 15/26: Add pyim-process-without-entered-p, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 4b459fb22c 26/26: Refactor, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 8690bd940d 18/26: pyim-process-translating-p -> pyim-process--translating-p, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim c44e5d00db 11/26: pyim-process-create-code-criteria -> pyim-process--create-code-criteria, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim d69083f029 20/26: Move pyim-select-finish-hook to pyim-process.el, ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 9139d75f26 22/26: pyim-process-run use pyim-process-plan-to-select-word., ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 7ea1d2abe2 23/26: Move pyim-process-create-word., ELPA Syncer, 2022/06/26
- [elpa] externals/pyim 0ed0f00435 19/26: Add comment, ELPA Syncer, 2022/06/26