[ESS] Can not interrupt long printing

Ponting, Keith (Keith) kponting at avaya.com
Thu Jun 28 10:20:19 CEST 2012


I too have the same issue from time to time.  My .emacs now contains:

(defun my-ess-post-run-hook ()
  (ess-execute-screen-options) ; see ESS-help Digest vol 77 issue 10
  (local-set-key "\C-cw" 'ess-execute-screen-options)
  (if (string= ess-dialect "R") (ess-eval-linewise "options(max.print=100)" nil nil nil (quote wait)))
)
(add-hook 'ess-post-run-hook 'my-ess-post-run-hook)

For completeness of information, I am using Vincent Goulet's excellent pre-bundled Emacs (24.1 modified 1) for Windows. The start of an R session now looks like:
...
> > options(chmhelp = FALSE, help_type = "text")
> options(width=152,length=99999)
> options(max.print=100)
> assignInNamespace(".help.ESS",help, ns = asNamespace("base"))
> options(STERM='iESS', str.dendrogram.last ="'", editor='gnuclient.exe')

The width/length options come from ess-execute-screen-options to match current width
of Emacs window; the max.print from my code above.
I am not altogether sure where the other options and assign come from.  

HTH,

Keith

Keith Ponting | Consulting Research Scientist | Aurix Ltd. UK | www.aurix.com

On 25/06/12 15:31, Rainer M Krug wrote:
> 
> On 25/06/12 15:24, Kasper Daniel Hansen wrote:
> > You can always move the point to the "last place" (not sure what the technical term is) by C-c
> > C-e (works in an comint buffer).
> 
> I haven't tried it, but I guess that without the comint-scroll-to-bottom-on-output variable set,
> it will be in the middle again before I can presss Ctrl-c to interrupt R.
> 
> >
> > I set R options in my ~/.Rprofile.
> 
> As I mentioned, I start R under ESS with the --vanilla option, which does not load any config
> files. The reason is that I run simulations locally and on a cluster and would like to keep
> settings consistent without having to worry about different config files.
> 
> Cheers,
> 
> Rainer
> 
> >
> > Kasper
> >
> > On Mon, Jun 25, 2012 at 8:16 AM, Vitalie Spinu <spinuvit at gmail.com> wrote:
> >>>> Rainer M Krug <r.m.krug at gmail.com> on Mon, 25 Jun 2012 11:36:52 +0200 wrote:
> >>
> >>>> If you didn't set comint-scroll-to-bottom-on-output then this is reasonable. Comint will
> >>>> not scroll the buffer unless you are at the end of it.
> >>
> >>> I'll try if this changes anything and give some feedback.
> >>
> >>> This seems to have solved the problem: The cursor is always at the end, so a Ctrl-c is
> >>> accepted.
> >>
> >> Ok, I only now see the problem. So Ctrl-c works only after the process mark. Then, I would
> >> say that this is a bug in comint or ESS. Will investigate.
> >>
> >> Thanks.
> >>
> >>
> >>>>
> >>>> I guess you know about max.print option. Set it to something small, like 1000, to avoid
> >>>> the listing of big objects.
> >>
> >>> I should actually. But I am starting R with --vanilla, so the defaults are used - is there
> >>> a way in ESS that I can set options? (I am sure there is)
> >>
> >>> Thanks,
> >>
> >>> Rainer
> >>
> >>>>
> >>>> Vitalie.
> >>>>
> >>>>>>>>
> >>>>>>>> str(x)
> >>>>>>>>
> >>>>>>>> before asking for a display of the complete object?  The str function, written
> >>>>>>>> by Martin, provides a concise overview of any R object.  Other alternatives for
> >>>>>>>> data frames in particular are
> >>>>>>>>
> >>>>>>>> head(x, n)  # display the first n rows, the default for n is 6
> >>>>>>>>
> >>>>>>>> and
> >>>>>>>>
> >>>>>>>> tail(x, n)
> >>>>>>>>
> >>>>>>>> On Thu, Jun 21, 2012 at 7:09 AM, Rainer M Krug <r.m.krug at gmail.com> wrote: Hi
> >>>>>>>>
> >>>>>>>> I sometimes want to see an object / dataframe (lets call it x) in R and, only
> >>>>>>>> after issuing the command to print it(> x), that it x is a HUGE dataframe and it
> >>>>>>>> takes literally minutes to print. I am not able to interrupt the printing with
> >>>>>>>> Ctrl-c as I used to be, as the cursor is in the middle of the screen and not at
> >>>>>>>> the end of the output. Interrupting via the menu also does not work ("No command
> >>>>>>>> on this line"). The only thing I can do is either wait or kill R
> >>>>>>>>
> >>>>>>>> Is it possible to make sure that the cursor stays at the end of the output, so
> >>>>>>>> that I can interrupt the printing? Thanks,
> >>>>>>>>
> >>>>>>>> Rainer


More information about the ESS-help mailing list