emacs: expand autocomplete for R function to include namespace

Tag: r , emacs , namespaces , ess Author: dcf47970256 Date: 2013-04-09

Am using EMACS/ESS as editor for R.

I find it helpful to refer to a function defined outside of base with it's relevant namespace; as well as being good practice in general, it seems to be necessary when running R CMD check on a package. I really like autocomplete in EMACS and am wondering if there's a way to extend the functionality to include namespace when autocomplete-ing the name of a function.

For example (in R):

library(stats)

Then in ESS when I start typing dn the autocomplete dnorm appears (greyed out) and I can complete it by pressing TAB.

What would be better is to complete as stats::dnorm or even stats:::dnorm so that I don't need to manually check whether the function I'm using is in base. (For a relatively new user, memorizing the names of all functions in base may be a lot to ask).

Details:

EMACS: 2012-06-10 on MARVINGNU Emacs 24.1.1 (i386-mingw-nt6.1.7601)

ESS version 12.04-4

Icicles (default install c. Oct 2012). Not sure how to find version info. for this.

If this doesn't already exist, any pointers would be welcome. Note this is closely related but if the answer is already there then I'm not quite getting it...