[ESS] Extend column width of R-Process in Emacs

tyler tyler.smith at mail.mcgill.ca
Mon Jul 20 13:17:55 CEST 2009

> Charles C. Berry wrote:
>> ---
>> C-c w runs the command ess-execute-screen-options
>>   which is an interactive compiled Lisp function in `ess-inf.el'.
>> It is bound to C-c w.
>> (ess-execute-screen-options)
>> Cause S to set the "width" option to 1 less than the frame width.
>> Also sets the "length" option to 99999.
>> This is a good thing to put in `ess-post-run-hook' --- for the S dialects.
>> ---

Friedericksen Hope <golum23 at gmx.de> writes:
> thank you guys for the responses. This is exactly what I was looking
> for. Unfortunately, I'm not very familiar with LISP - how can I put
> the "ess-execut-screen-options" to the "ess-post-run-hook"?

The following code in your .emacs file will do it:

(defun my-ess-post-run-hook ()
  (local-set-key "\C-cw" 'ess-execute-screen-options))
(add-hook 'ess-post-run-hook 'my-ess-post-run-hook)

The first line in the hook will call ess-exectue-screen-options each
time you start R. The second line (local-set-key ...) binds the command to
"C-c w", so you can correct the output width whenever the emacs frame size

Question for ESS people: 
What's the difference between ess-post-run-hook and
inferior-ess-mode-hook? Since ess-execute-screen-options only makes
sense in an inferior ESS buffer, would it be more appropriate to put
these customizations in the inferior-ess-mode-hook? Just curious.



There is something fascinating about science. One gets such wholesale 
returns of conjecture out of such a trifling investment of fact.
                                       --Mark Twain

More information about the ESS-help mailing list