我是一个完全的emacs新手,我正在尝试在我的工作中使用Vincent Goulet的modified emacs (https://vigou3.github.io/emacs-modified-windows/) (主要是R编程和LaTeX)。修改后的emacs安装了ess,我正在尝试让自动完成功能正常工作。
当我输入M-x package-list-packages时,我看不到company-mode或auto-complete (尽管我看到了auto-complete-[other things]和company-[other things],并且我无法安装auto-complete。
我的.emacs文件如下:
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(custom-enabled-themes (quote (tango-dark)))
'(package-selected-packages (quote (auto-auto-indent auto-complete company))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
(setq ess-use-company t)任何让代码自动补全在R中工作的帮助都会非常有帮助。谢谢。
发布于 2018-08-18 07:13:23
这似乎不是ESS的问题,而是R选项的问题。R选项help_type应该设置为"text“而不是"html”(这可能是Windows上的默认设置?)。这可以通过添加options(help_type="text")在.Rprofile配置文件(用户文件应该位于Sys.getenv("HOME"))中设置该选项来更改。
注意,您的配置ess-use-company告诉ESS使用ESS附带的company后端,而不是auto-complete库(两个不同的包,它们在emacs中提供完成)。
您可能想要将(global-company-mode)添加到您的初始化文件中,以使completion运行您的所有缓冲区(或者在您的ess挂钩中启用它)。我还建议您在完成菜单中查找company-quickhelp中的信息。
https://stackoverflow.com/questions/51785776
复制相似问题