tumashu / pyim

一个 emacs 中文输入法,支持全拼,双拼,五笔,仓颉和Rime,pyim 是 GNU elpa 包。
892 stars 93 forks source link

新的windows10里使用pyim的五笔,出问题。 #487

Open doneself opened 2 weeks ago

doneself commented 2 weeks ago

windows10下, GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-07-05 使用默认的拼音配置,没有出现问题。

(require 'pyim)
(require 'pyim-basedict) ; 拼音词库设置,五笔用户 *不需要* 此行设置
(pyim-basedict-enable)   ; 拼音词库,五笔用户 *不需要* 此行设置
(setq default-input-method "pyim")

但是使用五笔时,配置如下就报错了: 该配置在其他电脑上没有报错。

(use-package pyim
  :ensure t
  :config
  (setq pyim-default-scheme 'wubi)
  (setq pyim-dicts '((:name "jidian" :file "~/.emacs.d/PinyinDict/wubi.pyim")))
  (setq default-input-method "pyim")
  (setq pyim-page-style 'vertical)
  (setq pyim-indicator-cursor-color '("#f53602"))
  ;; (setq pyim-page-tooltip 'popup)
  (setq-default pyim-punctuation-translate-p '(auto yes no))   ;中文使用全角标点,英文使用半角标点。
  (setq-default pyim-punctuation-half-width-functions
                '(
                  pyim-probe-punctuation-after-punctuation)))

错误如下:

error in process sentinel: async-handle-result: Invalid read syntax: "Trailing garbage following expression"
error in process sentinel: Invalid read syntax: "Trailing garbage following expression"
error in process sentinel: async-handle-result: Invalid read syntax: "Trailing garbage following expression"
error in process sentinel: Invalid read syntax: "Trailing garbage following expression"
error in process sentinel: async-handle-result: Invalid read syntax: "Trailing garbage following expression"
error in process sentinel: Invalid read syntax: "Trailing garbage following expression"
GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-07-05

开启debug-on-error:

Debugger entered--Lisp error: (invalid-read-syntax "Trailing garbage following expression")
  signal(invalid-read-syntax ("Trailing garbage following expression"))
  async-handle-result(#f(compiled-function (_) #<bytecode -0x9b1842b6437cc0a>) (async-signal (invalid-read-syntax "Trailing garbage following expression")) #<buffer *emacs*>)
  async-when-done(#<process emacs> "finished\n")
  process-send-region(#<process emacs<1>> 1 10652)
  async--transmit-sexp(#<process emacs<1>> '(lambda nil (setq load-path '("d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/a..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/a..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/b..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/c..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/c..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/c..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/d..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/e..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/e..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/a..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/e..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/e..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/e..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/e..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/e..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/g..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/g..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/g..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/h..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/e..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/i..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/h..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/l..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/l..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/m..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/n..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/o..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/p..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/p..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/p..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/a..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/r..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/r..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/r..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/s..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/s..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/s..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/i..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/t..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/c..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/t..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/u..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/u..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/f..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/p..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/l..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/p..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/v..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/f..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/elpa/d..." ...)) (setq exec-path '("c:/Program Files (x86)/Chez Scheme 9.5.4/bin/ti3nt..." "c:/Python310/Scripts/" "C:/Python310/" "C:/app/oracle" "C:/WINDOWS/system32" "C:/WINDOWS" "C:/WINDOWS/System32/Wbem" "C:/WINDOWS/System32/WindowsPowerShell/v1.0/" "C:/WINDOWS/System32/OpenSSH/" ...)) (setq pyim-dcache-directory "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/pyim/d...") (require 'pyim-dhashcache) (pyim-dcache-init-variable pyim-dhashcache-icode2word) (pyim-dhashcache--init-count-and-priority-variables) (maphash (lambda (key value) (puthash key (pyim-dcache-sort-words value) pyim-dhashcache-icode2word)) pyim-dhashcache-icode2word) (pyim-dcache-save-variable 'pyim-dhashcache-icode2word pyim-dhashcache-icode2word) nil))
  async-start((lambda nil (setq load-path '("d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/..." ...)) (setq exec-path '("c:/Program Files (x86)/Chez Scheme 9.5.4/bin..." "c:/Python310/Scripts/" "C:/Python310/" "C:/app/oracle" "C:/WINDOWS/system32" "C:/WINDOWS" "C:/WINDOWS/System32/Wbem" "C:/WINDOWS/System32/WindowsPowerShell/v1.0/" "C:/WINDOWS/System32/OpenSSH/" "C:/Program Files/Microsoft SQL Server/130/To..." "D:/Zero/Software/monolith" "D:/DevTools/Redis-x64-5.0.10" "C:/Program Files/dotnet/" "C:/Program Files (x86)/JoeEditor/" "C:/ProgramData/chocolatey/bin" "C:/Program Files/nodejs/" ...)) (setq pyim-dcache-directory "d:/Zero/Codes/201903/MyEmacsConfig/.emacs.d/...") (require 'pyim-dhashcache) (pyim-dcache-init-variable pyim-dhashcache-icode2word) (pyim-dhashcache--init-count-and-priority-variables) (maphash (lambda (key value) (puthash key (pyim-dcache-sort-words value) pyim-dhashcache-icode2word)) pyim-dhashcache-icode2word) (pyim-dcache-save-variable 'pyim-dhashcache-icode2word pyim-dhashcache-icode2word) nil) #f(compiled-function (_) #<bytecode -0x16a9f0bd01554921>))
  pyim-dhashcache--update-icode2word(nil)
  pyim-dhashcache--update-personal-words(nil)
  #f(compiled-function (&optional force) "读取并加载所有相关词库 dcache.\n\n如果 FORCE 为真,强制加载。" #<bytecode -0x4f4d324cde1bedd>)(nil)
  apply(#f(compiled-function (&optional force) "读取并加载所有相关词库 dcache.\n\n如果 FORCE 为真,强制加载。" #<bytecode -0x4f4d324cde1bedd>) nil)
  pyim-dcache-update(nil)
  pyim-process-init-dcaches()
  pyim-activate("pyim")
  activate-input-method("pyim")
  #<subr toggle-input-method>(nil 1)
  apply(#<subr toggle-input-method> (nil 1))
  evil--refresh-input-method(#<subr toggle-input-method> nil 1)
  apply(evil--refresh-input-method #<subr toggle-input-method> (nil 1))
  toggle-input-method(nil 1)
  funcall-interactively(toggle-input-method nil 1)
  command-execute(toggle-input-method)
doneself commented 2 weeks ago

找到问题所在了, 我设置了(prefer-coding-system 'utf-8-auto), 把它改成首选是(prefer-coding-system 'utf-8-unix), 就能初始化词库。