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

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

[elpa] externals/pyim 011b87a78f 15/26: Add pyim-process-without-entered


From: ELPA Syncer
Subject: [elpa] externals/pyim 011b87a78f 15/26: Add pyim-process-without-entered-p
Date: Sun, 26 Jun 2022 10:57:52 -0400 (EDT)

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

    Add pyim-process-without-entered-p
---
 pyim-page.el    | 4 ++--
 pyim-process.el | 3 +++
 pyim.el         | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pyim-page.el b/pyim-page.el
index 09d3115961..9b2408a2bd 100644
--- a/pyim-page.el
+++ b/pyim-page.el
@@ -576,7 +576,7 @@ pyim-page 的核心的功能,为此增加代码的复杂度和测试的难度
 (defun pyim-page-next-page (arg)
   "Pyim page 翻页命令."
   (interactive "p")
-  (if (= (length (pyim-process-get-entered 'point-before)) 0)
+  (if (pyim-process-without-entered-p)
       (pyim-process-select-last-char)
     (let* ((new (+ (pyim-process-get-candidate-position)
                    (* pyim-page-length arg) 1))
@@ -594,7 +594,7 @@ pyim-page 的核心的功能,为此增加代码的复杂度和测试的难度
 
 (defun pyim-page-next-word (arg)
   (interactive "p")
-  (if (= (length (pyim-process-get-entered 'point-before)) 0)
+  (if (pyim-process-without-entered-p)
       (pyim-process-select-last-char)
     (let ((new (+ (pyim-process-get-candidate-position) arg))
           (len (pyim-process-candidates-length)))
diff --git a/pyim-process.el b/pyim-process.el
index 3ac66bc485..669c87a571 100644
--- a/pyim-process.el
+++ b/pyim-process.el
@@ -216,6 +216,9 @@ imobj 组合构成在一起,构成了 imobjs 这个概念。比如:
 (defun pyim-process-get-entered (&optional type)
   (pyim-entered-get type))
 
+(defun pyim-process-without-entered-p ()
+  (= (length (pyim-process-get-entered 'point-before)) 0))
+
 (defun pyim-process-get-candidates ()
   pyim-process--candidates)
 
diff --git a/pyim.el b/pyim.el
index 35118ac60c..6862eecc6b 100644
--- a/pyim.el
+++ b/pyim.el
@@ -524,7 +524,7 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
 这个功能一般用于五笔等形码输入法,在忘记编码的时候临时用拼音输入
 中文。"
   (interactive)
-  (if (= (length (pyim-process-get-entered 'point-before)) 0)
+  (if (pyim-process-without-entered-p)
       (pyim-process-select-last-char)
     (pyim-scheme-toggle-assistant)
     (pyim-process-run)))



reply via email to

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