【发布时间】:2023-03-10 20:56:01
【问题描述】:
我是 emacs 的新手,我正在尝试使用 Vincent Goulet 修改后的 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 中自动完成代码的任何帮助都会非常有帮助。谢谢。
【问题讨论】:
-
@jenesaisquoi - 感谢您的评论,我认为安装
auto-complete后我可以自动完成,但?或help会自动在网络浏览器中为我打开,可以这种行为被控制在R本身中打开?谢谢! -
谢谢,是的,
?print中的R解释器将打开 Web 浏览器,而不是在解释器本身中显示帮助。 -
这是我做
(print inferior-ess-help-command),然后Ctrl-j(获取变量的值)时得到的结果-"utils::help(\"%s\") " "utils::help(\"%s\") " -
嗯..
getOption("help_type")给出"html"。我在C:\Program Files\R\R-3.5.0\library\base\R的“Rprofile”文件中更改了它,使用options(help_type = "text")并重新启动emacs,仍然是同样的问题。但是,如果我在解释器中输入相同的内容,我会看到?的帮助现在在新缓冲区中打开。 -
在
C:\Program Files\R\R-3.5.0\etc\Rprofile.site中将选项更改为文本(它已经存在,仅评论)有效!