Emacs在工具提示中自动完成ESS而不是缓冲区 [英] Emacs auto-complete for ESS in tooltip instead of buffer
问题描述
我从以下资源中了解到:
- ,但建议不会实际产生相同的解决方案我的设置工具提示。但是对我来说这可能是一个平台问题呢?在Ubuntu 12.04上的海报也是如此 - 对于VitoshKa,Alex Vorobiev和Iqbal Ansari来说,解决方案可能在不同的平台上?您是否使用OS X?
更新3
也许其他诊断:
ac-source-R是在ess-rd.el中定义的变量。
它的值是((前缀。ess-ac-start)
(候选人ess-ac-candidates)
(document. ess-ac-help))
文档:
R函数参数和R对象的组合广告完成源
ac-source-R对象是在ess-rd.el中定义的变量。
它的值是((前缀。ess-symbol-start)
(候选人ess-ac-objects)
(document。ess-ac-help-object))
文档:
R对象的自动完成源
ac-source-R-args是在ess-rd.el中定义的变量。
它的值是((前缀。ess-ac-start-args)
(候选。ess-ac-args)
(document. ess-ac-help-arg))
文档:
R函数参数的自动完成源
[返回]
其中
ess-ac [TAB]
的变量只有...点击< mouse-2>完成选择它。
在此缓冲区中,键入RET以选择近点完成。
可能的完成是:
ess-ac-R-argument-suffix
ess-ac-sources
所以也许问题是我的ESS安装缺少上面定义的所有
ess-ac - *
的东西,如ess-ac-args
等?解决方案所以根据你的意见,在您的emacs配置中没有启用
自动完成
。所以只需启动自动完成
,在你的init文件中添加这样的东西(加载auto-complete)
(全局自动完成模式)
对于ESS,您还需要将
ess-use-auto-complete
设置为t
如下所示(setq ess-use-auto-complete t)
编辑:
ess-use-auto-complete
默认设置为t
所以这一步不是真的需要。
此外,由于您发现此选项令人困惑,我建议您打开一个问题在github回购中,以便维护者可以改进文档(或代码),无论哪个都可以减少混淆。
自动完成有很多配置选项可以读取<一个href =http://cx4a.org/software/auto-complete/manual.html =nofollow>手册时间。
很高兴我可以帮助
I understand from the following resources:
- http://www.emacswiki.org/emacs/ESSAuto-complete
- http://www.emacswiki.org/emacs/AutoComplete
- Emacs autocomplete-mode extension for ESS and R
- Is it possible to get code completion for R in Emacs ESS similar to what is available in Rstudio?
...that I should have access to tooltips for auto-complete help in emacs when using ESS for R development. The last link additionally specifies that it should work out of the box with the latest ESS, and:
From version 12.03 ESS integrates out of the box with auto-complete package.
Three sources ‘ac-source-R-args’, ‘ac-source-R-objects’ and ‘ac-source-R’ are included in ESS distribution. The latest combines previous two and makes them play nicely together.
I know that in general, my emacs tooltips are possible because they appear correctly with my python jedi setup in emacs.
However, my emacs auto-complete does not work. Instead, there is a buffer at the bottom:
instead of this, with the help superimposed on the working buffer:
And I have the following in my init.el:
(require 'auto-complete) (setq ess-use-auto-complete t) (ess-toggle-underscore nil)
I have the following versions of:
ess 20131207.1141 installed No description available. ess-R-data-view 20130509.458 installed Data viewer for GNU R ess-R-object-popup 20130302.336 installed popup description of R object auto-complete 20140208.653 installed Auto Completion for GNU Emacs
What am I missing?
UPDATE 1
Here's my init for ESS stuff. This produces completions in a buffer, but not in a tooltip, where some configuration options from the manual have been added. (I have now tried all permutations of commenting and not commenting all of these):
(require 'auto-complete) (global-auto-complete-mode) (require 'auto-complete-config) (ac-config-default) (require 'ess-site) (setq ess-use-auto-complete t) (setq ac-auto-start 2) (setq ac-auto-show-menu 0.2) (ess-toggle-underscore nil)
UPDATE 2
Similar question here, but the same solution is suggested which did not actually result in tooltips on my setup. But it suggests to me this might be a platform issue? The poster there was also on Ubuntu 12.04 as I am---is it possible the solutions that worked for VitoshKa, Alex Vorobiev, and Iqbal Ansari were on a different platform? Are you guys using OS X?
UPDATE 3
Maybe other diagnostics:
ac-source-R is a variable defined in `ess-r-d.el'. Its value is ((prefix . ess-ac-start) (candidates . ess-ac-candidates) (document . ess-ac-help)) Documentation: Combined ad-completion source for R function arguments and R objects ac-source-R-objects is a variable defined in `ess-r-d.el'. Its value is ((prefix . ess-symbol-start) (candidates . ess-ac-objects) (document . ess-ac-help-object)) Documentation: Auto-completion source for R objects ac-source-R-args is a variable defined in `ess-r-d.el'. Its value is ((prefix . ess-ac-start-args) (candidates . ess-ac-args) (document . ess-ac-help-arg)) Documentation: Auto-completion source for R function arguments [back]
where the variables for
ess-ac[TAB]
are only...Click <mouse-2> on a completion to select it. In this buffer, type RET to select the completion near point. Possible completions are: ess-ac-R-argument-suffix ess-ac-sources
So maybe the problem is my ESS install is lacking all
ess-ac-*
things defined above, likeess-ac-args
, etc?解决方案So as per your comments it turned out that
auto-complete
was not enabled in your emacs config. So just enableauto-complete
by adding something like this in you init file(load "auto-complete") (global-auto-complete-mode)
Also for ESS you will need to set
ess-use-auto-complete
tot
something like following would do(setq ess-use-auto-complete t)
EDIT:
ess-use-auto-complete
is by default set tot
so this step is not really needed.Also since you found this option confusing I would recommend you to open an issue on the github repo so that the maintainers can improve the documentation (or code) whichever can reduce the confusion.
Auto-complete has a lot of configuration options do read the manual when you get time.
Glad I could help
这篇关于Emacs在工具提示中自动完成ESS而不是缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!