[ESS] [External] Re: Function to copy command to script?

Jeremie Juste jerem|eju@te @end|ng |rom gm@||@com
Tue May 19 20:16:55 CEST 2020


Hello,

 > Is there a function to copy an inferior-buffer R command back to the R
 > script and insert it at point?
For a while I have considered doing just that but I ended exploring other
options.

* First option
Have you considered using directly a script buffer for prototyping?
This might be a shorter path to what you want to achieve.

Imagine a buffer test.R with your prototype and `ess-eval-buffer` bound
to a single key. You could then save the result of test.R somewhere
whenever you want.

* Second option
Use the same working buffer but narrow to region then `ess-eval-region` bound to
a quick key.

So you can use some tools like key-chords [0] to quickly narrow and
widen, and ess-eval region.

Another secret weapon of ESS that really changed my work flow is
`ess-describe-object-at-point`. This is absolutely great for prototyping
as it is non-invasive, you can customize it at will and it does not
clutter the buffer.


HTH,
Jeremie

[0] https://www.emacswiki.org/emacs/KeyChord



More information about the ESS-help mailing list