5

For some reason (which I can't understand, I did not change anything) emacs has become very slow - as in 2 min - at startup. I traced it down to the require commands of ESS. This is what I have in the .init file:

(setq load-path (cons "/usr/share/emacs/site-lisp/ess" load-path))
(require 'ess-site)
(require 'ess-smart-underscore)
(setq ess-default-style 'DEFAULT)

ess-smart-underscore also loads ess-site so eliminating the first require does not change anything. From this question I tried to use eval-after-load, but this does not work:

(eval-after-load 'ess-smart-underscore)

In general, I don't care to have ESS loading at startup. I'd be happy if it only loads when I open *.R or *.r files, but I'd like a reasonable startup time. I am running emacs 24.5.1 and ESS 16.04 on Linux. Downgrading to the previous versions of either did not make a difference.

I have now commented everything in .emacs except for:

(setq load-path (cons "/usr/share/emacs/site-lisp/ess" load-path))
(require 'ess-site)

Then I have reinstalled emacs, ESS, R and updated all the R packages: no difference. I noticed, however, that the first time emacs is launched it is a little bit faster then the following times, which seems odd to me.

5
  • 1
    I think you want (eval-after-load 'ess-smart-underscore '(setq ess-default-style 'DEFAULT))
    – npostavs
    Jun 19, 2016 at 21:55
  • What system are you using? What version of Emacs & ESS? Which of those four lines causes the slow down - probably one of the require calls?
    – Tyler
    Jun 20, 2016 at 2:55
  • @npostavs okay, that does not throw an error. however it does not load ESS.
    – point618
    Jun 20, 2016 at 9:25
  • I can't reproduce this on Emacs 24.5.50.1, ESS 16.04 from melpa on Debian Linux. Have you tried running just the four lines above in emacs -Q? Maybe something else in your init is interfering. If that's not it, then maybe something is corrupt in your ESS installation, or even in your R installation. I would reinstall both of those if the emacs -Q test doesn't turn up anything useful.
    – Tyler
    Jun 20, 2016 at 12:41
  • Actually my suggestion appears to be incorrect, ess.r-project.org/Manual/ess.html says "Use something like (setq ess-default-style 'DEFAULT) [...] in your ~/.emacs equivalent before loading ESS"
    – npostavs
    Jun 20, 2016 at 15:19

1 Answer 1

4

The immediate cause of this delay is a timeout withing the TRAMP package, that is a dependency of ESS.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810640

The hang occurs when Emacs spawns ssh processes when initialising the variable `tramp-ssh-controlmaster-options'. If your ISP's DNS server likes to hijack failed lookups to redirect the user to a branded search engine, these ssh processes hang for a long time before timing out. This bug affects all Emacs Lisp addons that load TRAMP as part of their startup...

1
  • Thank you! The link contains a workaround, but the issue seems to be resolved in emacs25.
    – point618
    Oct 20, 2016 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.