1

我是 emacs 的新手,我正在尝试使用 Vincent Goulet 修改后的 emacs ( https://vigou3.github.io/emacs-modified-windows/ ) 来完成我的工作(主要是R编程和LaTeX)。修改后的 emacsess已安装,我正在尝试自动完成工作。

我在输入时没有看到company-modeor (尽管我看到and ,并且我无法安装.auto-completeM-x package-list-packagesauto-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帮助都会非常有帮助。谢谢你。

4

1 回答 1

1

这似乎不是 ESS 的问题,而是 R 选项。R 选项help_type应设置为“text”而不是“html”(这可能是 Windows 上的默认设置?)。.Rprofile这可以通过在配置文件(用户文件应该位于)中设置选项来更改,方法Sys.getenv("HOME")是添加options(help_type="text").

请注意,您的配置ess-use-company告诉 ESS 使用company与 ESS 捆绑在一起的后端,而不是auto-complete库(两个不同的包在 emacs 中提供完成)。

您可能希望添加(global-company-mode)到您的 init 文件以完成运行所有缓冲区(或在您的 ess 挂钩中启用它)。我还建议company-quickhelp您在完成菜单中查找信息。

于 2018-08-17T23:13:23.143 回答