Fork me on GitHub
#emacs
<
2022-12-22
>
pesterhazy10:12:30

Eglot experience report: here's what I had to do to get jump-to-definition to work for external, jar-based dependencies • Install https://elpa.gnu.org/devel/jarchive.html(jarchive-setup)(jarchive-patch-eglot) (not necessary if you're on emacs 29+)

pesterhazy10:12:20

Now I can xref-find-definition in Clojure or Babashka projects (clojure.core, deps shipped with babashka, external deps)

👍 2
1
ericdallo11:12:46

Thanks for the summary!

borkdude11:12:57

Worth another blog post ;)

💡 1
lispers-anonymous18:12:09

Glad you find my package useful. Let me know if you find any issues with it

pesterhazy20:12:04

Thanks for writing it @UDVJE9RE3! Works well for me so far. I appreciate the shim for emacs 28

lispers-anonymous20:12:28

Yep, the shim wont be necessary soon, even in emacs 28. The next version of Eglot that is released won't need it. But not everyone will upgrade, and it won't hurt to use it anyways.

👍 1
pesterhazy12:12:49

Found a better way to find a project root in a monorepo, by looking for a "sentinel file" (like deps.edn, bb.edn, package.json, etc). Updated this gist https://gist.github.com/pesterhazy/e8e445e6715f5d8bae3c62bc9db32469

👍 1
teodorlu14:12:29

I usually shell out to git:

git rev-parse --show-toplevel
but that requires git to be installed, and breaks if you copy your files without bringing the .git folder with you!

pesterhazy20:12:57

In my case the project folder is not the git root but a subfolder

👍 1
teodorlu11:12:35

Right. I read the gist you posted more closely now. You could have a subfolder with git rev-parse:

echo "$(git rev-parse --show-toplevel)/subfolder"
but I presume you specifically want to avoid having to hard-code the path from the toplevel git repo to the subfolder!

pesterhazy13:12:49

Incidentally, what does #' mean in elisp? Is it really needed?

(add-hook 'project-find-functions
          #'(lambda (d)
              (let ((dir (find-enclosing-project d)))
                (if dir (cons 'vc dir) nil))))

alandipert18:12:40

to answer your question, that particular use of #' was necessary in historical Lisps in which lambda expressions did not evaluate to a function object - (function (lambda ...)) was necessary, wihch #' is shorthand for. for the full story see https://stackoverflow.com/a/29346982 people who learned lisp a long time ago use it (accidentally?) but then I think it gets copied by others who don't know any different

pesterhazy20:12:56

Thanks that's very helpful

alandipert21:12:22

... and while i have your attention, perhaps i can interest you in a talk i gave recently-ish about how CL compares to Clojure, which might be helpful to the extent CL and elisp are close cousins https://www.youtube.com/watch?v=44Q9ew9JH_U

pesterhazy21:12:12

Very interesting, will definitely watch this (I'm a fan of your work on boot / hoplon etc btw)

alandipert22:12:52

thank you! yes i think i remember your name from stuff simple_smile . lmk if you have any questions

pesterhazy13:12:26

In fact, I really feel I'm hurting because my elisp is so weak. Is there a good intro to elisp (ideally for people who know Clojure)?

Matti Uusitalo00:12:26

The built in manual is pretty good. You can normally access it with C-h r and there’s a link to the Emacs lisp manual.

elken13:12:40

Not for a lamda no, it's function quote

elken13:12:25

exercism has some good elisp exercises, and system crafters have a small series on elisp

💯 2
thanks3 1
pesterhazy13:12:56

Very good! Will watch this for sure

pesterhazy13:12:54

It's confusing because elisp is so close to clojure, and yet you can't rely on your clojure skills because things are every so slightly different

elken13:12:34

Yeah it is ever so slightly different 😛