[ESS] ESS[R}: Evaluate region keyboard command

S. McKay Curtis smcurtis at stat.washington.edu
Fri Aug 6 06:41:35 CEST 2010


Hi Peter,

I am not sure why "C-c C-r" is not working on your emacs.  However,
you may find the following suggestion useful (see the suggestion from
"FelipeCsaszar" on th ESS wiki
http://www.emacswiki.org/emacs/EmacsSpeaksStatistics#toc2).  If you
add the following lines of code to your .emacs file, you will then be
able to use Shift+Enter to send a region of code OR a single line of
code to the R session buffer:

(defun my-ess-eval ()
  (interactive)
  (my-ess-start-R)
  (if (and transient-mark-mode mark-active)
      (call-interactively 'ess-eval-region)
    (call-interactively 'ess-eval-line-and-step)))

(add-hook 'ess-mode-hook
 '(lambda()
    (local-set-key [(shift return)] 'my-ess-eval)
    ))


Best,
McKay


Steven "McKay" Curtis
Postdoctoral Research Associate
University of Washington
Department of Statistics
Box 354320
Seattle, WA 98195-4320
(206) 543-6851



On Thu, Aug 5, 2010 at 9:11 PM, Peter Geelan-Small
<peter.geelan-small at sydney.edu.au> wrote:
>
> G'day, Everyone.
>
> I'm trying to find the keyboard command that you can use to send a
> highlighted block of code from ESS to R for evaluation. I highlight a
> block of code and then try C-c C-r or C-c M-r, which I found in the
> documentation, but neither pair works. Can someone please shed some
> light on this?  The commands C-c C-c for sending the paragraph that the
> cursor is in and C-c C-j (or C-c C-n) for sending a single line of code
> work perfectly well for me.
>
> My set up is:
> Windows XP SP3
> GNU Emacs 23.1 (from Vincent Goulet's package)
> ESS 5.4
> R 2.10.0
>
> Regards,
>
> Peter Geelan-Small
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list