I reinstalled emacs/spacemacs recently. I am using the practicalli config.
I am unable to eval expressions in the buffer directly. , e v does not return anything.
If I go to the repl and write an expression it evals it. How do I get eval in buffer again ?
This is the cider version - CIDER 1.8.0-snapshot (package:
nope cant eval any forms in the buffer
Very strange indeed. According to MELPA you have the latest Cider package. I will update my Emacs packages and see if I can reproduce
I've updated the CIDER package to the same version as you have and evaluation in the source code buffer is working. So it seems unlikely it a package or config issue.
I suggest tying a different Clojure project or creating a very simple project.
If the Emacs message buffer, SPC b m , isn't showing errors, then I don't have specific advice, other than the general trouble shooting guide
Perhaps start by deleting the Cider package and restart Emacs to download the package again (it may have been a bad download).
https://practical.li/spacemacs/install-spacemacs/troubleshooting/
Can you also confirm that the Clojure source code buffer is in Clojure mode?
SPC SPC clojure-mode will toggle Clojure mode on and off.
If the Clojure buffer is not in Clojure-mode, then it would explain why the eval commands are not working (but then none of the cider or clojure-mode keybindings would show either
hi @jr0cket thanks for the help.
I deleted the elpa dir and reinstalled, same result.
When I try to do , s n it gives me this error - save-current-buffer: Wrong type argument: stringp, nil
SPC SPC clojurescript-mode connects it back, without any errrors, but it still doesnt work.
However I am able to do in-ns and then eval forms in the repl. But I dont get any completions in the repl, I have to type the forms.
I don't have a key binding for , s n
I assume you using , s N to sent namespace to repl and focus. This command works on my machine.
Can you send me the command used to start the REPL. If using jack-in, the command will be added to the *messages* buffer, spc b m
Perhaps the middleware is not being included correctly
I am using cider-connect-cljs. Its a cljs / shadow-cljs app.
cider-connect-cljs -> localhost -> balance:8230 -> :app
above are the choices that I select and then the repl connects.
balance:8230 is the app that I am working on, and :app is the shadow-cljs target
I have a default keybinding for , s n - cider-send-ns-form-to-repl
on , s N I get the following msg -
user-error: No cljs REPLs in current session "tallyfor/balance:localhost:8230"
I can replicate the issue in clojurescript-mode, but not in clojure-mode I suspect this is a bug in Cider as there have been some recent changes there...
Correction, I replicated the issue as I didnt start the clojurescript repl using jack-in, I stared a Clojure REPL instead. When I used cider-jack-in-cljs then I can evaluate in the buffer. I suspect that when evaluating in the clojurescript-mode buffer it is looking for a clojurescript-repl which Cider is not connected too (or not running)
I havent used shadow-cljs very much at all. I'd suggest going through the very specific shadow-cljs guide which precisely details how to setup and run the project. From comments I have seen, there is a specific way to make shadow-cljs work with Emacs, which should be covered by reading the detailed guide https://shadow-cljs.github.io/docs/UsersGuide.html People in the #cider channel may also have some advice about using Emacs with shadow-cljs, but I am afraid I have no experiences to share currently.
thanks for investigating it, let me check out the guide.
Sounds like Emacs was not restarted after installing all the packages, or maybe is still compiling packages natively if that feature is enabled. Otherwise something is very broken and I dont know how to reproduce.
Are all the key bindings showing?
Does , e f evaluate the top level form ?
I updated Emacs packages on the 12th September and I can use , e v to evaluate a complete form successfully once the REPL has started.
Ensure that CIDER has loaded Clojure after starting the REPL by evaluating either an ns form or a whole buffer that contains an ns form.
I'm using cider package cider-20230912.1201 so I guess something could have broken since then.
Can you report what version of Cider is running, e.g. SPC SPC cider-version in Emacs.