pyim最新版使用報錯

emacs28.1,終端環境

相關代碼:

(require 'pyim)
(require 'pyim-tsinghua-dict)

(defun pyim-probe-dynamic-english-custom ()
  (let ((str-before-1 (pyim-char-before-to-string 0))
        (str-before-2 (pyim-char-before-to-string 1)))
    (unless (string= (buffer-name) " *temp*")
      (if (> (point) (save-excursion (back-to-indentation)
                                     (point)))
          (or (if (pyim-string-match-p " " str-before-1)
                  (pyim-string-match-p "\\cc" str-before-2)
                (and (not (pyim-string-match-p "\\cc" str-before-1))
                     (= (length pyim-entered-code) 0))))))))

(defun eh-ivy-cregexp (str)
  (let ((a (ivy--regex-plus str))
        (b (let ((case-fold-search nil))
             (pyim-cregexp-build str))))
    (if (and a (stringp a))
        (concat a "\\|" b)
      a)))
(setq ivy-re-builders-alist
      '((t . eh-ivy-cregexp)))
(pyim-tsinghua-dict-enable)
(setq default-input-method "pyim"
      pyim-default-scheme "quanpin"
      pyim-enable-shortcode nil
      pyim-punctuation-translate-p '(auto yes no)
      pyim-page-tooltip 'popup)

(setq pyim-dcache-backend 'pyim-dregcache)
(setq pyim-page-style 'vertical)
(setq pyim-page-length 5)

(setq-default pyim-english-input-switch-functions
              '(pyim-probe-dynamic-english-custom
                pyim-probe-isearch-mode
                pyim-probe-org-structure-template))
(setq-default pyim-punctuation-half-width-functions
              '(pyim-probe-punctuation-line-beginning
                pyim-probe-punctuation-after-punctuation))

(define-key pyim-mode-map "." 'pyim-page-next-page)
(define-key pyim-mode-map "," 'pyim-page-previous-page)
(define-key pyim-mode-map ";" 'pyim-page-select-word)
(global-set-key (kbd "M-k") 'pyim-convert-code-at-point)

啓動正常,但是切換到pyim進行輸入就報錯,c-x return c-\打開pyim,輸入 sh出現候選框,然後報錯如下:

debugger entered--Lisp error: (wrong-type-argument listp iword2count-recent1)
  memq(icode2word iword2count-recent1)
  (or (memq 'icode2word from) (memq 'ishortcode2word from))
  (if (or (memq 'icode2word from) (memq 'ishortcode2word from)) (pyim-dregcache-get-icode2word-ishortcode2word code) (let ((dict-files (pyim-dregcache-all-dict-files)) result) (if pyim-debug (progn (message "pyim-dregcache-get is called. code=%s" code))) (if dict-files (progn (let ((--dolist-tail-- dict-files)) (while --dolist-tail-- (let (...) (let* ... ...) (setq --dolist-tail-- ...)))))) (nreverse result)))
  pyim-dregcache-get("设" iword2count-recent1)
  apply(pyim-dregcache-get ("设" iword2count-recent1))
  (if (functionp func) (apply func api-args) (if pyim-debug (progn (message "%S 不是一个有效的 dcache api 函数." (symbol-name func)) nil)))
  (let ((func (intern (concat (symbol-name pyim-dcache-backend) "-" (symbol-name api-name))))) (if (functionp func) (apply func api-args) (if pyim-debug (progn (message "%S 不是一个有效的 dcache api 函数." (symbol-name func)) nil))))
  pyim-dcache-call-api(get "设" iword2count-recent1)
  (append (pyim-dcache-call-api 'get code from) (pyim-pymap-py2cchar-get code t t))
  pyim-dcache-get("设" iword2count-recent1)
  (car (pyim-dcache-get word 'iword2count-recent1))
  (or (car (pyim-dcache-get word 'iword2count-recent1)) 0)
  (> (or (car (pyim-dcache-get word 'iword2count-recent1)) 0) 1)
  (closure ((class . quanpin) (common-words) (personal-words "设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" ...) (scheme-name . quanpin) t) (word) (> (or (car (pyim-dcache-get word 'iword2count-recent1)) 0) 1))("设")
  cl--position(nil ("设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" "䤮" ...) 0 nil nil)
  cl-position(nil ("设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" "䤮" ...) :if (closure ((class . quanpin) (common-words) (personal-words "设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" ...) (scheme-name . quanpin) t) (word) (> (or (car (pyim-dcache-get word 'iword2count-recent1)) 0) 1)))
  apply(cl-position nil ("设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" "䤮" ...) (:if (closure ((class . quanpin) (common-words) (personal-words "设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" ...) (scheme-name . quanpin) t) (word) (> (or (car (pyim-dcache-get word 'iword2count-recent1)) 0) 1))))
  cl-find(nil ("设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" "䤮" ...) :if (closure ((class . quanpin) (common-words) (personal-words "设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" ...) (scheme-name . quanpin) t) (word) (> (or (car (pyim-dcache-get word 'iword2count-recent1)) 0) 1)))
  apply(cl-find nil ("设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" "䤮" ...) :if (closure ((class . quanpin) (common-words) (personal-words "设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" ...) (scheme-name . quanpin) t) (word) (> (or (car (pyim-dcache-get word 'iword2count-recent1)) 0) 1)) nil)
  cl-find-if((closure ((class . quanpin) (common-words) (personal-words "设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" ...) (scheme-name . quanpin) t) (word) (> (or (car (pyim-dcache-get word 'iword2count-recent1)) 0) 1)) ("设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" "䤮" ...))
  (or (cl-find-if #'(lambda (word) (> (or (car (pyim-dcache-get word ...)) 0) 1)) personal-words) (cl-find-if #'(lambda (word) (> (or (car (pyim-dcache-get word ...)) 0) 3)) personal-words) (car personal-words))
  (cond ((equal class 'xingma) (or (if (= (length (car common-words)) 1) (progn (car common-words))) (cl-find-if #'(lambda (word) (= (length word) 1)) personal-words))) (t (or (cl-find-if #'(lambda (word) (> (or ... 0) 1)) personal-words) (cl-find-if #'(lambda (word) (> (or ... 0) 3)) personal-words) (car personal-words))))
  (let ((class (pyim-scheme-get-option scheme-name :class))) (cond ((equal class 'xingma) (or (if (= (length (car common-words)) 1) (progn (car common-words))) (cl-find-if #'(lambda (word) (= ... 1)) personal-words))) (t (or (cl-find-if #'(lambda (word) (> ... 1)) personal-words) (cl-find-if #'(lambda (word) (> ... 3)) personal-words) (car personal-words)))))
  pyim-candidates-get-chief(quanpin ("设" "社" "摄" "涉" "射" "折" "舍" "蛇" "舌" "奢" "慑" "辙" "赦" "赊" "佘" "麝" "歙" "畲" "厍" "猞" "铊" "揲" "滠" "阇" "奓" "畬" "䤁" "㵃" "䬦" "挕" "䠟" "䕣" "㓭" "䰥" "涻" "䀹" "輋" "䜆" "䜓" "摵" "䏴" "䀅" "㴇" "欇" "騇" "㰒" "䄕" "攝" "設" "䤮" ...))
  (setq chief-word (pyim-candidates-get-chief scheme-name personal-words))
  (let (jianpin-words znabc-words personal-words common-words pinyin-chars-1 pinyin-chars-2 chief-word) (let ((codes (mapcar #'(lambda (x) (pyim-subconcat x "-")) (mapcar #'(lambda ... ...) imobjs)))) (setq znabc-words (pyim-zip (mapcar #'pyim-dcache-get (pyim-zip codes)) fast-search))) (if (and pyim-enable-shortcode (> (length (car imobjs)) 1)) (progn (let ((--dolist-tail-- imobjs)) (while --dolist-tail-- (let ((imobj ...)) (let* (... ... ... ... ...) (setq jianpin-words ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))))) (let ((--dolist-tail-- imobjs)) (while --dolist-tail-- (let ((imobj (car --dolist-tail--))) (let* ((w1 (pyim-dcache-get ... ...)) (w2 (pyim-dcache-get ... ...)) (w3 (pyim-dcache-get ...)) (w4 (if w3 nil ...))) (setq personal-words (cons w1 personal-words)) (setq common-words (cons w2 common-words)) (setq pinyin-chars-1 (cons w3 pinyin-chars-1)) (setq pinyin-chars-2 (cons w4 pinyin-chars-2))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (setq jianpin-words (pyim-zip (nreverse jianpin-words) fast-search)) (setq personal-words (pyim-zip (nreverse personal-words) fast-search)) (setq common-words (pyim-zip (nreverse common-words) fast-search)) (setq pinyin-chars-1 (pyim-zip (nreverse pinyin-chars-1) fast-search)) (setq pinyin-chars-2 (pyim-zip (nreverse pinyin-chars-2) fast-search)) (setq personal-words (pyim-candidates-sort personal-words)) (setq chief-word (pyim-candidates-get-chief scheme-name personal-words)) (if pyim-debug (progn (print (list :imobjs imobjs :chief-word chief-word :personal-words personal-words :common-words common-words :jianpin-words jianpin-words :znabc-words znabc-words :pinyin-chars-1 (cl-subseq pinyin-chars-1 0 (min (length pinyin-chars-1) 5)) :pinyin-chars-2 (cl-subseq pinyin-chars-2 0 (min (length pinyin-chars-2) 5)))))) (delete-dups (delq nil (cons chief-word (append personal-words jianpin-words common-words znabc-words pinyin-chars-1 pinyin-chars-2)))))
  pyim-candidates-create-quanpin(((("sh" "e" "sh" "e"))) quanpin)
  (let* ((candidates (pyim-candidates-create-quanpin imobjs scheme-name)) (n (length (car candidates))) output) (setq output (cons (car candidates) output)) (while (and (> n 0) (car (setq imobjs (mapcar #'(lambda ... ...) imobjs)))) (let ((candidates (pyim-candidates-create-quanpin imobjs scheme-name))) (setq output (cons (car (pyim-candidates-create-quanpin imobjs scheme-name t)) output)) (setq n (length (car candidates))))) (append (pyim-subconcat (nreverse output) "") candidates))
  (if async (let ((str (string-join (pyim-codes-create (car imobjs) scheme-name)))) (if (< (length str) 1) pyim-candidates (cons (car pyim-candidates) (append (pyim-candidates-search-buffer (pyim-cregexp-build str 3 t)) (cdr pyim-candidates))))) (let* ((candidates (pyim-candidates-create-quanpin imobjs scheme-name)) (n (length (car candidates))) output) (setq output (cons (car candidates) output)) (while (and (> n 0) (car (setq imobjs (mapcar #'... imobjs)))) (let ((candidates (pyim-candidates-create-quanpin imobjs scheme-name))) (setq output (cons (car (pyim-candidates-create-quanpin imobjs scheme-name t)) output)) (setq n (length (car candidates))))) (append (pyim-subconcat (nreverse output) "") candidates)))
  pyim-candidates-create:quanpin(((("sh" "e" "sh" "e"))) quanpin nil)
  funcall(pyim-candidates-create:quanpin ((("sh" "e" "sh" "e"))) quanpin nil)
  (progn (funcall (intern (format "pyim-candidates-create:%S" class)) imobjs scheme-name async))
  (if class (progn (funcall (intern (format "pyim-candidates-create:%S" class)) imobjs scheme-name async)))
  (let ((class (pyim-scheme-get-option scheme-name :class))) (if class (progn (funcall (intern (format "pyim-candidates-create:%S" class)) imobjs scheme-name async))))
  (progn (let ((class (pyim-scheme-get-option scheme-name :class))) (if class (progn (funcall (intern (format "pyim-candidates-create:%S" class)) imobjs scheme-name async)))))
  (if imobjs (progn (let ((class (pyim-scheme-get-option scheme-name :class))) (if class (progn (funcall (intern (format "pyim-candidates-create:%S" class)) imobjs scheme-name async))))))
  pyim-candidates-create(((("sh" "e" "sh" "e"))) quanpin)
  (delete-dups (pyim-candidates-create pyim-imobjs scheme-name))
  (or (delete-dups (pyim-candidates-create pyim-imobjs scheme-name)) (list entered-to-translate))
  (setq pyim-candidates (or (delete-dups (pyim-candidates-create pyim-imobjs scheme-name)) (list entered-to-translate)))
  (let* ((scheme-name (pyim-scheme-name)) entered-to-translate) (setq entered-to-translate (pyim-entered-get 'point-before)) (setq pyim-imobjs (pyim-imobjs-create entered-to-translate scheme-name)) (setq pyim-candidates (or (delete-dups (pyim-candidates-create pyim-imobjs scheme-name)) (list entered-to-translate))) (pyim-process-run-async-timer-reset) (setq pyim-process-run-async-timer (run-with-timer pyim-process-async-delay nil #'pyim-process-run-async)) (let ((autoselector-results (mapcar #'(lambda (x) (if ... ...)) (cl-remove-duplicates pyim-autoselector :from-end t))) result) (cond ((and (pyim-process-self-insert-command-p this-command) (cl-find-if #'(lambda ... ... ...) autoselector-results)) (let* ((str (plist-get result :replace-with)) (pyim-candidates (if ... ... pyim-candidates-last))) (pyim-process-outcome-handle 'candidate) (pyim-process-create-word (pyim-process-get-outcome) t)) (pyim-add-unread-command-events (pyim-entered-get 'point-after)) (pyim-add-unread-command-events last-command-event) (pyim-process-terminate)) ((and (pyim-process-self-insert-command-p this-command) (cl-find-if #'(lambda ... ... ...) autoselector-results)) (let* ((str (plist-get result :replace-with)) (pyim-candidates (if ... ... pyim-candidates))) (pyim-process-outcome-handle 'candidate) (pyim-process-create-word (pyim-process-get-outcome) t)) (pyim-add-unread-command-events (pyim-entered-get 'point-after)) (pyim-process-terminate)) (t (setq pyim-candidate-position 1) (pyim-process-preview-refresh) (pyim-process-page-refresh)))))
  pyim-process-run-1()
  (cond ((or no-delay (not pyim-exhibit-delay-ms) (eq pyim-exhibit-delay-ms 0)) (pyim-process-run-1)) (t (setq pyim-process-run-exhibit-timer (run-with-timer (/ pyim-exhibit-delay-ms 1000.0) nil #'pyim-process-run-1))))
  (if (= (length (pyim-entered-get 'point-before)) 0) (pyim-process-terminate) (if pyim-process-run-exhibit-timer (progn (cancel-timer pyim-process-run-exhibit-timer))) (cond ((or no-delay (not pyim-exhibit-delay-ms) (eq pyim-exhibit-delay-ms 0)) (pyim-process-run-1)) (t (setq pyim-process-run-exhibit-timer (run-with-timer (/ pyim-exhibit-delay-ms 1000.0) nil #'pyim-process-run-1)))))
  pyim-process-run()
  (cond ((pyim-process-input-chinese-p) (save-current-buffer (set-buffer (get-buffer-create pyim-entered-buffer)) (insert (char-to-string last-command-event))) (pyim-process-run)) ((pyim-process-get-candidates) (pyim-process-outcome-handle 'candidate-and-last-char) (pyim-process-terminate)) (t (pyim-process-outcome-handle 'last-char) (pyim-process-terminate)))
  pyim-self-insert-command()
  funcall-interactively(pyim-self-insert-command)
  call-interactively(pyim-self-insert-command)
  (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))
  (progn (setq last-command-event (aref keyseq (1- (length keyseq))) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep))))
  (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq (1- (length keyseq))) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate))
  (let* ((keyseq (read-key-sequence nil nil nil t)) (cmd (lookup-key pyim-mode-map keyseq))) (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq (1- (length keyseq))) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate)))
  (while pyim-process-translating (set-buffer-modified-p modified-p) (let* ((keyseq (read-key-sequence nil nil nil t)) (cmd (lookup-key pyim-mode-map keyseq))) (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq (1- (length keyseq))) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate))))
  (let* ((echo-keystrokes 0) (help-char nil) (overriding-terminal-local-map pyim-mode-map) (input-method-function nil) (input-method-use-echo-area nil) (modified-p (buffer-modified-p)) last-command-event last-command this-command) (setq pyim-process-translating t) (pyim-process-cleanup-input-output) (if key (progn (pyim-add-unread-command-events key))) (while pyim-process-translating (set-buffer-modified-p modified-p) (let* ((keyseq (read-key-sequence nil nil nil t)) (cmd (lookup-key pyim-mode-map keyseq))) (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq (1- ...)) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate)))) (pyim-process-get-outcome nil t t))
  (if (or (integerp key) (null key)) (let* ((echo-keystrokes 0) (help-char nil) (overriding-terminal-local-map pyim-mode-map) (input-method-function nil) (input-method-use-echo-area nil) (modified-p (buffer-modified-p)) last-command-event last-command this-command) (setq pyim-process-translating t) (pyim-process-cleanup-input-output) (if key (progn (pyim-add-unread-command-events key))) (while pyim-process-translating (set-buffer-modified-p modified-p) (let* ((keyseq (read-key-sequence nil nil nil t)) (cmd (lookup-key pyim-mode-map keyseq))) (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq ...) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) (... ... ...))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate)))) (pyim-process-get-outcome nil t t)) (char-to-string key))
  pyim-input-method-1(115)
  (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> (length input-string) 0)) (progn (if input-method-exit-on-first-char (list (aref input-string 0)) (mapcar #'identity input-string)))))
  (unwind-protect (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> (length input-string) 0)) (progn (if input-method-exit-on-first-char (list (aref input-string 0)) (mapcar #'identity input-string))))) (pyim-process-terminate))
  (progn (unwind-protect (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> (length input-string) 0)) (progn (if input-method-exit-on-first-char (list (aref input-string 0)) (mapcar #'identity input-string))))) (pyim-process-terminate)))
  (unwind-protect (progn (unwind-protect (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> (length input-string) 0)) (progn (if input-method-exit-on-first-char (list ...) (mapcar ... input-string))))) (pyim-process-terminate))) (if modified nil (restore-buffer-modified-p nil)))
  (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-modification-hooks t)) (unwind-protect (progn (unwind-protect (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> ... 0)) (progn (if input-method-exit-on-first-char ... ...)))) (pyim-process-terminate))) (if modified nil (restore-buffer-modified-p nil))))
  (if (or buffer-read-only overriding-terminal-local-map overriding-local-map) (list key) (pyim-process-init-ui) (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-modification-hooks t)) (unwind-protect (progn (unwind-protect (let ((input-string ...)) (if (and ... ...) (progn ...))) (pyim-process-terminate))) (if modified nil (restore-buffer-modified-p nil)))))
  pyim-input-method(115)

删除 pyim,重新安装最新版试试

最新的嗎,好,我馬上試試看

還是一樣的,之前安裝的就是最新版本,我看更新時間沒有變化

剛才最小化啓動,還是一樣的錯誤

我试着修复了一下,你可以试试

好的,字數補丁

更新之後,報錯如下:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  1+(nil)
  funcall(1+ nil)
  (cond ((functionp wordcount-handler) (funcall wordcount-handler orig-value)) ((numberp wordcount-handler) wordcount-handler) (t (+ (or orig-value 0) 1)))
  (let* ((orig-value (gethash word pyim-dregcache-iword2count)) (new-value (cond ((functionp wordcount-handler) (funcall wordcount-handler orig-value)) ((numberp wordcount-handler) wordcount-handler) (t (+ (or orig-value 0) 1))))) (if (equal orig-value new-value) nil (puthash word new-value pyim-dregcache-iword2count)))
  pyim-dregcache-update-iword2count("设" 1+)
  apply(pyim-dregcache-update-iword2count ("设" 1+))
  (if (functionp func) (apply func api-args) (if pyim-debug (progn (message "%S 不是一个有效的 dcache api 函数." (symbol-name func)) nil)))
  (let ((func (intern (concat (symbol-name pyim-dcache-backend) "-" (symbol-name api-name))))) (if (functionp func) (apply func api-args) (if pyim-debug (progn (message "%S 不是一个有效的 dcache api 函数." (symbol-name func)) nil))))
  pyim-dcache-call-api(update-iword2count "设" 1+)
  pyim-dcache-update-wordcount("设" 1+)
  (progn (pyim-dcache-update-wordcount word (or wordcount-handler #'1+)))
  (if (> (length word) 0) (progn (pyim-dcache-update-wordcount word (or wordcount-handler #'1+))))
  (let* ((scheme-name (pyim-scheme-name)) (code-prefix (pyim-scheme-get-option scheme-name :code-prefix)) (codes (pyim-cstring-to-codes word scheme-name (or criteria pyim-cstring-to-code-criteria)))) (if (> (length word) 0) (progn (pyim-dcache-update-wordcount word (or wordcount-handler #'1+)))) (let ((--dolist-tail-- codes)) (while --dolist-tail-- (let ((code (car --dolist-tail--))) (if (pyim-string-match-p "[^ a-z-]" code) nil (pyim-dcache-insert-word (if (and ... ...) (propertize word :noexport t) word) (concat (or code-prefix "") code) prepend)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (mapconcat #'(lambda (code) (format "%s -> %s" (concat (or code-prefix "") code) word)) codes "; "))
  (progn (setq word (substring-no-properties word)) (if (pyim-process-select-subword-p) (progn (setq word (pyim-outcome-get-subword word)))) (setq pyim-process-last-created-words (cons word (remove word pyim-process-last-created-words))) (let* ((scheme-name (pyim-scheme-name)) (code-prefix (pyim-scheme-get-option scheme-name :code-prefix)) (codes (pyim-cstring-to-codes word scheme-name (or criteria pyim-cstring-to-code-criteria)))) (if (> (length word) 0) (progn (pyim-dcache-update-wordcount word (or wordcount-handler #'1+)))) (let ((--dolist-tail-- codes)) (while --dolist-tail-- (let ((code (car --dolist-tail--))) (if (pyim-string-match-p "[^ a-z-]" code) nil (pyim-dcache-insert-word (if ... ... word) (concat ... code) prepend)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (mapconcat #'(lambda (code) (format "%s -> %s" (concat (or code-prefix "") code) word)) codes "; ")))
  (if (and (> (length word) 0) (< (length word) 12) (not (pyim-string-match-p "\\CC" word))) (progn (setq word (substring-no-properties word)) (if (pyim-process-select-subword-p) (progn (setq word (pyim-outcome-get-subword word)))) (setq pyim-process-last-created-words (cons word (remove word pyim-process-last-created-words))) (let* ((scheme-name (pyim-scheme-name)) (code-prefix (pyim-scheme-get-option scheme-name :code-prefix)) (codes (pyim-cstring-to-codes word scheme-name (or criteria pyim-cstring-to-code-criteria)))) (if (> (length word) 0) (progn (pyim-dcache-update-wordcount word (or wordcount-handler #'1+)))) (let ((--dolist-tail-- codes)) (while --dolist-tail-- (let ((code ...)) (if (pyim-string-match-p "[^ a-z-]" code) nil (pyim-dcache-insert-word ... ... prepend)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (mapconcat #'(lambda (code) (format "%s -> %s" (concat ... code) word)) codes "; "))))
  pyim-process-create-word("设" t)
  (if (and (not (pyim-process-select-subword-p)) (or (< length-selected-word (length imobj)) (> (length (pyim-process-get-entered 'point-after)) 0))) (progn (save-current-buffer (set-buffer (get-buffer-create pyim-entered-buffer)) (delete-region (point-min) (point)) (insert to-be-translated) (goto-char (pyim-process-next-imelem-position 20 t 1))) (pyim-process-run)) (pyim-process-create-word (pyim-process-get-outcome) t) (pyim-process-terminate) (run-hooks 'pyim-select-finish-hook))
  (let* ((imobj (pyim-process-get-first-imobj)) (length-selected-word (- (length (pyim-process-get-outcome)) (length (pyim-process-get-outcome 1)))) (to-be-translated (string-join (mapcar #'(lambda (w) (concat ... ...)) (nthcdr length-selected-word imobj))))) (if (and (not (pyim-process-select-subword-p)) (or (< length-selected-word (length imobj)) (> (length (pyim-process-get-entered 'point-after)) 0))) (progn (save-current-buffer (set-buffer (get-buffer-create pyim-entered-buffer)) (delete-region (point-min) (point)) (insert to-be-translated) (goto-char (pyim-process-next-imelem-position 20 t 1))) (pyim-process-run)) (pyim-process-create-word (pyim-process-get-outcome) t) (pyim-process-terminate) (run-hooks 'pyim-select-finish-hook)))
  pyim-select-word:pinyin()
  funcall-interactively(pyim-select-word:pinyin)
  call-interactively(pyim-select-word:pinyin)
  (if (and class (functionp func)) (funcall func) (call-interactively #'pyim-select-word:pinyin))
  (let* ((class (pyim-scheme-get-option (pyim-scheme-name) :class)) (func (intern (format "pyim-select-word:%S" class)))) (if (and class (functionp func)) (funcall func) (call-interactively #'pyim-select-word:pinyin)))
  (if (null (pyim-process-get-candidates)) (progn (pyim-process-outcome-handle 'last-char) (pyim-process-terminate)) (let* ((class (pyim-scheme-get-option (pyim-scheme-name) :class)) (func (intern (format "pyim-select-word:%S" class)))) (if (and class (functionp func)) (funcall func) (call-interactively #'pyim-select-word:pinyin))))
  pyim-select-word()
  funcall-interactively(pyim-select-word)
  call-interactively(pyim-select-word)
  (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))
  (progn (setq last-command-event (aref keyseq (1- (length keyseq))) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep))))
  (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq (1- (length keyseq))) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate))
  (let* ((keyseq (read-key-sequence nil nil nil t)) (cmd (lookup-key pyim-mode-map keyseq))) (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq (1- (length keyseq))) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate)))
  (while pyim-process-translating (set-buffer-modified-p modified-p) (let* ((keyseq (read-key-sequence nil nil nil t)) (cmd (lookup-key pyim-mode-map keyseq))) (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq (1- (length keyseq))) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate))))
  (let* ((echo-keystrokes 0) (help-char nil) (overriding-terminal-local-map pyim-mode-map) (input-method-function nil) (input-method-use-echo-area nil) (modified-p (buffer-modified-p)) last-command-event last-command this-command) (setq pyim-process-translating t) (pyim-process-cleanup-input-output) (if key (progn (pyim-add-unread-command-events key))) (while pyim-process-translating (set-buffer-modified-p modified-p) (let* ((keyseq (read-key-sequence nil nil nil t)) (cmd (lookup-key pyim-mode-map keyseq))) (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq (1- ...)) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) ((debug error) (message "pyim 出现错误: %S , 开启 debug-on-error 后可以了解详细情况。" err) (beep)))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate)))) (pyim-process-get-outcome nil t t))
  (if (or (integerp key) (null key)) (let* ((echo-keystrokes 0) (help-char nil) (overriding-terminal-local-map pyim-mode-map) (input-method-function nil) (input-method-use-echo-area nil) (modified-p (buffer-modified-p)) last-command-event last-command this-command) (setq pyim-process-translating t) (pyim-process-cleanup-input-output) (if key (progn (pyim-add-unread-command-events key))) (while pyim-process-translating (set-buffer-modified-p modified-p) (let* ((keyseq (read-key-sequence nil nil nil t)) (cmd (lookup-key pyim-mode-map keyseq))) (if (if key (commandp cmd) (pyim-process-self-insert-command-p cmd)) (progn (setq last-command-event (aref keyseq ...) last-command this-command this-command cmd) (setq key t) (condition-case err (call-interactively cmd) (... ... ...))) (pyim-add-unread-command-events (this-single-command-raw-keys) t) (pyim-process-terminate)))) (pyim-process-get-outcome nil t t)) (char-to-string key))
  pyim-input-method-1(115)
  (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> (length input-string) 0)) (progn (if input-method-exit-on-first-char (list (aref input-string 0)) (mapcar #'identity input-string)))))
  (unwind-protect (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> (length input-string) 0)) (progn (if input-method-exit-on-first-char (list (aref input-string 0)) (mapcar #'identity input-string))))) (pyim-process-terminate))
  (progn (unwind-protect (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> (length input-string) 0)) (progn (if input-method-exit-on-first-char (list (aref input-string 0)) (mapcar #'identity input-string))))) (pyim-process-terminate)))
  (unwind-protect (progn (unwind-protect (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> (length input-string) 0)) (progn (if input-method-exit-on-first-char (list ...) (mapcar ... input-string))))) (pyim-process-terminate))) (if modified nil (restore-buffer-modified-p nil)))
  (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-modification-hooks t)) (unwind-protect (progn (unwind-protect (let ((input-string (pyim-input-method-1 key))) (if (and (stringp input-string) (> ... 0)) (progn (if input-method-exit-on-first-char ... ...)))) (pyim-process-terminate))) (if modified nil (restore-buffer-modified-p nil))))
  (if (or buffer-read-only overriding-terminal-local-map overriding-local-map) (list key) (pyim-process-init-ui) (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-modification-hooks t)) (unwind-protect (progn (unwind-protect (let ((input-string ...)) (if (and ... ...) (progn ...))) (pyim-process-terminate))) (if modified nil (restore-buffer-modified-p nil)))))
  pyim-input-method(115)

不過候選框是正常了,只是上屏報錯,一直按空格或者選候選序號,最後上屏一串重複漢字

多次測試,就是無法上屏,一上屏就報錯,使用古老的eim是正常的,只是功能太少了.

再更新,我记得这个问题我修复了

馬上更新,字數補丁

我一般用 pyim-dhashcache后端,这段时间重构特别多,regcache后端测试的少了 :rofl:

1 个赞

正常使用了,只是感覺有點延遲

有沒有可能像eim在minibuffer候選呢?

dregcache虽然消耗内存小,不能使用太大的词库

dhashcache速度快,但消耗内存

可以用minibuffer, 看看readme, 有说明

我用的詞庫2.8兆,應該不大吧,好,謝謝

这个词库应该不大

估計是手機性能不夠,我先研究一下,謝謝幫忙

:rofl: :rofl: :rofl: :rofl: :rofl: :rofl: