[ESS] stepping through code with C-c C-c

Andreas Leha andreas.leha at med.uni-goettingen.de
Fri Dec 5 10:49:41 CET 2014


Hi,

I do have a related question.  Would it be possible to add support for
syntactic blocks (e.g. for-loops, apply, plyr, dplyr statements)?  This
is mostly equivalent to support for {} or () bounded blocks.

Of course these blocks can be nested, so I would love to see a function
to interactively mark syntactic regions.  Maybe starting with visually
highlighting the innermost block and providing commands to widen/narrow
the region.
When the region is selected, C-c C-r would evaluate that.  

(It's been a long while since I did some lisp.  But I seem to remember
a lot of such functionality there -- where it is admittedly a
considerably easier concept)

Do I make sense at all?  Or is something similar already in place?

Regards,
Andreas


Andreas Leha <andreas.leha at med.uni-goettingen.de> writes:
> Hi Vitalie,
>
> Thank you very much for taking this on!
>
> Regards,
> Andreas
>
>
> Vitalie Spinu <spinuvit at gmail.com> writes:
>> It's annoying indeed. And this is not the only example. I have created a
>> new issue (https://github.com/emacs-ess/ESS/issues/124) and will be
>> adding examples as I encounter them. Please keep adding as well.
>>
>>   Vitalie
>>
>>  >>> Andreas Leha on Thu, 4 Dec 2014 14:37:25 +0000 wrote:
>>
>>  > Hi all,
>>  > I quite like the possibility to 'step' through my code using C-c C-c
>>  > (ess-eval-region-or-function-or-paragraph-and-step).  Sometimes that
>>  > fails due to not recognizing the structure correctly.
>>
>>  > Most annoyingly, it does not recognize the *end* of a function.
>>
>>  > So, as an example, I am not able to evaluate the following using just a
>>  > series of (two) C-c C-c.
>>
>>  > myfunc <- function(a, b)
>>  > {
>>  >   c <- a + b
>>
>>  >   c
>>  > }
>>  > myfunc(1,2)
>>
>>  > Could that be improved on?
>>
>>  > ( I am aware that I can fix that by adding new lines, but some of
>>  >   my code is actually put together using org-mode's noweb syntax
>>  >   <<block_1>>
>>  >   <<block_2>>
>>  >   and that would require me to put newlines between these noweb
>>  >   references or start every block with an empty
>>  >   line -- just in case.  This looks strange and I will forget to
>>  >   do so all the time.... )
>>
>>  > Thanks,
>>  > Andreas
>>
>>  > ______________________________________________
>>  > ESS-help at r-project.org mailing list
>>  > https://stat.ethz.ch/mailman/listinfo/ess-help
>>
>> ______________________________________________
>> ESS-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>
> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list