tumashu / pyim-wbdict

Wubi dicts for pyim
11 stars 13 forks source link

五笔双字上字报错 #14

Open yzcj105 opened 2 years ago

yzcj105 commented 2 years ago

谢谢有这个输入法,真的解决了中英与evil中mode双重切换的混乱。

当用五笔单字输入时(每字4码)完全正常。 当用五笔双字输入时,如输入”问题“ukjg时,会报错,打开debug-on-error后,信息如下:

Debugger entered--Lisp error: (void-function pyim-dcache-code-split)
  pyim-dcache-code-split("wubi/ukjg")
  #f(compiled-function (x) #<bytecode 0x1fdfcd44e9a9>)("wubi/ukjg")
  cl-remove(nil ("wubi/ukjg") :if-not #f(compiled-function (x) #<bytecode 0x1fdfcd44e9a9>))
  apply(cl-remove nil ("wubi/ukjg") :if-not #f(compiled-function (x) #<bytecode 0x1fdfcd44e9a9>) nil)
  cl-remove-if-not(#f(compiled-function (x) #<bytecode 0x1fdfcd44e9a9>) ("wubi/ukjg"))
  pyim-cstring-to-xingma("问题" wubi t)
  pyim-cstring-to-codes("问题" wubi "wubi/ukjg")
  pyim-process-create-word("问题" t)
  pyim-select-word:xingma()
  pyim-select-word()
  pyim-select-word-by-number()
  funcall-interactively(pyim-select-word-by-number)
  call-interactively(pyim-select-word-by-number)
  pyim-input-method-1(117)
  pyim-input-method(117)

目前使用doom-emacs, 配置如下

;;;; Chinese Input Method
(require 'pyim)

(setq default-input-method "pyim")

;; 金手指设置,可以将光标处的编码,比如:拼音字符串,转换为中文。
(global-set-key (kbd "M-j") 'pyim-convert-string-at-point)

;; 按 "C-<return>" 将光标前的 regexp 转换为可以搜索中文的 regexp.
(define-key minibuffer-local-map (kbd "C-<return>") 'pyim-cregexp-convert-at-point)

;;(pyim-default-scheme 'quanpin)
 (pyim-default-scheme 'wubi)
;; (pyim-default-scheme 'cangjie)

;; pyim 探针设置
;; 设置 pyim 探针设置,这是 pyim 高级功能设置,可以实现 *无痛* 中英文切换 :-)
;; 我自己使用的中英文动态切换规则是:
;; 1. 光标只有在注释里面时,才可以输入中文。
;; 2. 光标前是汉字字符时,才能输入中文。
;; 3. 使用 M-j 快捷键,强制将光标前的拼音字符串转换为中文。
;; (setq-default pyim-english-input-switch-functions
;;               '(pyim-probe-dynamic-english
;;                 pyim-probe-isearch-mode
;;                 pyim-probe-program-mode
;;                 pyim-probe-org-structure-template))

;; (setq-default pyim-punctuation-half-width-functions
;;               '(pyim-probe-punctuation-line-beginning
;;                 pyim-probe-punctuation-after-punctuation))

;; 开启代码搜索中文功能(比如拼音,五笔码等)
(pyim-isearch-mode 1)

;; 显示5个候选词。
(setq pyim-page-length 5)

;; Basedict
;;(require 'pyim-basedict)
;;(pyim-basedict-enable)

(pyim-wbdict-v86-enable) ;86版五笔用户使用这个命令
;;(pyim-wbdict-v86-single-enable) ;86版五笔用户使用这个命令,该词库为单字词库,以尽可能不重码减少选词需要为目的

(setq pyim-page-tooltip 'popup)
;;(setq pyim-page-tooltip 'posframe)

;;; The end of Chinese Input Method
tumashu commented 2 years ago

重装一下 pyim 试试