如何在ESS中更改智能分配键(“ _”到“ <-”)的绑定

jhi*_*hin 1 emacs r key-bindings ess

在emacs ESS中,如何正确更改ess-smart-S-assign的键绑定?

我尝试添加

(custom-set-variables
    '(ess-smart-S-assign-key ":"))
Run Code Online (Sandbox Code Playgroud)

对我而言.emacs,但这使奇怪的事情发生了:当我按时:,仅:显示正常。另一方面,按_一次则<-照常产生,而按_第二次则将其转换为:。所需的行为将是能够_用作普通键,并:转换为<-

我正在使用Windows的官方emacs 24.3和ESS(14.06)的最新开发版本。

Dan*_*Dan 5

这是的文档字符串ess-smart-S-assign-key

Documentation:
Key used by `ess-smart-S-assign'. By default bound to
underscore, but can be set to any key. If this key is customized,
you must add

 (ess-toggle-S-assign nil)
 (ess-toggle-S-assign nil)

after the line that sets the customization and evaluate these
lines or reboot emacs. The first call clears the default
`ess-smart-S-assign' assignment and the second line re-assigns
it to the customized setting. 
Run Code Online (Sandbox Code Playgroud)

所以:将其放入您的.emacs文件中以获得所需的行为:

(setq ess-smart-S-assign-key ":")
(ess-toggle-S-assign nil)
(ess-toggle-S-assign nil)
Run Code Online (Sandbox Code Playgroud)

有点丑陋,但可以。