Fork me on GitHub
#spacemacs
<
2023-09-20
>
murtaza5215:09:05

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 ?

practicalli-johnny17:09:23

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.

practicalli-johnny17:09:16

Are all the key bindings showing? Does , e f evaluate the top level form ?

practicalli-johnny17:09:14

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.

murtaza5211:09:45

This is the cider version - CIDER 1.8.0-snapshot (package: )

murtaza5211:09:20

nope cant eval any forms in the buffer

practicalli-johnny11:09:53

Very strange indeed. According to MELPA you have the latest Cider package. I will update my Emacs packages and see if I can reproduce

practicalli-johnny12:09:16

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/

practicalli-johnny13:09:03

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

murtaza5207:10:10

hi @U05254DQM 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.

murtaza5207:10:24

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.

practicalli-johnny08:10:31

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

murtaza5209:10:29

I am using cider-connect-cljs. Its a cljs / shadow-cljs app.

murtaza5209:10:08

cider-connect-cljs -> localhost -> balance:8230 -> :app

murtaza5209:10:32

above are the choices that I select and then the repl connects.

murtaza5209:10:14

balance:8230 is the app that I am working on, and :app is the shadow-cljs target

murtaza5209:10:12

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"

practicalli-johnny10:10:40

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...

practicalli-johnny11:10:04

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)

practicalli-johnny11:10:52

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 #C0617A8PQ channel may also have some advice about using Emacs with shadow-cljs, but I am afraid I have no experiences to share currently.

murtaza5214:10:38

thanks for investigating it, let me check out the guide.