This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-22
Channels
- # adventofcode (26)
- # aleph (34)
- # announcements (10)
- # babashka (71)
- # beginners (80)
- # biff (7)
- # calva (1)
- # cider (4)
- # cljdoc (12)
- # clojure (8)
- # clojure-belgium (1)
- # clojure-europe (11)
- # clojure-nl (3)
- # clojure-norway (18)
- # clojure-sg (3)
- # clojure-sweden (2)
- # clojurescript (18)
- # clojutre (4)
- # conjure (1)
- # core-logic (4)
- # datahike (1)
- # datascript (3)
- # emacs (27)
- # exercism (1)
- # gratitude (12)
- # introduce-yourself (4)
- # joyride (1)
- # lsp (46)
- # malli (3)
- # membrane (2)
- # nbb (1)
- # off-topic (3)
- # other-languages (7)
- # pedestal (4)
- # portal (3)
- # practicalli (1)
- # rdf (33)
- # re-frame (11)
- # releases (1)
- # ring (1)
- # scittle (34)
- # shadow-cljs (10)
- # squint (12)
- # tools-deps (89)
- # tree-sitter (2)
- # xtdb (14)
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+)
Now I can xref-find-definition
in Clojure or Babashka projects (clojure.core, deps shipped with babashka, external deps)
Glad you find my package useful. Let me know if you find any issues with it
Thanks for writing it @UDVJE9RE3! Works well for me so far. I appreciate the shim for emacs 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.
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
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!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!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))))
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
Thanks that's very helpful
... 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
Very interesting, will definitely watch this (I'm a fan of your work on boot / hoplon etc btw)
thank you! yes i think i remember your name from stuff . lmk if you have any questions
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)?
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.
exercism has some good elisp exercises, and system crafters have a small series on elisp
Interesting! Do you mean these? https://systemcrafters.net/emacs-from-scratch/
I do! Specifically https://www.youtube.com/watch?v=RQK_DaaX34Q&list=PLEoMzSkcN8oPQtn7FQEF3D7sroZbXuPZ7
Very good! Will watch this for sure
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