tumashu / pyim

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

禁用的时候出错 #275

Closed shuxiao9058 closed 2 years ago

shuxiao9058 commented 5 years ago

backtrace

Debugger entered--Lisp error: (void-function nil)
  nil()
  deactivate-input-method()
  #f(compiled-function (&optional arg interactive) "Enable or disable multilingual text input method for the current buffer.\nOnly one input method can be enabled at any time in a given buffer.\n\nThe normal action is to enable an input method if none was enabled,\nand disable the current one otherwise.  Which input method to enable\ncan be determined in various ways--either the one most recently used,\nor the one specified by `default-input-method', or as a last resort\nby reading the name of an input method in the minibuffer.\n\nWith a prefix argument ARG, read an input method name with the minibuffer\nand enable that one.  The default is the most recent input method specified\n(not including the currently active input method, if any).\n\nWhen called interactively, the optional argument INTERACTIVE is non-nil,\nwhich marks the variable `default-input-method' as set for Custom buffers." (interactive "P\np") #<bytecode 0x400b6a97>)(nil 1)
  ad-Advice-toggle-input-method(#f(compiled-function (&optional arg interactive) "Enable or disable multilingual text input method for the current buffer.\nOnly one input method can be enabled at any time in a given buffer.\n\nThe normal action is to enable an input method if none was enabled,\nand disable the current one otherwise.  Which input method to enable\ncan be determined in various ways--either the one most recently used,\nor the one specified by `default-input-method', or as a last resort\nby reading the name of an input method in the minibuffer.\n\nWith a prefix argument ARG, read an input method name with the minibuffer\nand enable that one.  The default is the most recent input method specified\n(not including the currently active input method, if any).\n\nWhen called interactively, the optional argument INTERACTIVE is non-nil,\nwhich marks the variable `default-input-method' as set for Custom buffers." (interactive "P\np") #<bytecode 0x400b6a97>) nil 1)
  apply(ad-Advice-toggle-input-method #f(compiled-function (&optional arg interactive) "Enable or disable multilingual text input method for the current buffer.\nOnly one input method can be enabled at any time in a given buffer.\n\nThe normal action is to enable an input method if none was enabled,\nand disable the current one otherwise.  Which input method to enable\ncan be determined in various ways--either the one most recently used,\nor the one specified by `default-input-method', or as a last resort\nby reading the name of an input method in the minibuffer.\n\nWith a prefix argument ARG, read an input method name with the minibuffer\nand enable that one.  The default is the most recent input method specified\n(not including the currently active input method, if any).\n\nWhen called interactively, the optional argument INTERACTIVE is non-nil,\nwhich marks the variable `default-input-method' as set for Custom buffers." (interactive "P\np") #<bytecode 0x400b6a97>) (nil 1))
  toggle-input-method(nil 1)
  funcall-interactively(toggle-input-method nil 1)
  call-interactively(toggle-input-method nil nil)
  command-execute(toggle-input-method)
tumashu commented 5 years ago

看起来你好像对这个函数 advice 了吧?

shuxiao9058 commented 5 years ago

我查了下代码,没在advice设置!

shuxiao9058 commented 5 years ago

是evil设置的!

JSDurand commented 4 years ago

我也遇到了這個問題。 我是透過 doom emacs 的 Chinese module 使用 pyim 的,本來沒什麼問題,是個很好的 package ,不過我使用 toggle-input-method 的時候就會出現如上所述的錯誤;且我無法關掉這個 input-method,在 evil-normal-state 的時候想輸入指令都會被 pyim 解釋成拼音,幾乎無法使用 emacs 。

tumashu commented 3 years ago

evil 启用后,好像有这个问题,今天追踪了一上网,没有头绪。。。。

tumashu commented 3 years ago

我试着hack了一下,也许有用