[ESS] command history and source-is-real [was: Update to modified GNU Emacs]

Vincent Goulet vincent.goulet at act.ulaval.ca
Wed Sep 12 20:39:45 CEST 2007

Le mer. 12 sept. à 10:25, Dan Davison a écrit :

> On Thu, Aug 30, 2007 at 07:53:06PM -0400, Vincent Goulet wrote:
>> Hi all,
>> As a result of this recent thread
>> 	https://stat.ethz.ch/pipermail/ess-help/2007-August/004279.html
>> I made a couple of small additions to my modified GNU Emacs
>> distribution, namely the the following lines to the site
>> configuration (site-start.el) file:
>> =====
>> ;; Following the "source if real" philosophy put forward by ESS, one
>> ;; should not need the command history and should not save the
>> ;; workspace at the end of an R session. Hence, both options are
>> ;; disabled here.
>> (setq-default inferior-R-args "--no-restore-history --no-save ")
> Unless I've misunderstood, this seems to be suggesting that the  
> command history has no role within the "source is real" approach.  
> I'm all for source-is-real, but I think this is taking things too  
> far. Personally I am in the habit of only keeping function  
> definitions in my .R files. My previous commands, that will  
> recreate useful objects, are stored in my command history. Commands  
> pertaining to different projects reside in .Rhistory files in the  
> working directory associated with that project.
> As a consequence I use the command history (and especially the  
> partial matching via comint-previous-matching-input-from-input)  
> intensively. I do admit that this email has given me cause to think  
> again about whether I should do more typing of my function calls  
> into a .R buffer and using the ess-eval* stuff (seeing as that's  
> what I always see others doing...(well, copy and paste at least)).  
> But I don't think the command history should be completely taboo  
> for source-is-real advocates. Apart from anything else the partial  
> matching functionality is really convenient, for going back through  
> a bunch of similar commands.
> Dan

I never use (or rely on) the .Rhistory file. For me, if the command  
is important enough, it should be saved in a .R script file. I would  
think (did not check) that the .Rhistory file is limited in size, so  
the risk of losing an important command is fairly high.

In the course of an R session, I simply rely on Emacs' history system  
to shuffle through past commands (with M-n and M-p) and the R prompt  
--- that is, in iESS mode. What's nice is that if I quit an R session  
without killing the *R* buffer and start a new R session in that same  
buffer, the history of the previous session(s) is preserved.


More information about the ESS-help mailing list