From p.dalgaard at biostat.ku.dk  Thu Apr 10 00:32:17 2008
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Thu, 10 Apr 2008 00:32:17 +0200
Subject: [Rd] autocompletion problem
In-Reply-To: <47FD3697.8070606@fhcrc.org>
References: <47FD3697.8070606@fhcrc.org>
Message-ID: <47FD43F1.1060900@biostat.ku.dk>

Herve Pages wrote:
> Hi,
>
> Let's create the xxx object just to avoid confusion even if it's not necessary
> for reproducing the problem below:
>
>    xxx <- 8:3
>
> If I start typing this:
>
>    max(xxx[
>
> and now try to autocomplete with <TAB>, then I get the following error (and a warning):
>
>    > max(xxx[Error in grep(sprintf("^%s", makeRegexpSafe(text)), allArgs, value = TRUE) :
>      invalid regular expression '^xxx['
>    In addition: Warning message:
>    In grep(sprintf("^%s", makeRegexpSafe(text)), allArgs, value = TRUE) :
>      regcomp error:  'Invalid regular expression'
>
>   
Hmm, looks like makeRegexpSafe(text))  isn't. Presumably, it should 
escape [ along with . and ?
> Now it seems that this problem in R has managed to screw up something out of R (and
> this is probably OS dependent, I'm running 64-bit openSUSE 10.3) because when I quit
> R and try to do something at the shell level, what I type is not echoed anymore in
> the terminal window.
Yes it happens occasionally (not just with R) that you come back to the 
shell level with tty settings out of whack. The pragmatic fix is to 
blind-type the command

stty sane

followed by <Enter> (or ctrl-J if you are paranoid).

>  For example if I type 'whoami' followed by <Enter>, here is what
> I get on the screen (only the output of the command is displayed but not the command
> itself):
>
>    hpages at gopher3:~> hpages
>
> I've tried this with other R versions (2.6.1, 2.6.2) on other Linux flavors (64-bit
> openSUSE 10.1, 32-bit openSUSE 10.3, 32-bit Ubuntu 6.06) and got almost the same thing,
> the only difference being that with older versions of R (e.g. with 2.7.0 from 2007-12-09
> r43632), I get the error message but no additional warning.
>
> Cheers,
> H.
>
>
>  > sessionInfo()
> R version 2.7.0 beta (2008-04-07 r45159)
> x86_64-unknown-linux-gnu
>
> locale:
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>   


-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



[Rd] autocompletion problem
Peter Dalgaard