Deepayan Sarkar
2006-Oct-31 04:10 UTC
[R] [R-pkgs] rcompletion: TAB completion for the R command line
CRAN now has a package called rcompletion that attempts to provide TAB completion for R using the GNU readline library, intended for R sessions run from a command line. From the package 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. The package does not compile on a standard Windows box, and there is no Windows binary available for it. For more usage details, install and load the package, then type package?rcompletion at the R prompt. The manual is also available online at http://cran.r-project.org/doc/packages/rcompletion.pdf Notes: To install and use the package successfully, you need: (1) R compiled with readline, and run with readline enabled (2) the rcompletion package compiled with readline The rcompletion package comes with a configure script that tries to detect readline on the system and aborts if it is unsuccessful in doing so. There have been no reports so far of false positives (i.e. detecting readline when it shouldn't). However, there are known cases of false negatives, i.e. installation failing when it shouldn't. If this happens to you, any information you can provide to help resolve the problem would be appreciated. If step (2) appears to be successful but (1) is not true (e.g. R is run with --no-readline), nothing bad (but nothing good either) should happen. -Deepayan _______________________________________________ R-packages mailing list R-packages at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-packages
Alexandre Aguiar
2006-Oct-31 21:43 UTC
[R] [R-pkgs] rcompletion: TAB completion for the R command line
Hi, I've tried to compile rcompletion and perhaps have detected the reason for failures, although I haven't succeeded yet. Em Ter 31 Out 2006 02:10, Deepayan Sarkar escreveu:> However, there are known cases > of false negatives, i.e. installation failing when it shouldn't. If > this happens to you, any information you can provide to help resolve > the problem would be appreciated.>From config.lo generated by rcompletion configure-------------------8><-------------------- /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libreadline.so: undefined reference to `tgetnum' /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libreadline.so: undefined reference to `tgoto' /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libreadline.so: undefined reference to `tgetflag' /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libreadline.so: undefined reference to `BC' /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libreadline.so: undefined reference to `tputs' /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libreadline.so: undefined reference to `PC' /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libreadline.so: undefined reference to `tgetent' /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libreadline.so: undefined reference to `UP' /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../libreadline.so: undefined reference to `tgetstr' -------------------8><-------------------- It seems configure can't figure where to find these functions.>From readline5.0 configure script-------------------8><-------------------- checking for tgetent... no checking for tgetent in -ltermcap... no checking for tgetent in -ltinfo... no checking for tgetent in -lcurses... yes checking which library has the termcap functions... using libcurses -------------------8><-------------------- The unresolved function calls (and perhaps symbols of other types) may be located at libcurses. At least in my system they are.>From termcap.h-------------------8><-------------------- #undef NCURSES_VERSION #define NCURSES_VERSION "5.5" #include <ncurses_dll.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include <sys/types.h> #undef NCURSES_CONST #define NCURSES_CONST /*nothing*/ #undef NCURSES_OSPEED #define NCURSES_OSPEED short extern NCURSES_EXPORT_VAR(char) PC; extern NCURSES_EXPORT_VAR(char *) UP; extern NCURSES_EXPORT_VAR(char *) BC; extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed; #if !defined(NCURSES_TERM_H_incl) extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **); extern NCURSES_EXPORT(char *) tgoto (const char *, int, int); extern NCURSES_EXPORT(int) tgetent (char *, const char *); extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *); extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *); extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int)); #endif -------------------8><-------------------- May be your configure needs some rewriting to include a check for the location of unknown symbols like readline's configure does. Best wishes, -- Alexandre Aguiar Independent consultant for medical research SPS Consultoria Voice: +55-11-9320-2046 Fax: +55-11-5549-8760
Deepayan Sarkar
2006-Nov-03 00:27 UTC
[R] [R-pkgs] rcompletion: TAB completion for the R command line
Just a quick follow-up. Thanks to Simon Urbanek and hints from Alexandre Aguiar, CRAN now has a version (0.0-10) of rcompletion that should work on more systems. If it still doesn't work when you think it should, please let me know. -Deepayan On 10/30/06, Deepayan Sarkar <deepayan.sarkar at gmail.com> wrote:> CRAN now has a package called rcompletion that attempts to provide TAB > completion for R using the GNU readline library, intended for R > sessions run from a command line. From the package help page: > ..._______________________________________________ R-packages mailing list R-packages at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-packages