This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-31
Channels
- # announcements (20)
- # asami (14)
- # aws (6)
- # babashka (15)
- # beginners (83)
- # biff (6)
- # calva (93)
- # cider (3)
- # clj-kondo (21)
- # cljdoc (106)
- # cljs-dev (32)
- # clojure (165)
- # clojure-dev (78)
- # clojure-europe (54)
- # clojure-italy (9)
- # clojure-nl (9)
- # clojure-norway (24)
- # clojure-uk (4)
- # clojurescript (6)
- # community-development (2)
- # conjure (2)
- # core-typed (14)
- # datahike (4)
- # datomic (2)
- # emacs (40)
- # events (1)
- # fulcro (11)
- # graalvm-mobile (29)
- # graphql (8)
- # honeysql (19)
- # java (1)
- # jobs (1)
- # lsp (232)
- # malli (5)
- # membrane (112)
- # nextjournal (11)
- # off-topic (63)
- # portal (12)
- # re-frame (6)
- # reagent (3)
- # reitit (4)
- # rewrite-clj (2)
- # shadow-cljs (25)
- # tools-deps (6)
wait, I just witnessed a behavior I wish I knew more about: I was working on a file in a project, than I followed some symbol definition in a dependency, I made some modifications there and I could immediately use the new function in my project. But then, I closed emacs. When I reopened it, and started a new repl, the dependency still had the patch. How is that possible? Where's the patched version stored?
I found them in ~/.gitlibs
, but where's the reference to a particular checkout stored in my project then?
Ok, I see that some kind of info has to be contained in the .cpcache
folder in my project, but I'd still like to know better how it works. Are these caches per-project?
You should be able to see the filename when you jump to a dependency's file. That will tell you what thing you are changing. I use mostly leiningen and there the modifications aren't easily "saveable" in the same way, I think (because such dependencies are typically JAR files)
The mechanism is pretty easy to understand:
~/.gitlibs/libs/eftest/eftest $ ls
4fc03680c590aca6a13aa837c07b6eb54b7dbab9
there's one dir per git SHA.
if two projects consume the same git dep at the same git sha, they use the same dir
If they specify different SHAs, there will be two different checkouts residing in two independent directoriesit makes sense that modifications are persistent - these are vanilla checkouts that you can modify like any other one.
Perhaps CIDER should enable read-only-mode
to not make modifications so easy
(after you would M-x read-only-mode
to disable it again if you know what you're doing)
This may be for @tomd, but others may know...
Please note: I don't really know emacs at all. If you say, "Have you tried X" then my response will be, "I didn't know that X existed, and I have no idea how to even start trying to use it".
With a basic setup of emacs+evil, does anyone know how I can get ^R to do "redo", please? My previous system worked correctly, but I've just installed emacs on 2 new systems and am encountering this problem.
I note that the https://github.com/syl20bnr/spacemacs/issues/14036, so I'm wondering if it's a more general issue?
I discovered the evil-undo-system
setting, but installing undo-tree
and setting it to that didn't work, and neither did installing undo-fu
and trying that one. (I only kept one installed at a time).
evil's maps should set this up for you by default:
(define-key evil-normal-state-map "\C-r" 'evil-redo)
what happens if you do C-h k C-r
in normal mode?also if you do C-h v evil-undo-system <return>
and let me know what that is - customizing this is the easiest way to make redo just workβ’ and probably the actual answer to your question
I do have "C-h k" in my notes, and I use it a lot π
When you say, "normal mode" do you mean when evil is not enabled? Or evil is enabled and you're not in insert mode? (if it's the latter, then it's bound to (evil-redo count)
BTW, the system I fiddled with all weekend is another machine. This one right now is basically emacs+cider+evil, and not much else. There is very little manual config at all
ok so you just need to customize evil-undo-system and you should be fine:
(customize-set-variable 'evil-undo-system 'undo-tree)
in your init.el should do itah sorry I thought you had undo-tree up and running. you can choose undo-fu if you have that
(they're all much of a muchness afaic, but if you have specific undo/requirements, then you may want to look into the differences)
Sorry... On the weekend I was trying this with another machine. I installed undo-tree, and that didn't work. I then uninstalled it and installed undo-fu, and that didn't work. Today I'm on a work machine. I haven't installed either undo-tree nor undo-fu, mostly because I don't know how to use them, and I couldn't hook them up to evil
if you're not on emacs 28, I'd install undo-fu and set that as you evil-undo-system. it's very simple from my experience
Sorry... I was just trying to see if I could get brew to update to a more recent emacs, but it doesn't seem to know about anything after 27.2
(or (set 'evil-undo-system 'undo-fu)
, which I believe is the same thing, but I tried both anyway π )
@ericdallo is there a way to show nested levels of a map in lsp breadcrumbs header? i.e. when the cursor positioned in a map like {:foo {:bar {:zap 1}}}
inside the innermost element, could I make it to display in breadcrumbs :foo :bar :zap
?
I think it could be possible, but it'd need a some work on clojure-lsp side, not that easy though
Alright, I was curious thinking maybe lsp does that already. lsp does so many cool things, I don't even know anymore what it can and can't do... lol
This is a little helper I wrote some time ago for Emacs+CIDER - at the time, I don't think there was an equivalent (not sure if there is now):
(defun my-cider-tinker ()
"Evals current defn at point and attempts to call it with user args."
(interactive)
(lexical-let* ((my-form (read-string "args: "))
(eval-result (call-interactively #'cider-eval-defun-at-point))
(my-buffer (current-buffer))
(my-place (cider-defun-at-point 'bounds)))
(cider-interactive-eval
(format
"(let [x (@*1 %s)]
(prn)
(prn \"my-cider-tinker result:\")
(prn x)
x)"
my-form)
(cider-interactive-eval-handler my-buffer my-place))))
When executed on a form (typically a function defn), it prompts the user for args, and then runs the form/fn with those args and prints the result