Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In ESS/Emacs, how can I get the R process buffer to scroll to the bottom after a C-c C-j or C-c C-r

Tags:

emacs

r

ess

In ESS when I am evaluating chunks of code in a .R file using C-c C-j or C-c C-r (to send the line or region to a running R process), how can I get the R buffer to scroll down automatically, such that after evaluating a region the cursor is at the bottom, at the prompt?

Thanks.

like image 270
stevejb Avatar asked Apr 25 '10 23:04

stevejb


2 Answers

Probably a bunch of ways to do it. In my .emacs.d I have

  (setq comint-prompt-read-only t)
  (setq comint-scroll-to-bottom-on-input t)
  (setq comint-scroll-to-bottom-on-output t)
  (setq comint-move-point-for-output t)

You might also be interested in this code, originally from Felipe Csaszar, which lets you do what you ask and a few other nice things besides.

like image 134
Kieran Avatar answered Oct 25 '22 22:10

Kieran


Have a look at auto-scrolling in emacs doc. For my part:

customize-variable RET scroll-down-aggressively RET

scroll-down-aggressively set to 1 did the job.

like image 29
DJJ Avatar answered Oct 25 '22 22:10

DJJ