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

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

[elpa] externals/pyim ca6cade0e4 1/2: * pyim-candidates.el (pyim-candida


From: ELPA Syncer
Subject: [elpa] externals/pyim ca6cade0e4 1/2: * pyim-candidates.el (pyim-candidates-search-buffer): Add "(Buf)" comment to words.
Date: Sun, 22 May 2022 05:57:57 -0400 (EDT)

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

    * pyim-candidates.el (pyim-candidates-search-buffer): Add "(Buf)" comment 
to words.
---
 pyim-candidates.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/pyim-candidates.el b/pyim-candidates.el
index 20afb04ab2..bcf7a69988 100644
--- a/pyim-candidates.el
+++ b/pyim-candidates.el
@@ -195,13 +195,14 @@ IMOBJS 获得候选词条。"
         (goto-char (point-min))
         (pyim-time-limit-while (and (not (input-pending-p)) ;如果用户继续输入,就停止 
buffer 搜索。
                                     (re-search-forward regexp nil t)) 
time-limit
-          (let ((match (match-string-no-properties 0)))
+          (let* ((match (match-string-no-properties 0))
+                 (word (propertize match :comment "(Buf)")))
             ;; NOTE: 单个汉字我觉得不值得收集。
-            (when (>= (length match) 2)
-              (if (member match words)
-                  (cl-incf (gethash match counts))
-                (push match words)
-                (puthash match 1 counts)))))
+            (when (>= (length word) 2)
+              (if (member word words)
+                  (cl-incf (gethash word counts))
+                (push word words)
+                (puthash word 1 counts)))))
         (sort words (lambda (a b)
                       (> (or (gethash a counts) 0)
                          (or (gethash b counts) 0))))))))



reply via email to

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