[ESS] Adjustment to C-c C-p behavior

António Ferreira asfe at di.fc.ul.pt
Tue Dec 5 21:21:29 CET 2006


Hello,

I changed the behavior of ess-eval-paragraph-and-step (bound to C-c C-p) 
to be consistent with ess-eval-line-and-step (C-c C-n).

While debugging a R source file I noticed that I had to use C-c C-n 
several times on multi-line expressions (i.e., paragraphs), to 
continuously see the evaluation outcome on the *R* buffer. Naturally I 
also tried C-c C-p, but its behavior had a subtle difference: the cursor 
on the *R* buffer didn't stay at the end of the buffer, thereby forcing 
me to manually scroll down to see the latest evaluation results.

To change the behavior of the C-c C-p, so that the *R* buffer 
continuously shows the latest evaluation outcome, I edited the file 
'ess-inf.el' that comes with ESS 5.3.3:

;; Previous code

(defun ess-eval-paragraph-and-step (vis)
   "Send the current paragraph to the inferior ESS process and
    move forward to the next paragraph.
    Arg has same meaning as for `ess-eval-region'."
   (interactive "P")
   (let ((beg-end (ess-eval-paragraph vis)))
     (goto-char (1+ (cadr beg-end))))
)

;; New code

(defun ess-eval-paragraph-and-step (vis)
   "Send the current paragraph to the inferior ESS process and
    move forward to the next paragraph.
    Arg has same meaning as for `ess-eval-region'."
   (interactive "P")
   (let ((beg-end (ess-eval-paragraph vis)))
     (goto-char (1+ (cadr beg-end)))
     ;; Added by ASFE, December 4, 2006
     (ess-eval-linewise "" nil 'eob))
)

I've been using the patched 'ess-inf.el' since yesterday and haven't 
noticed any unusual side effects.

Cheers,
António Ferreira




More information about the ESS-help mailing list