[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim c13c2a6 06/36: Move code to pyim-common.el
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim c13c2a6 06/36: Move code to pyim-common.el |
Date: |
Thu, 22 Apr 2021 22:57:15 -0400 (EDT) |
branch: externals/pyim
commit c13c2a614fc1732fa866f1366f588cc295a67ea8
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Move code to pyim-common.el
* pyim-common.el (pyim-char-before-to-string)
(pyim-char-after-to-string, pyim-posframe-valid-p)
(pyim-list-merge): move from pyim.el
---
pyim-common.el | 33 +++++++++++++++++++++++++++++++++
pyim.el | 33 ---------------------------------
2 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/pyim-common.el b/pyim-common.el
index eba88ba..16c0860 100644
--- a/pyim-common.el
+++ b/pyim-common.el
@@ -188,6 +188,39 @@ VARIABLE 变量,FORCE-RESTORE 设置为 t 时,强制恢复,变量原来的
(t (append (pyim-flatten-list (car my-list))
(pyim-flatten-list (cdr my-list))))))
+(defun pyim-char-before-to-string (num)
+ "得到光标前第 `num' 个字符,并将其转换为字符串。"
+ (let* ((point (point))
+ (point-before (- point num)))
+ (when (and (> point-before 0)
+ (char-before point-before))
+ (char-to-string (char-before point-before)))))
+
+(defun pyim-char-after-to-string (num)
+ "得到光标后第 `num' 个字符,并将其转换为字符串。"
+ (let* ((point (point))
+ (point-after (+ point num)))
+ (when (char-after point-after)
+ (char-to-string (char-after point-after)))))
+
+(defun pyim-posframe-valid-p ()
+ "Test posframe's status."
+ (and (>= emacs-major-version 26)
+ (featurep 'posframe)
+ (not (or noninteractive
+ emacs-basic-display
+ (not (display-graphic-p))))))
+
+(defun pyim-list-merge (a b)
+ "Join list A and B to a new list, then delete dups."
+ (let ((a (if (listp a)
+ a
+ (list a)))
+ (b (if (listp b)
+ b
+ (list b))))
+ (delete-dups `(,@a ,@b))))
+
;; * Footer
(provide 'pyim-common)
diff --git a/pyim.el b/pyim.el
index 8622146..8c2c167 100644
--- a/pyim.el
+++ b/pyim.el
@@ -1439,16 +1439,6 @@ code-prefix)。当RETURN-LIST 设置为 t 时,返回一个 code list。"
(substring (pyim-hanzi2xingma:wubi (nth (1- len)
string)) 0 1))))))
code)))
-(defun pyim-list-merge (a b)
- "Join list A and B to a new list, then delete dups."
- (let ((a (if (listp a)
- a
- (list a)))
- (b (if (listp b)
- b
- (list b))))
- (delete-dups `(,@a ,@b))))
-
(defun pyim-cstring-at-point (&optional number)
"获取光标一个中文字符串,字符数量为:NUMBER."
(save-excursion
@@ -2976,14 +2966,6 @@ minibuffer 原来显示的信息和 pyim 选词框整合在一起显示
(t (let ((max-mini-window-height (+ pyim-page-length 2)))
(message string))))))
-(defun pyim-posframe-valid-p ()
- "Test posframe's status."
- (and (>= emacs-major-version 26)
- (featurep 'posframe)
- (not (or noninteractive
- emacs-basic-display
- (not (display-graphic-p))))))
-
(defun pyim-outcome-get (&optional n)
"获取 outcome"
(nth (or n 0) pyim-outcome-history))
@@ -3297,21 +3279,6 @@ alist 列表。"
;; 当输入的字符不是标点符号时,原样插入。
(t str))))
-(defun pyim-char-before-to-string (num)
- "得到光标前第 `num' 个字符,并将其转换为字符串。"
- (let* ((point (point))
- (point-before (- point num)))
- (when (and (> point-before 0)
- (char-before point-before))
- (char-to-string (char-before point-before)))))
-
-(defun pyim-char-after-to-string (num)
- "得到光标后第 `num' 个字符,并将其转换为字符串。"
- (let* ((point (point))
- (point-after (+ point num)))
- (when (char-after point-after)
- (char-to-string (char-after point-after)))))
-
(defun pyim-wash-current-line-function ()
"清理当前行的内容,比如:删除不必要的空格,等。"
(interactive)
- [elpa] externals/pyim updated (c16ca2b -> aa8dbd9), ELPA Syncer, 2021/04/22
- [elpa] externals/pyim f744469 01/36: Move code to pyim-pymap.el, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim 900071a 02/36: Add pyim-pinyin.el, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim c13c2a6 06/36: Move code to pyim-common.el,
ELPA Syncer <=
- [elpa] externals/pyim 09fd273 07/36: Sort pyim-common.el, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim 6dfe546 08/36: New pyim-punctuation.el file., ELPA Syncer, 2021/04/22
- [elpa] externals/pyim 6cc63e8 09/36: New file: pyim-dict.el, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim 8ae9ad9 10/36: New file pyim-cstring.el, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim 678240a 16/36: Add pyim-candidates.el, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim fa9a82a 17/36: pyim-posframe-* -> pyim-page-posframe-*, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim 8023823 15/36: New file: pyim-page.el, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim cfd96c6 20/36: update pyim-candidates.el, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim eafaef3 22/36: update pyim-cstring.el, ELPA Syncer, 2021/04/22
- [elpa] externals/pyim c9cd6bf 27/36: Add pyim-autoselector.el, ELPA Syncer, 2021/04/22