branch: externals/pyim
commit 5458e8d0f409267ad3f767fb9084cda02a6aee4d
Author: Feng Shu <tuma...@163.com>
Commit: Feng Shu <tuma...@163.com>

    * pyim-dhashcache.el (pyim-dhashcache-generate-word2code-dcache-file): Make 
the content saved beautiful.
---
 pyim-dhashcache.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/pyim-dhashcache.el b/pyim-dhashcache.el
index ee3fb98dd3..59ab03840a 100644
--- a/pyim-dhashcache.el
+++ b/pyim-dhashcache.el
@@ -326,7 +326,16 @@ DCACHE 是一个 code -> words 的 hashtable.
        (lambda (code words)
          (unless (pyim-string-match-p "-" code)
            (dolist (word words)
-             (let ((value (gethash word hashtable)))
+             (let ((value (gethash word hashtable))
+                   ;; NOTE: 这里使用 `cl-copy-seq', 可以让保存的文件内容类似:
+                   ;;
+                   ;;   "呵" ("he" "a")
+                   ;;
+                   ;; 而不是:
+                   ;;
+                   ;;   "呵" (#9="he" #2#)
+                   ;;
+                   (code (cl-copy-seq code)))
                (puthash word
                         (if value
                             `(,code ,@value)

Reply via email to