我是emacs的新手,我正在尝试使用Vincent Goulet的修改后的emacs(https://vigou3.github.io/emacs-modified-windows/)进行工作(主要是R
编程和LaTeX
)。修改后的emacs已安装ess
,我正在尝试自动完成工作。
我在键入company-mode
时看不到auto-complete
或M-x package-list-packages
(尽管我看到了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
中工作的帮助都将非常有用。谢谢。
答案 0 :(得分:1)
这似乎不是ESS的问题,而是R选项。 R选项help_type
应该设置为“ text”而不是“ html”(在Windows上可能是默认值?)。可以通过添加.Rprofile
来设置Sys.getenv("HOME")
配置文件中的选项(用户文件应位于options(help_type="text")
中)来更改。
请注意,您的配置ess-use-company
告诉ESS使用ESS附带的company
后端,而不是auto-complete
库(两个在emacs中提供完成功能的软件包)。 / p>
您可能想将(global-company-mode)
添加到您的init文件中,以使所有缓冲区运行完成(或在ess挂钩中启用它)。我还建议您在完成菜单中查看company-quickhelp
中的信息。