branch: externals/pyim
commit 14979dc99c6f1d8a0a63788cfc835d56802f28fb
Author: Feng Shu <[email protected]>
Commit: Feng Shu <[email protected]>
Add pyim-process-get-first-imobj.
* pyim.el (pyim-select-word:pinyin): Use
pyim-process-get-first-imobj.
* pyim-process.el (pyim-process-get-first-imobj): New function.
(pyim-process-get-imobjs): Removed.
(pyim-process-create-code-criteria): Use
pyim-process-get-first-imobj.
* pyim.el (pyim-select-word:pinyin): Use
pyim-process-get-first-imobj.
* pyim-page.el (pyim-page-preview-create:quanpin)
(pyim-page-preview-create:shuangpin): Use
pyim-process-get-first-imobj.
---
pyim-page.el | 4 ++--
pyim-preview.el | 2 +-
pyim-process.el | 6 +++---
pyim.el | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/pyim-page.el b/pyim-page.el
index b148857c13..010a012668 100644
--- a/pyim-page.el
+++ b/pyim-page.el
@@ -291,7 +291,7 @@ page 的概念,比如,上面的 “nihao” 的 *待选词列表* 就可以
(let* ((separator (or separator " "))
(translated (string-join (mapcar (lambda (w)
(concat (nth 0 w) (nth 1 w)))
- (car (pyim-process-get-imobjs)))
+ (pyim-process-get-first-imobj))
separator)))
(concat
;; | 显示光标位置的字符
@@ -314,7 +314,7 @@ page 的概念,比如,上面的 “nihao” 的 *待选词列表* 就可以
(defun pyim-page-preview-create:shuangpin (&optional separator)
(let ((keymaps (pyim-scheme-get-option (pyim-scheme-name) :keymaps))
result)
- (dolist (w (car (pyim-process-get-imobjs)))
+ (dolist (w (pyim-process-get-first-imobj))
(let ((sm (nth 0 w))
(ym (nth 1 w)))
(if (equal sm "")
diff --git a/pyim-preview.el b/pyim-preview.el
index 414c48b70c..849ba7f4ab 100644
--- a/pyim-preview.el
+++ b/pyim-preview.el
@@ -84,7 +84,7 @@ pyim 会使用 Emacs overlay 机制在 *待输入buffer* 光标处高亮显示
(lambda (py)
(concat (nth 0 py) (nth 1 py)))
(nthcdr (length preview)
- (car (pyim-process-get-imobjs)))
+ (pyim-process-get-first-imobj))
"'")))
(when (string< "" rest)
(setq preview (concat preview rest)))))
diff --git a/pyim-process.el b/pyim-process.el
index 9392a07bc1..2b786dc200 100644
--- a/pyim-process.el
+++ b/pyim-process.el
@@ -337,8 +337,8 @@
(defun pyim-process-set-candidate-position (n)
(setq pyim-candidate-position n))
-(defun pyim-process-get-imobjs ()
- pyim-imobjs)
+(defun pyim-process-get-first-imobj ()
+ (car pyim-imobjs))
(defun pyim-process-select-subword-p ()
pyim-outcome-subword-info)
@@ -540,7 +540,7 @@ alist 列表。"
"创建 `pyim-cstring-to-code-criteria'."
(setq pyim-cstring-to-code-criteria
(let ((str (string-join
- (pyim-codes-create (car (pyim-process-get-imobjs))
+ (pyim-codes-create (pyim-process-get-first-imobj)
(pyim-scheme-name)))))
(if (> (length pyim-cstring-to-code-criteria)
(length str))
diff --git a/pyim.el b/pyim.el
index f66edc71d6..97f1d10f83 100644
--- a/pyim.el
+++ b/pyim.el
@@ -524,7 +524,7 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
"从选词框中选择当前词条,然后删除该词条对应拼音。"
(interactive)
(pyim-process-outcome-handle 'candidate)
- (let* ((imobj (car (pyim-process-get-imobjs)))
+ (let* ((imobj (pyim-process-get-first-imobj))
(length-selected-word
;; 获取 *这一次* 选择词条的长度, 在“多次选择词条才能上屏”的情况下,
;; 一定要和 output 的概念作区别。