This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-23
Channels
- # announcements (2)
- # babashka (25)
- # beginners (33)
- # biff (13)
- # calva (13)
- # clerk (82)
- # clj-commons (3)
- # clj-kondo (8)
- # clj-on-windows (23)
- # cljdoc (6)
- # clojure (16)
- # clojure-belgium (1)
- # clojure-dev (58)
- # clojure-europe (53)
- # clojure-nl (1)
- # clojure-norway (15)
- # clojure-uk (2)
- # clojurescript (17)
- # core-async (5)
- # cursive (6)
- # datahike (1)
- # datomic (8)
- # emacs (25)
- # etaoin (21)
- # events (4)
- # graalvm (33)
- # honeysql (7)
- # hyperfiddle (1)
- # lsp (49)
- # luminus (4)
- # malli (18)
- # off-topic (63)
- # reagent (11)
- # releases (1)
- # shadow-cljs (200)
- # timbre (1)
- # tools-build (17)
I went for the plist approach for now:
(clj2el-clj!
(def m {:a 1 :b 2})
)
m ;;=> (:a 1 :b 2)
(clj2el-clj!
(get m :a)) ;;=> 1
(clj2el-clj!
(do
(defn foo [m]
(get m :a))
(foo {:a 1}))) ;;=> 1
There are so many choices to make here, that it's probably never the correct one for every situation, so maybe I'll change it in the futureHi there! I have a question related to emacs fonts, not clojure 🙂 Is it possible to do light fonts in emacs, like vscode/idea? Maybe someone has recipe.
emacs<>vsc
except for the macros being bolded, it looks the same to me. You do have a larger font-size in your Emacs though
I'll make a separate #clj2el channel to not spam this channel any further. Spoiler alert: destructuring is working
Has anyone tried lsp-bridge with Clojure projects? https://github.com/manateelazycat/lsp-bridge Is it worth it? Does it really make things faster? My biggest, minor annoyance is with one big project. I use git worktrees and whenever I create a new one I have to initialize the lsp workspace. That takes a minute or two. I wonder if lsp-bridge can speed that up.
what is the slow part when initializing the workspace? if it's the LSP server, it doesn't look like this client would make anything faster for you
> what is the slow part Analyzing the files, I guess. Yeah, it doesn't seem that lsp-bridge offers any advantage for me. I never had problems with Emacs getting stuck while trying to complete. I'm not sure what this bridge would improve for me, tbh
is it possible to work on two different git branch at the same time without duplicating the git repo files?
Git worktree. You’ll end up with a second copy in your repo though. Not sure how your edit files if you didn’t have some duplicates though
thanks @U11BV7MTK.
> You’ll end up with a second copy in your repo though. https://morgan.cugerone.com/blog/how-to-use-git-worktree-and-in-a-clean-way/
Worktrees are nice. it takes time to get used to the workflow but you don't have to stash things anymore whenever you need to switch between branches. Funny, when I just started using worktrees, I couldn't figure out why my tests are failing, I asked my teammate to help. He joined a call, and things were suddenly working. I said thank you and only later I realized, I accidentally switched dirs and the tests were fine in the main branch, but the issue was still not fixed in my branch. That article above helps to keep the dir structure clean and less confusing.
At some point, I even added a helper to create a worktree from a GH issue. I'd press a couple of buttons, it would make a readable branch name, create a branch and a new worktree. Very nice
Why is that better than a branch? (I haven't read into working trees yet). So i should probably ask my questions after i do. ;)
you still have branches. You just have branches in different dirs. It's as if you cloned the repo multiple times, but of course worktrees won't require that much space, etc.
So now, for example, I can review a PR (running things in a separate branch) then in a different frame/window I can still track things in the main branch. I can actually review multiple PRs at the same time. Having separate REPLs for them and such
worktrees is how the Clojure CLI does all of its git stuff. the only big problem I've found with them is git submodules don't work with them (or didn't, this is now supposed to work since git 2.26)
oh interesting. i wondered how it kept multiple checked out versions in there but never dug in
yeah, it keeps one git object dir under /.gitlibs/_repos and per-sha work trees under /.gitlibs/libs
I have used a procure-git.sh
script inspired by clj cli in ci/build scripts
:
#!/bin/sh
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <git-repo> <ref>"
exit 1
fi
repo=$(echo $1 | sed -e 's/.*\///' -e 's/\.git$//')
mkdir -p /tmp/.gitlibs/
if [ ! -d /tmp/.gitlibs/$repo ]; then
git clone --quiet --mirror $1 /tmp/.gitlibs/$repo
fi
if [ ! -d .gitlibs/$repo/$2 ]; then
git --git-dir /tmp/.gitlibs/$repo worktree add --force --detach .gitlibs/$repo/$2 $2
fi
echo .gitlibs/$repo/$2