In ESS when I am evaluating chunks of code in a .R file using Cc Cj or Cc Cr (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.
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.
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.
DJJ's solution works perfectly for ESS and polymode in Spacemacs.
First, put (scroll-down-aggressively 1)
within the defun dotspacemacs/user-config ()
section of the configuration file, eg ~/.spacemacs
.
Then, evaluate the line using SPC , er
or restart configuration SPC fed
.
Emacs 27 complained about the above line because "Symbol's function definition is void" so I had to change it as follow to achieve the same result:
(setq scroll-down-aggressively 0.01)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.