Emacs ess auto-complete

前端 未结 3 1676
醉话见心
醉话见心 2021-01-15 02:05

I am a R user, I want to use R in emacs. But, I am in trouble with customizing ess in emacs. I have installed the auto-complete packages and the latest ess in my emacs. But

相关标签:
3条回答
  • 2021-01-15 02:26

    I got the same problem and the following code worked for me:

    (require 'package)
    (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
    (package-initialize)  ;load and activate packages, including auto-complete
    (ac-config-default)
    (setq ess-use-auto-complete 'script-only)
    ;;if not working, use the following instead of (setq ess-use-auto-complete 'script-only)
    ;;(global-auto-complete-mode t)
    
    0 讨论(0)
  • 2021-01-15 02:31

    I recently started using ESS on Windows, and struggled with the same issue. I don't know all of the ins and outs but recent versions of ESS suggest using company-mode rather than auto-complete-mode. This minimal setup seems to have autocomplete working quite well for me on the following setup:

    • Windows 10 x64
    • R 3.4.3 x64
    • Emacs 25 x64 installed normally
    • MELPA repo enabled in init.el
    • package-install [RET] company
    • package-install [RET] ess
    • open a new R file in some directory
    • M-x company-mode to enable company-mode in the current buffer
    • `C-c C-z' to start an inferior R process

    At this point, with the init.el file shown below, R completion is working, completing function calls, and package members. I think more configuration is needed to tailor it to your liking, but getting to this point took me long enough I consider it a success

    init.el:

    (require 'package)
    (let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                        (not (gnutls-available-p))))
           (proto (if no-ssl "http" "https")))
      (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
      )
    (package-initialize)
    
    ;; emacs controlled settings
    (custom-set-variables
     '(package-selected-packages (quote (company ess)))
     '(show-paren-mode t)
     '(tool-bar-mode nil))
    (custom-set-faces
     '(default ((t (:family "Consolas" :foundry "outline" :slant normal :weight normal :height 113 :width normal)))))
    
    (require 'company)
    
    0 讨论(0)
  • 2021-01-15 02:32

    Auto-complete works for me with this setting

    (setq ess-use-auto-complete t)
    
    0 讨论(0)
提交回复
热议问题