This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-08
Channels
- # aleph (7)
- # announcements (12)
- # babashka (19)
- # beginners (4)
- # calva (29)
- # cider (20)
- # clj-kondo (20)
- # clojure (66)
- # clojure-austin (4)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (42)
- # clojure-uk (4)
- # clojuredesign-podcast (9)
- # conjure (1)
- # cursive (5)
- # datomic (42)
- # etaoin (4)
- # events (10)
- # garden (8)
- # graphql (1)
- # holy-lambda (7)
- # honeysql (3)
- # hyperfiddle (5)
- # missionary (11)
- # music (1)
- # off-topic (12)
- # practicalli (2)
- # re-frame (2)
- # reitit (6)
- # releases (2)
- # vim (2)
- # web-security (1)
- # xtdb (3)
Hello, I'm randomly running into Lisp nesting exceeds 'max-lisp-eval-depth
with several cider commands (`cider-repl-history` cider-jack-in-clj
..)
. Primarily its preventing me from jacking-in, the times that I do manage to jack-in, calling an offending command kills the repl's interactivity rendering it a plain text buffer .
The initial jack-in after starting or restarting emacs gives:
error in process filter: Lisp nesting exceeds 'max-lisp-eval-depth' : 1601
Cider 1.13.1 (Santiago), emacs 29 native-comp.
Personally I set (setq max-lisp-eval-depth 10000)
globally. I don't remember the exact reason, but it hasn't hurt
(Similarly in Clojure I set a fairly large stack size: "-Xss6144k"
- it allows certain algos to complete normally)
Hope it helps!
thx @U45T93RA6, unfortunately I'm still getting the same errors after setting the depth to 10000. WRT the clojure stack size, does that go in the jvm opts? I tried: deps.edn
... :aliases
{:web-dev {:extra-paths ["src/web_dev"]
:main-opts ["-m" "web-dev.core"]
:jvm-opts ["-Xss6144k"]}}}
Yes that looks correct. To be clear, I only cited it as an example of increasing the stack not being necessarily a bad practice or workaround. But it doesn't fix any Elisp issue.
So, you are seeing Lisp nesting exceeds 'max-lisp-eval-depth' : 10000
now or so? (different number)
got it, yep the new error is:
error in process sentinel: Lisp nesting exceeds 'max-lisp-eval-depth' : 10001
`
This was thrown by calling recentf
on a .clj file with toggle-debug.. enabled (Warning Worlds largest stacktrace ahead)
https://cryptpad.fr/code/#/2/code/view/b3tQMLkvpQ91TvGXAqeuLZgnIeahNJV4pZyq5Mc19LA/embed/
Thanks! We got a lead :) It doesn't immediately bring something to mind. Do you have any cider hooks set up in your personal emacs config?
Yep there are few hooks in the config. Here's my clj-mode and cider mode setups clojure-mode:
(use-package clojure-mode
:ensure t
:hook (clojure-mode . hs-minor-mode)
:mode (("\\.clj\\'" . clojure-mode)
("\\.edn\\'" . clojure-mode))
:config
(setq clojure-align-forms-automatically t))
;;Prevent error: Lisp nesting exceeds 'max-lisp-eval-depth
(setq max-lisp-eval-depth 10000)
Cider:
(use-package cider
:ensure t
:demand t
:config
(add-hook 'cider-mode-hook 'cider-repl-history-mode)
(add-hook 'cider-repl-mode-hook #'corfu-mode)
(add-hook 'cider-mode-hook #'corfu-mode)
(add-hook 'cider-repl-mode-hook #'paredit-mode))
That was the exactly the problem, thanks @U45T93RA6 , I finally have a civilized repl again 🥲
I was under the impression that CIDER had the ability to load a library using the sideloader. (One that is not declared in project.clj or deps.edn.) I'm unable to find docs/articles related to this. Am I misremembering?
It's https://cljdoc.org/d/nrepl/nrepl/1.1.0/api/nrepl.middleware.sideloader which has some integration with cider (please grep it in https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md)
Personally I've never used it. At this point it might be wise to simply wait until Clojure 1.12 add-lib
...clj-refactor.el had a different form of this many years ago. It broke with newer JDKs
Ah I see, thank you very much!
nREPL supports sideloading indeed, but I don’t recall whether we fully implemented this in CIDER.
I recall I wrote the POC and then Arne did some work for sideloading middleware https://github.com/clojure-emacs/cider/pull/3044/files
That’s the main ticket https://github.com/clojure-emacs/cider/issues/3037, which seems we never wrapped