From maechler at stat.math.ethz.ch  Mon Mar 27 08:47:38 2006
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Mon, 27 Mar 2006 08:47:38 +0200
Subject: [Rd] Help please: please test timestamping of command history
In-Reply-To: <44257DBE.2050000@stats.uwo.ca>
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>
Message-ID: <17447.35466.623764.281536@stat.math.ethz.ch>

[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.

Martin



[Rd] Help please: please test timestamping of command history
Martin Maechler