Deepayan Sarkar
2006-Oct-23 23:51 UTC
[Rd] ANN/RFC: package providing TAB completion for readline-based R
Announcement: (For those every-once-in-a-while occasions when you run R from a terminal instead of Emacs, and then wish something would happen when you hit TAB...) Last week, I started looking at the GNU Readline documentation to see if I could figure out how to use it for command completion within R. It turned out to be easier than I had expected, and I now have a beta version of the 'rcompletion' package available at http://www.stat.wisc.edu/~deepayan/R/rcompletion_0.0-6.tar.gz>From the help page:Description: This package provides pseudo-intelligent TAB completion for a readline enabled instance of R when it is run from a terminal (or more specifically, an interface which uses readline to accept user input). It has no effect on the various GUI interfaces to R, including ESS and the standard Windows interface. For more details, install and load the package, then type package?rcompletion at the R prompt. Testing and feedback would be appreciated. Feature requests and patches are also welcome, of course. Questions: There are a couple of things about which I would like some advice: (1) The package currently contains a very rudimentary configure script which stops installation when readline is not found. I'm not sure if this is portable enough. .../src/unix/sys-std.c has more sophisticated conditional directives, but I don't know enough about this sort of thing to interpret those. Any thoughts or suggestions on this would be appreciated. (2) What's the recommended procedure to distribute this, given that (a) it's not relevant on Windows (i.e. won't do anything even if it could be installed) and (b) may or may not be relevant on Macs, some of which apparently have a fake readline that doesn't support completion? -Deepayan
Dirk Eddelbuettel
2006-Oct-24 01:50 UTC
[Rd] ANN/RFC: package providing TAB completion for readline-based R
On 23 October 2006 at 16:51, Deepayan Sarkar wrote: [... nice announcement trimmed ...] | There are a couple of things about which I would like some advice: | | (1) The package currently contains a very rudimentary configure script | which stops installation when readline is not found. I'm not sure if | this is portable enough. .../src/unix/sys-std.c has more sophisticated | conditional directives, but I don't know enough about this sort of | thing to interpret those. Any thoughts or suggestions on this would be | appreciated. littler has the same issue for getopt, R itself, R as a dynamic library, .... So far, we are going with 'just bark and stop'. For rcompletion, I hope you simply stick with configure. I don't like the trend of shipping everything again and again (Hi, Seth :) | (2) What's the recommended procedure to distribute this, given that | (a) it's not relevant on Windows (i.e. won't do anything even if it | could be installed) and (b) may or may not be relevant on Macs, some | of which apparently have a fake readline that doesn't support | completion? Again, I also wondered if littler should just pretend to be a CRAN package so that at least the update and compile mechanism works from R (given how we need re-runs of configure and make if something changes as we depend on compile-time 'hard' settings for littler as opposed to env. vars for R). The problem we are facing is that we're unsure how to get to /usr/(local/)/bin from update.packages() ... Given that you'll undoubtedly come up with something clever, Jeff and I will be sure to see if we can mimic it :) Dirk -- Hell, there are no rules here - we're trying to accomplish something. -- Thomas A. Edison
Uwe Ligges
2006-Oct-24 07:53 UTC
[Rd] ANN/RFC: package providing TAB completion for readline-based R
Deepayan Sarkar wrote:> Announcement: > > (For those every-once-in-a-while occasions when you run R from a > terminal instead of Emacs, and then wish something would happen when > you hit TAB...) > > Last week, I started looking at the GNU Readline documentation to see > if I could figure out how to use it for command completion within R. > It turned out to be easier than I had expected, and I now have a beta > version of the 'rcompletion' package available at > > http://www.stat.wisc.edu/~deepayan/R/rcompletion_0.0-6.tar.gz > >>From the help page: > > Description: > > This package provides pseudo-intelligent TAB completion for a > readline enabled instance of R when it is run from a terminal (or > more specifically, an interface which uses readline to accept user > input). It has no effect on the various GUI interfaces to R, > including ESS and the standard Windows interface. > > For more details, install and load the package, then type > > package?rcompletion > > at the R prompt. Testing and feedback would be appreciated. Feature > requests and patches are also welcome, of course. > > > Questions: > > There are a couple of things about which I would like some advice: > > (1) The package currently contains a very rudimentary configure script > which stops installation when readline is not found. I'm not sure if > this is portable enough. .../src/unix/sys-std.c has more sophisticated > conditional directives, but I don't know enough about this sort of > thing to interpret those. Any thoughts or suggestions on this would be > appreciated. > > (2) What's the recommended procedure to distribute this, given that > (a) it's not relevant on Windows (i.e. won't do anything even if it > could be installed) and (b) may or may not be relevant on Macs, some > of which apparently have a fake readline that doesn't support > completion?Distribution can happen regularly as a CRAN package. I will put it on my exclude list in order not to try building Windows binaries in that case. Uwe> -Deepayan > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel