From murdoch at stats.uwo.ca  Mon Mar 27 13:54:01 2006
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Mon, 27 Mar 2006 06:54:01 -0500
Subject: [Rd] Help please: please test timestamping of command history
In-Reply-To: <17447.35466.623764.281536@stat.math.ethz.ch>
References: <002001c64ee8$415b9ce0$c1e66081@bio.flinders.edu.au>	<4424D394.7050204@stats.uwo.ca>	<17445.28707.485402.183387@stat.math.ethz.ch>	<44257DBE.2050000@stats.uwo.ca>
	<17447.35466.623764.281536@stat.math.ethz.ch>
Message-ID: <4427D259.2000201@stats.uwo.ca>

On 3/27/2006 1:47 AM, Martin Maechler wrote:
> [from a semi-private diversion of the R-devel thread ]
> 
>>>>>> "Duncan" == Duncan Murdoch <murdoch at stats.uwo.ca>
>>>>>>     on Sat, 25 Mar 2006 12:28:30 -0500 writes:
> 
>     Duncan> On 3/25/2006 11:30 AM, Martin Maechler wrote:
>     >> Hi Duncan,
>     >> 
>     >> I think all ESS users don't use history() because ESS
>     >> calls R with "--no-readline" (Unix) or "--ess" (Windows &
>     >> Cygwin)
>     >> 
>     >> I'd wish that in that case, and probably also in BATCH
>     >> mode, timestamp() should write the time stamp prefixed by
>     >> "##" to the "R console" (to R's stdout); when people are
>     >> using ESS properly, then rather than wanting a history,
>     >> they save the R's buffer ("*R*") as "R transcript" (file
>     >> typically ending with ".Rt" or ".Rout") and it makes much
>     >> sense to have a time stampe entry in that file when
>     >> others would want an entry in the history.
> 
>     Duncan> Thanks, that's a good suggestion.  Do you know what
>     Duncan> the test is for this state, in either R or C code?
>     Duncan> capabilities() doesn't do it.  Does ESS make itself
>     Duncan> known to R code somehow?
> 
> Yes, when ESS starts  R (or S+) , it also issues 
> 
>   options(STERM='iESS')
> 
> and we (ESS core) thought that other GUIs / IDEs ideally should
> also set "STERM"  - which AFAIK hasn't been adopted widely.
> 
> hence   if ( identical("iESS", getOption("STERM")) )  { 
> 	   ## are running 'inside ESS'
>         }
> 
> should be pretty reliable.

Thanks.  The version that I committed yesterday defaulted to writing the 
timestamp to the console as well as the history.  Could you take a look, 
and let me know if some special ESS behaviour is still needed?

Duncan



[Rd] Help please: please test timestamping of command history
Duncan Murdoch