From rpeng at jhsph.edu  Fri Apr 13 23:25:23 2007
From: rpeng at jhsph.edu (Roger Peng)
Date: Fri, 13 Apr 2007 17:25:23 -0400
Subject: [Rd] directory/filename completion
In-Reply-To: <Pine.LNX.4.64.0704132039290.16284@gannet.stats.ox.ac.uk>
References: <461FC3AA.9010204@jhsph.edu>
	<f8e6ff050704131231u18f0a2efo9d1102895318f7c2@mail.gmail.com>
	<Pine.LNX.4.64.0704132039290.16284@gannet.stats.ox.ac.uk>
Message-ID: <461FF543.90203@jhsph.edu>

Okay, I wasn't sure if it was definitely related to rcompgen or was a 
result of something else.  At least I can turn it off then.

Thanks,
-roger

Prof Brian Ripley wrote:
> On Fri, 13 Apr 2007, hadley wickham wrote:
> 
>> On 4/13/07, Roger Peng <rpeng at jhsph.edu> wrote:
>>
>>> I've noticed something recently in R-beta that has changed since R 2.4.1
>>> and I'm not sure if it's a readline problem or an R problem.  I am on a
>>> Linux FC5 system and in R 2.4.1 I could do
>>>
>>> load("my-directory/
>>>
>>> and then hit TAB and it would list all of the files in 'my-directory',
>>> after which I could start typing the beginning of the file, hit TAB
>>> again, and it would complete the file name along with adding the closing
>>> double quote.
>>>
>>> In R-beta, when I try the same thing, nothing happens (i.e. no directory
>>> listing and no file name completion).  Specifically, if I type
>>>
>>> load("my
>>>
>>> and then it TAB, it will complete the 'my-directory' but it will not
>>> look further into the files inside of 'my-directory'.
>>>
>>> Also, I've noticed that if I rename 'my-directory' to 'mydirectory' (so
>>> no dash), everything works fine (just like in R 2.4.1).
>>>
>>> Has anyone else noticed this?
>>
>>
>> I've noticed that if I have the rcompgen library loaded - perhaps
>> you've installed that recently?
> 
> 
> Loading rcompgen is the default uner 2.5.0 beta, but you can turn it 
> off. This is in the USER-VISIBLE CHANGES in NEWS: just how prominent 
> does it need to be?
> 
> It is a feature of the rcompletion interface to rcompgen, now part of 
> base R.  From the source code comment
> 
>        These break line into tokens.  Unfortunately, this also breaks
>        file names, so a path with a - in it will not be completed.
> 
> We decided to make this the default in 2.5.0 to get user feedback: if it 
> was not switched on few people would use it.
> 

-- 
Roger D. Peng  |  http://www.biostat.jhsph.edu/~rpeng/



[Rd] directory/filename completion
Roger Peng