[ESS] Viewing data frames

Martin Maechler maechler at stat.math.ethz.ch
Mon Feb 28 09:20:05 CET 2011


>>>>> Stephen Eglen <S.J.Eglen at damtp.cam.ac.uk>
>>>>>     on Sun, 27 Feb 2011 20:27:16 +0000 writes:

    >> I think that'd be quite helpful -- not for emacs to
    >> resize R's width automagically (though some might like an
    >> option for that), but to have a function that tells R to
    >> set options(width=(window-width)) or some such that we
    >> can bind to a key-combo.

What's wrong with using

(ess-execute-screen-options)

which I have had bound to  "C-c w"  for ages ?

    > ok, here is a suggestion:

    > (defun ess-r-set-width ()
    > "Set width option for R based on current window width.
    > Only sensible when called from within an *R* buffer."
    > (interactive)
    > (let ((wid (window-width)))
    > (ess-command (format "options(width=%d)\n" wid))
    > (message (format "Window width set to %d" wid))))


    > & for those who want it automatically updated:

    > (add-hook 'inferior-ess-mode-hook
    > '(lambda ()
    > (add-hook 'window-configuration-change-hook
    > 'ess-r-set-width nil 'local)))

    > Stephen

    > ______________________________________________
    > ESS-help at r-project.org mailing list
    > https://stat.ethz.ch/mailman/listinfo/ess-help

    > (defun ess-r-set-width () "Set width option for R based on
    > current window width.  Only sensible when called from
    > within an *R* buffer."  (interactive) (let ((wid
    > (window-width))) (ess-command (format
    > "options(width=%d)\n" wid)) (message (format "Window width
    > set to %d" wid))))


    > & for those who want it automatically updated:

    > (add-hook 'inferior-ess-mode-hook '(lambda () (add-hook
    > 'window-configuration-change-hook 'ess-r-set-width nil
    > 'local)))

    > Stephen

    > ______________________________________________
    > ESS-help at r-project.org mailing list
    > https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list