From maechler at stat.math.ethz.ch  Fri Jan 30 18:16:52 2004
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Fri Jan 30 18:18:29 2004
Subject: [Rd] savehistory() for ESS {was "ess and debug package"}
In-Reply-To: <16410.21648.72700.104022@bushmills.inf.ed.ac.uk>
References: <Law11-F64fCHJr1Wtyi00013523@hotmail.com>
	<16410.21648.72700.104022@bushmills.inf.ed.ac.uk>
Message-ID: <16410.37252.202283.966974@gargle.gargle.HOWL>

>>>>> "StEgl" == Stephen Eglen <stephen@inf.ed.ac.uk>
>>>>>     on Fri, 30 Jan 2004 12:56:48 +0000 writes:

    >> I was trying to use the new debug package from within emacs, I get the 
    >> following error:
    >> >library(debug)
    >> Loading required package: mvbutils
    >> MVBUTILS: no "tasks" vector found in ROOT
    >> MVBUTILS loaded OK
    >> Loading required package: tcltk
    >> >mtrace(glm) # turns tracing on
    >> >names( tracees) # "glm"
    >> [1] "glm"
    >> >names( tracees) # "glm"
    >> [1] "glm"
    >> >glm(stupid.args) # voila le debugger
    >> Error in savehistory(file) : no history available to save
    >> 
    >> Has anybody been more succesfull?

    StEgl> I also just tried this sequence from Angel, and got the same error
    StEgl> with the CVS version of ESS.  (The sequence works fine when running R
    StEgl> from an xterm.)

Yes, as the above error message suggests, the problem is when
calling  savehistory() inside ESS.

As usual, in these cases, people are encouraged to read the help
page on such a command
... ;-) ... and  ?savehistory contains

  >> Details:
  >> 
  >>      This works under the 'readline' and GNOME interfaces, but not if
  >>      'readline' is not available (for example, in batch use).

Now it seems not everyone is aware that the readline interface
is turned off for ESS (using "R --no-readline") very much on
purpose -- not only for efficiency reasons, but also (and
mainly) because of very unwanted automagic command completion
behaviour of readline. 

To be honest, I don't see an easy solution to this problem but
am wondering if it was conceivable to enhance the R command line
by allowing to make use of the "history"-part of readline and
disabling everything else.

Martin


[Rd] savehistory() for ESS {was "ess and debug package"}
Martin Maechler