This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-27
Channels
- # babashka (45)
- # beginners (44)
- # calva (3)
- # cider (14)
- # clara (4)
- # clj-commons (3)
- # clj-otel (4)
- # cljsjs (1)
- # cljsrn (111)
- # clojars (5)
- # clojure (62)
- # clojure-europe (14)
- # clojure-nl (2)
- # clojure-uk (4)
- # clojurescript (31)
- # community-development (16)
- # conjure (7)
- # cursive (9)
- # data-science (1)
- # datalevin (10)
- # docker (1)
- # emacs (20)
- # fulcro (7)
- # helix (10)
- # jobs (4)
- # lsp (22)
- # malli (35)
- # meander (12)
- # music (1)
- # nbb (2)
- # off-topic (5)
- # pathom (3)
- # quil (1)
- # re-frame (12)
- # react (6)
- # reagent (18)
- # releases (1)
- # remote-jobs (1)
- # rewrite-clj (4)
- # ring (1)
- # shadow-cljs (10)
- # spacemacs (9)
- # tools-build (17)
Hey. How do I prevent values from REPL appearing in my echo area (the one at the bottom)? It doesn't give me much use and it also lags the UI as I have fat structs in REPL. And then everything jumps around without much point because when I move my cursor again the echo area clears up and then reappears in one second. It takes about 1 second to render that bottom result so I may move several times and experience lag. And then it jumps because the bottom suddenly expands after some time when I stop moving my cursor. If you look at the attached screenshot and press <left> key then the bottom result would immediately disappear and will happen to be rerendered after one second. This is not good. The only thing I want is that nothing would jump as I investigate the data structure by moving with my text cursor. So I simply want to disable this. I also use the result buffer constantly because it's predictable and I don't use this bottom expanding-collapsing one. Reproduction: 1. Print this into REPL:
(println (->> (range 1000)
(map (juxt identity (constantly {:key :item})))
(into {})))
2. Go to REPL buffer and move your cursor onto the map's key or on the starting/ending paren of the data structure.
3. Result in the snapshot:Is it possible to enable evil-motion-state
for cider-inspector-mode
? I want to have the keybindings for movement but at the same time I want to use the default keybindings for the mode.
It's also fine if I could use evil-motion-state
and define my own keybindings. But all my tries to enable this mode failed because this code doesn't work:
(add-hook 'cider-inspector-mode-hook (lambda () (evil-motion-state)))
It doesn't enable the evil-motion-state
and instead it triggers it when I navigate to the child parts of my data. I see this because the cursor changes the color for a brief moment.
Are you a user of evil-collection
? If so, that may be interfering:
(add-hook 'cider-inspector-mode-hook #'evil-normalize-keymaps)
from evil-collection/modes/cider/evil-collection-cider.elI'm a user of evil-mode-based editing if you meant that.
I think it didn't do anything. I evaluated this in eval-expression
and the nopened the inspector. And it didn't have the keybindings. Namely what I'm looking for is to use f
and repeats 5j
.
Do you have a full solution or is it simply an attempt to help? What should it do? The major mode there is a special-mode
which prevents editing. So when I click number 5
it says in the bottom that buffer is read-only. And this where f
command fails too.
Edit: I didn't restart emacs though. Did it work for you?
When I try the same expression and restart emacs it still doesn't work add w
and other key bindings to cider-inspect
mode.
I also tried this but it still didn't work:
(spacemacs-evil :variables
spacemacs-evil-collection-allowed-list
'(cider-inspector-mode)
)
I mean https://github.com/emacs-evil/evil-collection which is a separate package from evil. I'm not a spacemacs user, but it does look like spacemacs includes it, so I guess you are using it.
I would find some way of disabling it and then trying your code. I may be barking up the wrong tree, but it seems to be worth eliminating it as a cause. I can't (easily) test any of this because I don't have spacemacs.
I think the problem is that the mode is re-applied when the buffer loads after it runs all of the hooks. Because if I could add a hook and in it enable evil-motion
mode then I would be done. Then I would need to set up several function call bindings and that would be it.
But as the mode is re-applied every time then the hook can't be run at the end and I even see the cursor blink in pink color which signals that the evil-motion
state is enabled for a brief moment and then disabled again.
Basically this is me fighting spacemacs and emacs where all I want is VIM style editing and motions in all of the buffers with less magic keys that you somehow need to remember and which are different for every occasion.
Yeah I totally understand. I take the other route - I only use evil for editing text in programming buffers, and accept the emacs keys for nearly everything else. evil-collection is supposed to allow you to do exactly what you are trying to do, so I'd recommend making an issue on their https://github.com/emacs-evil/evil-collection/issues - this is exactly the sort of thing they should know how to fix.
(but it never worked, not for Clojure's exceptions, not for test reports, not for this one too. I expected to at least try something and hope for the best.)
The only thing that evil bindings work correctly on is cider-result
and that has been a flawless one. You can find, you can move by word, you can multiply commands... I'll try to file the issue later. I think that evil-collection
is about configuring each mode separately but I hope it's not.
Is there a way to automagically run my tests for a given function whenever I recompile that function? I see that there’s cider-auto-test-mode
for running all the tests for a given namespace whenever I reload the whole namespace, but I just want to run my tests for a specific function
you can do this natively in clojure:
❯ clj
Clojure 1.11.1
user=> (use 'clojure.test)
nil
user=> (defn foo [x] (inc x))
#'user/foo
user=> (deftest foo-test (is (= 4 (foo 3))))
#'user/foo-test
user=> (add-watch #'foo ::testing (fn [_ _ _ _] (foo-test)))
#'user/foo
user=> (defn foo [x] (* x 2))
FAIL in (foo-test) (NO_SOURCE_FILE:1)
expected: (= 4 (foo 3))
actual: (not (= 4 6))
#'user/foo
user=> (defn foo [x] (+ x 32))
FAIL in (foo-test) (NO_SOURCE_FILE:1)
expected: (= 4 (foo 3))
actual: (not (= 4 35))
#'user/foo
user=> (defn foo [x] (inc x))
#'user/foo
user=>
