From deepayan.sarkar at gmail.com  Fri Aug 21 20:44:33 2009
From: deepayan.sarkar at gmail.com (Deepayan Sarkar)
Date: Fri, 21 Aug 2009 11:44:33 -0700
Subject: [Rd] more special completions
In-Reply-To: <4A8ED5F6.3070105@dbmail.com>
References: <4A8E66FF.6000201@dbmail.com>
	<eb555e660908210959j17d554bfj4ecff75934ca91fd@mail.gmail.com>
	<4A8ED5F6.3070105@dbmail.com>
Message-ID: <eb555e660908211144l5e1dd544s4c58c7e18186af9d@mail.gmail.com>

On 8/21/09, Romain Francois <romain.francois at dbmail.com> wrote:
> On 08/21/2009 06:59 PM, Deepayan Sarkar wrote:
>
> >
> > On 8/21/09, Romain Francois<romain.francois at dbmail.com>
> wrote:
> >
> > > Hi,
> > >
> > >  Would it be possible to add the capability for functions to register
> how
> > > they would like to complete themselves.
> > >
> > >  Currently, there is the .addFunctionInfo, but it allows only functions
> to
> > > register a static list of potential completions, I was thinking of a way
> to
> > > register not a fixed list of possible completions, but a __function__
> that
> > > would calculate completions dynamically.
> > >
> > >  This could be useful for the "new" function in R, if associated with
> > > something that can retrieve the current list of S4 classes (not sure
> this
> > > exists).
> > >
> > >  Another example of where this could be used would be the .jnew function
> > > from rJava, where the first argument is a java class, associated with
> > > something that can complete java class names.
> > >
> >
> > That should be useful (library, data, etc. are already hard-coded to
> > do special completion, but there is no reason for them to be special).
> > I'll have to think about how best to implement this.
> >
> > I should have time to work in this in a couple of weeks (I also hope
> > to tackle your earlier request on $ completion then).
> >
> > -Deepayan
> >
>
>  Great.
>
>  I guess there are a few challenges, currently library, etc ... only use the
> special completion feature for their first argument.
>
>  it might make sense to expand on this, for example the data argument of a
> lattice call might be interested in the list of available data frames ...

Yes, I'll have to think about it to decide if that's at all feasible
(there are some limitations imposed by backends; readline, ESS, and
the Windows Rgui all do slightly different things).

>  Let me know if I can be of help when you tackle this.

Will do.

-Deepayan



[Rd] more special completions
Deepayan Sarkar