本文介绍了如何在ESS中更改智能分配密钥(“_”到“” - “)绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 在emacs ESS中,如何正确更改ess-smart-S-assign的键盘绑定?我尝试的是添加 (custom-set-variables '(ess-smart-S-assign-key:)) 到我的 .emacs ,但这使奇怪的事情发生:当我按:,只显示正常的:。另一方面,按照 _ 一次就像往常一样产生 ,而按 _ 再次将其转换为:。 所需的行为将是能够使用 _ 作为正常密钥,转换为:到 。 我正在使用官方emacs 24.3的Windows和ESS的最新开发版本解决方案以下是 ess-smart-S-assign-key的文本字符串 文档:`ess-smart- S-分配。默认情况下绑定到下划线,但可以设置为任何键。如果这个键被定制,你必须添加 (ess-toggle-S-assign nil)(ess-toggle-S-assign nil) 在设置定制并评估这些行或重新引导emacs的行之后。第一个呼叫清除默认的`ess-smart-S-assign'分配,第二行将重新分配给自定义设置。 所以:把它放在你的 .emacs 文件以获得所需的行为: (setq ess-smart-S-assign-key:) (ess-toggle-S-assign nil)(ess-toggle-S-assign nil) 这种丑陋,但它有效。 In emacs ESS, how do I correctly change the keybinding for ess-smart-S-assign?What I tried is adding(custom-set-variables '(ess-smart-S-assign-key ":"))to my .emacs, but that made weird things happen: When I press :, just a normal : appears. On the other hand, pressing _ once yields <- as usual, whereas pressing _ a second time then converts this to :.The desired behavior would be to be able to use _ as a normal key, with : being converted to <-.I am using the official emacs 24.3 for windows and the latest development version of ESS (14.06). 解决方案 Here's the docstring for ess-smart-S-assign-key:Documentation:Key used by `ess-smart-S-assign'. By default bound tounderscore, 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 theselines or reboot emacs. The first call clears the default`ess-smart-S-assign' assignment and the second line re-assignsit to the customized setting.So: put this in your .emacs file to get the desired behavior:(setq ess-smart-S-assign-key ":")(ess-toggle-S-assign nil)(ess-toggle-S-assign nil)Kind of ugly, but it works. 这篇关于如何在ESS中更改智能分配密钥(“_”到“” - “)绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-15 05:26