[ESS] ess auto-complete does not work well

Vitalie Spinu spinuvit at gmail.com
Sat Jun 2 11:40:25 CEST 2012

  >> 该走了 <gaizoule at gmail.com>
  >> on Sat, 2 Jun 2012 11:28:09 +0800 wrote:

  > Hi everyone, I found that ess with auto-complete does not work well,
  > firstly it does not include default auto-complete list,
  > for example, when you have written some code in [ESS]
  > it does not detect what you have written and add something written to the
  > ac-soruce ,
  > however the default auto-complete does.

This is intentional, you will have a lot of junk popping up every time
you type something (even after first letter). There is a bug in
auto-complete package which makes this happen.

If you want words from the buffer, place this into your ess-mode-hook:

  (add-to-list 'ac-sources 'ac-source-words-in-buffer t)

To avoid ac popping after first characters do 

(defvar  ac-source-R
  '((prefix     . ess-ac-start)
    (requires   . 2)  ;;; <- this one is 0 by default
    (candidates . ess-ac-candidates)
    (document   . ess-ac-help)
  "Auto-completion source for R function arguments"

The disadvantage is that you won't see the function argument comletion
after "(" and ",". I am considering this as a default for the next
release of ESS. Then the default sources will be included as well.

  > secondly when you load some packages in [ESS], i mean for example you
  > write "library(compiler)" in [ESS] and C-c C-j send the line to
  > [iESS], then you input "cmp" into [ESS], the auto-complete does
  > not work unless compiler is the first packages when you load this
  > way. There is something wrong in formatting ac-source when load
  > several packages from [ESS].

This is know issue and it is not an ess-ac problem per se. It's and
imperfect tracking of changes of the R's search path. There are plans to
rewrite this system for the next release. So it will be solved soon.


More information about the ESS-help mailing list