I am using Emacs + ESS + Sweave to write a document. When I do multiline copy of noweb commands using M-w, switch to R buffer and execute them (C-y, RET), Emacs will sometimes freeze, forcing me to kill Emacs and start over. This also happens with C-c C-c'ing of a text block.

EDIT: I am using Emacs 24.3.1, ESS 14.09, R 3.1.2.

EDIT: After some testing, the following file will reproduce this problem. Specifically, the first chunk will cause Emacs to hang. The only resolution is to first C-g then switch to the R buffer and C-q C-c to return full control.

\documentclass[10pt]{article}
\usepackage{graphicx, verbatim, geometry,amsmath,amssymb, natbib, float, enumerate, courier, underscore}
\usepackage[utf8x]{inputenc}
\geometry{margin=1in}
\setlength{\textwidth}{6.5in} 
\setlength{\textheight}{9in}

\begin{document}

<<>>=
library(ggplot2)
dat <- matrix(runif(100), nrow=10)
    cc <- apply(dat, 1, function(xx){
    sum(cos(xx))
})
@ 

The quick brown fox jumps over the lazy dog.

<<>>=
bcc <- sapply(cc, function(xx){
    fft(xx)
})
@ 

\end{document}
  • 1
    Next time it happens, do a kill -USR2 <emacs-pid> which will break most hangs and produce a backtrace. For extra info do M-x profiler-start when you start Emacs and M-x profiler-report after you kill. – PythonNut Feb 1 '15 at 17:03
  • It's a long trace. Is there something specific you are looking for? – learner Feb 1 '15 at 17:08
  • Something similar happens to me sometimes when I try to yank a shell buffer with a lot of text in it (a log of some sort), I think that it is either clipboard- or history-related. If you wait for a while (this isn't guaranteed to happen) but if you are up for experiment, some times it might pop up a *Warnings* buffer with a text about maximum undo steps exceeded. If that sounds familiar, I think it might make sense to file a bug to Emacs developers. – wvxvw Feb 1 '15 at 20:18
  • Does it happen when you send-region instead? I think it's C-c C-r, which should be available from a Rnw document. – Tyler Feb 1 '15 at 20:23
  • 1
    I should add that Sweave-ing the document doesn't produce a hang up, nor does manually entering calls that when yanked/sent would freeze. – learner Feb 2 '15 at 12:16

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.