Skip to content

Help please: please test timestamping of command history

4 messages · Duncan Murdoch, Martin Maechler

#
[ Moved from R-help]
Duncan Mackay wrote:
I've written a timestamp() function to do the timestamping, but I'd like
some people on platforms other than Windows to take a look -- I can't
test it there.  I'd especially like to hear if trying it on platforms
that don't support history() causes problems.

This needs new internals, so you need to be able to build R to test.

If anyone has the time, could you try applying the attached patch to a
reasonably current R-devel source tree, and send me comments or make
improvements?  Thanks.

Duncan Murdoch

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch
Url: https://stat.ethz.ch/pipermail/r-devel/attachments/20060325/9337e93d/attachment.pl
#
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.

BTW, after applying your patch, for me, compilation ends
prematurely with

gcc -I. -I../../src/include -I../../../R/src/include -I/usr/X11R6/include -I/usr/local/include -DHAVE_CONFIG_H   -g -O3 -pedantic -Wall -Wno-comment -DDEBUG_q -Wcast-align -c ../../../R/src/unix/stubs.c -o stubs.o
../../../R/src/unix/stubs.c: In function `do_addhistory':
../../../R/src/unix/stubs.c:46: warning: implicit declaration of function `ptr_R_addhistory'
../../../R/src/unix/stubs.c:46: error: `rho' undeclared (first use in this function)
../../../R/src/unix/stubs.c:46: error: (Each undeclared identifier is reported only once
../../../R/src/unix/stubs.c:46: error: for each function it appears in.)
../../../R/src/unix/stubs.c:46: warning: return makes pointer from integer without a cast
make[3]: *** [stubs.o] Error 1


Martin
#
On 3/25/2006 11:30 AM, Martin Maechler wrote:
Okay, this compile error is fixed.  I've put a new version of the patch in

http://www.stats.uwo.ca/faculty/murdoch/software/timestamp.patch

I haven't addressed the ESS request above other than changing the 
message prefix to start with ##; I don't know how to detect ESS from 
within an R session.

Duncan Murdoch
#
I managed to get an R build going on a Linux box, and tested the changes 
there.  Now they're committed to R-devel.

Duncan Murdoch
On 3/25/2006 2:58 PM, Duncan Murdoch wrote: