emacsessmelpa

auto-complete installation emacs


I am a complete newbie to emacs and I am trying to use Vincent Goulet's modified emacs (https://vigou3.github.io/emacs-modified-windows/) for my work (mostly R programming and LaTeX). The modified emacs comes with ess installed and I am trying to get auto-complete to work.

I don't see company-mode or auto-complete in the when I type M-x package-list-packages (although I see auto-complete-[other things] and company-[other things], and I am not able to install auto-complete.

My .emacs file is as follows:

;; 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)

Any help in getting auto completion of code to work in R would be really helpful. Thank you.


Solution

  • This doesn't appear to be an issue with ESS but with R options. The R option help_type should be set to "text" instead of "html" (which may be default on Windows?). This can be changed by setting the option in your .Rprofile configuration file (the user file should be located at Sys.getenv("HOME")) by adding options(help_type="text").

    Note that your configuration ess-use-company is telling ESS to use the company backend that comes bundled with ESS and not the auto-complete library (two different packages that provide completion in emacs).

    You may want to add (global-company-mode) to your init file to have completion running all your buffers (or enable it in your ess hook). I would also recommend looking into company-quickhelp for info in your completion menu.