This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-25
Channels
- # announcements (5)
- # beginners (74)
- # boot (5)
- # cider (57)
- # cljdoc (5)
- # cljs-dev (45)
- # clojure (37)
- # clojure-dev (6)
- # clojure-europe (4)
- # clojure-italy (17)
- # clojure-nl (11)
- # clojure-spec (48)
- # clojure-uk (96)
- # clojurescript (79)
- # cursive (17)
- # data-science (1)
- # datomic (27)
- # emacs (2)
- # fulcro (22)
- # immutant (1)
- # java (62)
- # juxt (4)
- # kaocha (4)
- # lein-figwheel (5)
- # leiningen (6)
- # midje (1)
- # mount (1)
- # music (3)
- # nrepl (6)
- # off-topic (49)
- # pathom (10)
- # pedestal (2)
- # re-frame (43)
- # reagent (2)
- # ring (2)
- # shadow-cljs (78)
- # spacemacs (6)
- # test-check (2)
- # tools-deps (4)
the clojurescript.md docs suggest https://github.com/clojure-emacs/cider/blob/62134b4ffa109ddfd143303db929af4760182470/doc/clojurescript.md#L102-L109 but those aren't vars marked as safe, so doing this presents the user with a warning when they open files in the directory. Is it worth changing them to be marked as safe? I don't think they're actually unsafe, as they don't affect anything until you jack-in, which is inherently an unsafe operation, as I can run arbitrary code on your machine at that point.
I brought this up a bit ago and I think @bozhidar agreed. And yeah it's super annoying
this is about to become the default in edge (https://github.com/juxt/edge/issues/62)
in the past I have made PRs for this, but I don't use emacs, so I don't run the code or anything before doing so.
controversial question: I want to include something like: (define-key clojure-mode-map (kbd "M-r") (cider-interactive-eval "(dev-extras/reset)"))
in the emacs guide, so, what is a good key, and how do I do this properly?
well IMO the current keybinds situation is a bit of an untenable mess and there aren’t any good ones left… maybe it would fit in cider-ns-map
if it’s conceptually similar to cider-ns-refresh
cider-ns-map
is prefixed C-c M-n
by default
You could also recommend customising cider-ns-refresh-before-fn
or cider-ns-refresh-after-fn
if it makes sense to run reset
before/after a tools.namespace reload
i wonder if we could do a pass where we remove lots of keybindings and open up something for users to have a place to assign stuff. I know that I only use like 10 or so keybindings.
@cichli thanks for the tip, I'm going to add that as a default to the .dir-locals in edge 🙂
controversial: I don't think there should be a keybinding for cider-jack-in-clj&cljs. You do it once a day at most 😛
Or a single keybinding for something like cider-jack-in-command
, which could be configurable to use either CLJ, CLJS, or both
I would like to see a common .dev.edn
though, as I have the same problem when launching clj
and rebel
and vim
, etc.
It’s an interesting idea, and we can parse edn in emacs lisp now (not sure about vim though)
I had a look at your Edge PR: one other option you could mention or include a default for is cider-repl-init-code
. This is a list of strings of code to execute at REPL init – for example you could do:
(add-to-list 'cider-repl-init-code "(dev)")
Or just set it to '("(dev)")
Should run in the Clojure session before the CLJS REPL is started
Ah, there’s a bug, in-ns
has no effect in cider-repl-init-code
! We ignore ns
in the response when we eval it
and yeah, I think eval
is the only way to do that 😕
At least if you mark it as safe, it only marks the exact form as safe, not eval
generally
I’m taking a look, thanks though 🙂
My colleague has been bothering me about this forever, so it will be nice to resolve it
Pushed [a fix](https://github.com/clojure-emacs/cider/commit/0dea44b460aaa56feedda1ecebeef3b45e49cdf3)
You can parse that markdown manually 😛
here's the interesting thing: the cljs repl runs the init code too 🙂 I put the emacs cljs repl function in user, that's okay though 🙂
Probably best to fully qualify the cljs repl function anyway
Since there’s also :init-ns
in Leiningen’s :repl-options
So we can’t be sure the initial namespace is user
generally
hmm, I'm noticing a bit of a race condition between cider-repl-init-code
and cider-cljs-repl-types
I think.
There is a fn in core for that in 1.10
Actually it was made private https://github.com/clojure/clojure/commit/ee3553362de9bc3bfd18d4b0b3381e3483c2a34c
I’ll see if we can make sure that waits for init to be done first
I think it's actually that init
is called in the clj
and pending-cljs
repl simultaneously.
Yeah you’ll need the locking either way, because of the two simultaneous REPLs
But I’m testing a change that lets the evaluation of cider-repl-init-code
finish before proceeding with the rest of connection init
i think cider-quit is a bit too strong and can sometimes take other existing connections out of cider-mode
I haven’t really looked at how clj/cljs sessions are managed since it was moved into a separate library. It’s not an easy problem
is there a way to output all the messages in nrepl if I start it from the terminal? I have seen that there is a PR for verbose logging but I wonder if we have something already in there I am missing
Messages as in nrepl requests/responses? In CIDER you can set nrepl-log-messages
, but there’s nothing in nrepl itself for that atm
@cichli ok thanks!