This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-18
Channels
- # announcements (12)
- # babashka (6)
- # beginners (62)
- # calva (3)
- # cider (41)
- # clerk (5)
- # clojure (192)
- # clojure-bay-area (1)
- # clojure-europe (14)
- # clojure-norway (97)
- # clojure-uk (6)
- # clojuredesign-podcast (4)
- # clojurescript (30)
- # code-reviews (7)
- # cursive (32)
- # datahike (4)
- # datomic (35)
- # docker (8)
- # emacs (8)
- # events (1)
- # fulcro (13)
- # helix (19)
- # hoplon (4)
- # hyperfiddle (37)
- # jobs-discuss (10)
- # membrane (11)
- # missionary (19)
- # off-topic (28)
- # polylith (8)
- # portal (10)
- # practicalli (8)
- # re-frame (31)
- # reitit (6)
- # shadow-cljs (39)
- # timbre (3)
- # vim (1)
- # xtdb (6)
I’ve just updated and are getting these new exciting looking overlays. But they are just saying “Error in Thread” rather than adding any specific information. What am I missing?
Seems related to https://github.com/clojure-emacs/cider/discussions/3338#discussioncomment-7286434 specifically this possible config fix https://github.com/clojure-emacs/cider/issues/3525 (not yet released AFAIK)
wait, no, I get a stacktrace and cider-error buffer on that
do you have any config related to showing the cider-error buffer?
I don’t have any
My config is very minimal, out of the box
Add a paredit mode
The rest is more about the thread than the error
If you use the absolute latest Git master / MELPA snapshot you'll have available the latest customization options for them as seen at the top of https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md These implement @U05092LD5’s feedback for this feature.
I get the error in thread for (let [1])
too
We got the same report when using Flowstorm's custom clojure
version. Was it that?
A fix should be on its way from their side
Ahhh yeah that was it good catch!!!!
🍻 ! Fix should be out soon I guess https://clojurians.slack.com/archives/C03KZ3XT0CF/p1699961805678759?thread_ts=1699898076.576449&cid=C03KZ3XT0CF
what's the cider-error-hoover
overlay and can I disable it? Our logging implementation prints stuff in the REPL and it looks like that particular overlay is applied to some parts of some lines (not all). Accidentally clicking on such a line segment will open dired in the project root, which is a bit confusing.
I have a feeling that sometimes clicking on such a link would also trigger this: https://clojurians.slack.com/archives/C099W16KZ/p1692351993871399
Sounds dense enough to warrant an issue :) Please create it and I'll be happy to attend it right away
> I have a feeling that sometimes clicking on such a link would also trigger this: https://clojurians.slack.com/archives/C099W16KZ/p1692351993871399 Unrelated, however you are in luck, because we're fixing that today
...Done https://github.com/clojure-emacs/cider/pull/3538 . Expect a couple hours for a MELPA release, and make sure that clojure-mode gets updated as well.

What setup is required with deps.edn for cider to load the namespaces and switch to some default? Also, are there any global deps.edn setup files (like .lein/profiles.clj) to add some universal user deps/plugins?
this is a very featured user deps.edn https://github.com/practicalli/clojure-cli-config
I believe that setting a initial ns is hard. Lein achieves so in a hacky way. I asked about it here https://clojurians.slack.com/archives/C17JYSA3H/p1693584814024819 Ultimately, we could just add that feature to https://github.com/nrepl/nrepl
Loading the namespaces is a touch easier. What's your workflow - tools.namespace or repl-driven?
@U45T93RA6, repl-driven, if that means what I think it means. I don't know about tools.namespace. @U01C9CMAPK4, thanks for the link, helped me find more information, and I'm reading the practicalli guide now.
One way could be to add to user.clj
(a ns named user
is always required automatically by Clojure) sufficient requires.
Another approach would be to add a cider-connected-hook
such that it performs requires or other stuff.
Note that this will make your repl start more slowly, and may fail on startup.
I believe that a purist approach would be to require stuff by hand, but not close your REPL too often. For that I'd recommend cider-connect over cider-jack-in, so that you can restart Emacs without losing your repl stuff.
When using Cider with Clojure CLI, then only the Clojure CLI install is needed. https://practical.li/clojure/clojure-cli/ provides examples of common tasks on top of the Clojure CLI Evaluating code in source code buffers automatically evaluates the code in the correct namespace. Using rich comment forms allow experimental code to be separate from more stable code. A https://practical.li/clojure/clojure-cli/repl-startup/, although not for setting the namespace (code can be added to switch the namespace, but it will likely be superceded by the repl startup process Using the -e flag to pass an expression to evaluate code such as switching to a namespace should work fairly consistently. This is usually done within an alias that used when starting the repl
@U060FHA3K28 This is how I do it:
1. Have ~/.clojure/user.clj
file with the things I want to be present in every project.
2. Have this alias in ~/.clojure/deps.edn
:
:user {:main-opts ["-e" "(load-file,(str,(System/getProperty,\"user.home\"),\"/.clojure/user.clj\"))"]}
3. Ensure that :user
alias is appended to every clj
call. For CIDER, you can add it to cider-clojure-cli-aliases
variable. In the terminal, I went with a shell alias, like alias clj="clj -A:user"
Plenty of cool approaches being shared :)
A last one I can think of is setq cider-repl-require-ns-on-set t
. By requiring the ns'es you visit, you'd get a recursive requiring.
Similarly, there's cider-repl-init-code
, which is good to tweak on .dir-locals.el
@U06PNK4HG, thanks. Isn't there a standard clojure way to find where the config is located? XDG_CONFIG_HOME
is much nicer, for example.
@U060FHA3K28 I use XDG standard for Clojure CLI and Emacs (and Neovim), although there are a fewconfigs that don't support it, so I use symbolic links Here is a guide with details https://practical.li/blog/posts/adopt-FreeDesktop.org-XDG-standard-for-configuration-files/
ℹ️ We've released https://github.com/clojure-emacs/cider/blob/v1.8.3/CHANGELOG.md#183-2023-10-18 with a tasty batch of bugfixes, improvements and customization options, all Elisp side. One particular area that has gotten attention lately is error overlays (as seen in the screenshot). You can learn more about them here: https://docs.cider.mx/cider/usage/dealing_with_errors.html#configuration https://docs.cider.mx/cider/usage/code_evaluation.html#overlays Thanks much to everyone involved in giving accurate feedback.
