User manual

Chapter 9: Completion 47
9.2 Completion of function arguments
When inside a function call (i.e. following (’), TAB completion also provides function
arguments. If function is a generic, completion will provide all the arguments of S3 methods
known to R.
A related functionality is See Section 11.1 [ESS ElDoc], page 56, which displays function
arguments in the echo area whenever the point is inside a function call.
9.3 Minibuffer completion
From version 12.03, ESS uses IDO mechanism (part of default emacs) for minibuffer com-
pletion if ido.el package is available and the value of ess-use-ido it t (the default).
The completion command ess-completing-read falls back on classic completion-read
interface if this feature is not available for whatever reason.
9.4 Integration with auto-complete package
ESS provides three sources for Auto Completion mode: ac-source-R-args, ac-
source-R-objects and ac-source-R. The last one combines the previous two
and makes them play nicely together. See auto-complete package documentation
(http://cx4a.org/software/auto-complete/) for how to modify and install your own
completion sources.
For the default auto-complete ESS configuration, install the latest version of auto-
complete package. ESS automatically detect the package and activates auto-complete in
ESS buffers.
To deactivate AC, place the following into your init file:
(setq ess-use-auto-complete nil)
Or, to activate auto-completion only in the ess-mode buffers:
(setq ess-use-auto-complete ’script-only)
ESS provides AC help both for arguments and objects (default keys C-? or <f1>). You
can bind M-h to display quick help pop-ups:
(define-key ac-completing-map (kbd "M-h") ’ac-quick-help)
AC binds M-n, and M-p for the navigation in the completion menu, which might be
inconvenient if you want it to use in the inferior R. Bind it to something else:
(define-key ac-completing-map "\M-n" nil) ;; was ac-next
(define-key ac-completing-map "\M-p" nil) ;; was ac-previous
(define-key ac-completing-map "\M-," ’ac-next)
(define-key ac-completing-map "\M-k" ’ac-previous)
9.5 Icicles
Another option for comprehensively handling completion in Emacs is via Icicles
(http://www.emacswiki.org/emacs/Icicles). It allows users to have completions shown
temporarily in the standard *Completions* buffer, and interactively select completion
candidates using several methods. As of version 2013.04.04, Icicles provides support for
completion in ESS. Please consult Icicles documentation, which is easily accessible via
customize-group Icicles, for more details on installation and customization options.