[ESS] command history and source-is-real [was: Update to modified GNU Emacs]
blindglobe at gmail.com
Thu Sep 13 09:24:56 CEST 2007
On 9/12/07, Vincent Goulet <vincent.goulet at act.ulaval.ca> wrote:
> 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.
What I've always done is to start up a *.R file, type what I would
normally be entering (should I happen to know exactly what I'm
planning) and source it in (load, eval-buffer, or eval-region) while
I'm having coffee (thankfully, European-originating coffee comes in
smaller servings than Seattle-originating coffee). Then it'll be a
matter of working in the source file, and using eval-line and
eval-line-and-step to submit the code I'm using.
if it really is throw-away code (for example, probing for the value of
a function or variable to see what I've really got there quickly) I
*might* directly use the inferior R process. But usually, I tend not
to confuse myself to the point of needing to do such things.
It is very rare that I perform a task that I feel confident that I
don't need to reproduce (not that I have to reproduce the tasks, it's
more about the confidence in not needing to).
blindglobe at gmail.com
"Commit early,commit often, and commit in a repository from which we
can easily roll-back your mistakes" (AJR, 4Jan05).
More information about the ESS-help