[ESS] Feature request -- start R automagically

Martin Maechler maechler at stat.math.ethz.ch
Sat May 24 14:37:06 CEST 2008


I've fixed the remaining problem.

It seems to me that (save-excursion ..) partially sucks,
but I could achieve the desired behavior using
(switch-to-buffer ..)

AFAICS,  R is now started automatically in the two scenarios
that were mentioned in this thread.
  --> get ESS  [SVN version r3907]  from the URL below,
      to try it out.
Feedback is welcome,

Martin Maechler, ETH Zurich

>>>>> "MM" == Martin Maechler <maechler at stat.math.ethz.ch>
>>>>>     on Sat, 24 May 2008 13:56:51 +0200 writes:

>>>>> "MM" == Martin Maechler <maechler at stat.math.ethz.ch>
>>>>>     on Sat, 24 May 2008 10:53:09 +0200 writes:

    MM> Salut Vincent, (et al)
>>>>> "VG" == Vincent Goulet <vincent.goulet at act.ulaval.ca>
>>>>> on Fri, 23 May 2008 09:03:41 -0400 writes:

    VG> Hi Martin, Le ven. 23 mai à 02:45, Martin Maechler a
    VG> écrit :

    >>>>>>>>> "MM" == Martin Maechler
    >>>>>>>>> <maechler at stat.math.ethz.ch> on Fri, 9 May 2008
    >>>>>>>>> 17:35:56 +0200 writes:
    >>>> 
    >>>>>>>>> "MR" == Mathieu Ribatet <mathieu.ribatet at epfl.ch>
    >>>>>>>>> on Thu, 08 May 2008 17:37:32 +0200 writes:
    >>>> 
    MR> Dear list, Will it be possible to add the following
    MR> request.  When running emacs with a R script file (or
    MR> any other source
    >>>> file) and
    MR> trying to C-c C-r a region while no R process is
    MR> running, you
    >>>> get the
    MR> following message "Process R is not running".
    >>>> 
    MR> I think it may be convenient if then ESS propose you to
    >>>> launch a new R
    MR> process.
    >>>> 
    MM> I agree, and I had added this feature already a few
    MM> months ago in a different context (Sweave editing) on
    MM> 2007-05-03 { according to lisp/Changelog }.
    >>>> 
    MM> I hope to find time to hack this during the prolonged
    >>>> Pentecoste
    MM> weekend.
    >>>> 
    >>>> and I did not have time then, but last night.
    >>>> 
    >>>> I've commited a change to ESS' development version
    >>>> which automatically starts R if - you are editing an S
    >>>> language buffer [ ess-language is "S" ] which should be
    >>>> the case for all R source files - if your buffer has no
    >>>> associated ess process.

    VG> Shouldn't it be "if there is no *running* ess process" ?

    MM> well, that's yet another feature request !  :-) which
    MM> makes sense, but is not yet implemented.

    MM> I'll see if I can implement it "quickly".  Martin

    MM> It was not quickly, and I don't quite like the result
    MM> yet, but seem not to be able to get it working the way I
    MM> want (at least not without resorting to horrible hacks).

    MM> The current (after you get ESS [ r3905 ] from
    MM> https://svn.r-project.org/ESS/trunk/ ) problem is the
    MM> following:

    MM> Assume an emacs session (in 1 frame) with 2 buffers: Top
    MM> buffer : foobar.R Bottom buffer: *R* where you have
    MM> executed C-c C-q or q("no")

    MM> Now in foobar.R, send a line (C-c C-n) to *R* this now
    MM> restarts R quite nicely, *BUT* I end up with - the two
    MM> buffers are reversed : *R* is now top, foobar.R is
    MM> bottom - Point ("the cursor" / focus) is in the *R*
    MM> buffer instead of in foobar.R at the location where I
    MM> had sent my line.

    MM> This happens inspite of (save-excursion ..) used in many
    MM> places.  If any good Emacs lisp programmers see a
    MM> solution...

    MM> Martin

    >>>> 
    >>>> Consequently, this feature will be in ESS 5.3.8
    >>>> 
    >>>> Martin Maechler, ETH Zurich

    MM> ______________________________________________
    MM> ESS-help at stat.math.ethz.ch mailing list
    MM> https://stat.ethz.ch/mailman/listinfo/ess-help




More information about the ESS-help mailing list