4

I am trying ESS (Emacs Speaks Statistics).

The problem is: Ctrl-P and the up-arrow are disabled on any buffer because of the following error:

Variable binding depth exceeds max-specpdl-size

The trigger is the following line in .emacs.el

(require 'ess-site)

This line is needed to load ESS. If I delete this line, then the problems does not happen, but, obviously, I can't use ESS.

Notes:

  • "(setq max-lisp-eval-depth 10000)" does not solve the problem.
  • "(setq max-specpdl-size 32000)" produces a different error:

    Lisp nesting exceeds `max-lisp-eval-depth'

  • When the above two settings are valid, then I get the error for max-lisp-eval-depth.

  • This problem happens before M-x R RET. For example, it happens on the scratch buffer just after emacs starts.
  • I have not found any other key with this problem. (So Ctrl-F and down-arrow are working, for example.)
  • Deleting the ESS buffer does not solve the problem.
  • The initial message on the ESS buffer is following. (I don't know, whether it is useful.)

    [ess-site.el]: ess-customize-alist=nil
    [ess-site.el 2]: ess-customize-alist=nil
    (S): ess-s-versions-create making M-x defuns for

    (R): ess-r-versions-create making M-x defuns for

Environment:

  • emacs-ess-15.03.1-1.3.noarch
  • emacs-24.3-17.2.10.x86_64
  • R-base-3.1.1-2.1.9.x86_64
  • openSUSE 13.2 (Harlequin) (x86_64)
H. Shindoh
  • 906
  • 9
  • 23

2 Answers2

4

You could try

(setq max-specpdl-size 32000)

M-x describe-variable max-specpdl-size for some info

I've had this problem with python-mode and rope, never with ESS though.

Rorschach
  • 31,301
  • 5
  • 78
  • 129
  • 1
    Thanks for the information. But unfortunately I get a different error: Lisp nesting exceeds `max-lisp-eval-depth'. – H. Shindoh Jun 09 '15 at 19:58
  • 1
    Did you try setting both variables to be larger? – Rorschach Jun 09 '15 at 20:17
  • Yes. (setq max-specpdl-size 64000) and (setq max-lisp-eval-depth 64000) kill emacs. – H. Shindoh Jun 09 '15 at 20:22
  • it might be something else in your `.emacs`. You could try loading emacs without your .emacs: `emacs -q`. Then evaluate `(require 'ess-site)` in scratch buffer with `C-j`. – Rorschach Jun 09 '15 at 20:34
  • Your are right. The error does not appear. I'll check my settings. – H. Shindoh Jun 09 '15 at 20:38
  • If I load my .emacs.el line by line from scratch buffer, then the error does not happen... – H. Shindoh Jun 09 '15 at 20:59
  • 1
    I don't know. It sounds like there is some infinite recursion happening when you start emacs. I would make a new file `.emacs` with only `(require 'ess-site)` in it. then do `emacs -q -l .emacs` and try to isolate the problem by building up the new `.emacs`. In the file "ess-site.el" (`M-x locate-library ess-site`) there is a mention of infinite loops near the top. – Rorschach Jun 09 '15 at 21:20
  • I do not know the precise reason, but I have just solve the problem. Thank you very much for helping me. – H. Shindoh Jun 09 '15 at 22:16
  • I had the same problem when opening all files in a directory with `directory-files-recursively`. I was getting `File mode specification error: Variable binding depth exceeds max-specpdl-size`, so I doubled `max-specpdl-size`, and then I got `File mode specification error: (error Lisp nesting exceeds ‘max-lisp-eval-depth’)`, so I doubled that too, and that fixed the problem. – miguelmorin Nov 03 '19 at 11:07
0

Solution: change the order of certain settings.

My .emacs.el has settings for smooth-scrolling (A)

(require 'smooth-scrolling)
(setq smooth-scroll-margin 5)

and for the initial file (B)

(find-file "~/init.org")

(A) should be loaded before (B). (B) was loaded before (A) in my previous .emacs.el and this causes the problem. (I do not know the precise reason for the error which I described in my question.)

H. Shindoh
  • 906
  • 9
  • 23
  • If the loading file in (B) is .emacs.el, then the problem does not happen. So maybe an ogg-file should not be loaded before smooth-scrolling. – H. Shindoh Jun 09 '15 at 22:43