好的,字數補丁
更新之後,報錯如下:
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是正常的,只是功能太少了.