Fork me on GitHub

Hello there, I installed a fresh version of linux on my laptop and I can't seem to make cider-jack-in work. It claims The lein executable isn't on your 'exec-path' even though it exists in /usr/bin/ which is listed in the exec-path variable. I've tried googling for the last 2-3 hours but found nothing to remedy this.


Can someone help me? 🙂

Christopher Miles12:07:15

Double-check and make sure the script is executable, you may have to do that by hand. sudo chmod +x /usr/bin/lein


Thank you for replying!

ls -l /usr/bin | grep lein
 -rwxr-xr-x 1 root root        4500 Dec 26  2019 lein


Can you run lein repl from a terminal?


Yes, and I can connect to that repl with the cider-connect command and giving it the port number


Open up an eterm buffer for emacs and try running it there


with M-x shell and running lein repl there gives me sh: lein: command not found


is that what I was supposed to do?


that's the issue. emacs cannot see it


there's a var called exec-path which has a path for emacs to search for executables

👍 2
dpsutton13:07:15 and this lovely library can help with lots of that


that's true, exec-path lists /usr/bin/


and lein is there


it seems that I already use that library. I got it from the clojure for the brave and true book's customization files


i'm not sure what steps to take then


thank you for your time 🙂


you are welcome. not sure why you can't see it in eshell but whatever is preventing that is also preventing cider from running it. that problem is basically emacs cannot find or cannot run your executable


there's was something I did yesterday evening, but then I went to sleep and in the morning I couldn't replicate it, and I'm struggling the whole day.


that's really frustrating. i'm sorry to hear that


thank you for your empathy 🙂


Fixed it finally! Since I installed emacs 27.2 through flatpak it didn't exist as a runnable command in my terminal. So when I started it through the app menu, it ran in a different environment (don't know which). So the fix was to delete that emacs, and install the newest possible (26.3) through my software manager and everything worked smoothly


echo $PATH in emacs was showing a different value than echo $PATH in my terminal


Additional things that could bring more info to the table: clojure version lein version 2.9.1 on Java 11.0.11 OpenJDK 64-Bit Server VM cider version 1.1.1 emacs version 27.2 I've also copied the whole .emacs.d folder from my previous installation to the new one (I have a feeling this might be the culprit)

Quentin Le Guennec12:07:46

Is there a way in cider to treat a macro as defn like cursive does?


For indentation?

Quentin Le Guennec13:07:55

@dpsutton also for avoiding highlighting things like symbols as flycheck errors


Ah. So the error checking is most likely clj-kondo and or lsp. But for indentation clojure mode allows you to set indentations. Also you can use meta data to achieve the same purpose


@quentin.leguennec1 for ignoring clj-kondo warnings you can use #_:clj-kondo/ignore before the form.

Quentin Le Guennec13:07:48

Yeah exactly that's clj-kondo

Quentin Le Guennec13:07:34

Is there any way to ignore errors on particular forms? Like all (custom-defn ..) forms?


you can configure clj-kondo to understand the effect of the macro


{:lint-as {foo.custom-defn clojure.core/defn}}


here's a lovely project with some advanced configuration for a few popular libraries:


(I didn't know that you could write functions to parse the forms at runtime and seem to return an annotated ast)


or perhaps it is macroexpanding


it's similar to macro-expansion, but a bit different since you're not working with s-expressions directly but a richer format (rewrite-clj nodes)


if using lsp, there is a code action resolve macro assimilar to cursive, which add that clj-kondo config for you.

🎉 4
🤯 4
Cora (she/her)15:07:59

will that update it, too?

Cora (she/her)15:07:14

I mean, in case I get it wrong the first time 😅