Fork me on GitHub
#cider
<
2020-01-09
>
didibus07:01:48

I'm trying this: (setq cider-repl-shortcut-dispatch-char ?\?), but it doesn't seem to work, , is still the shortcut

didibus07:01:06

Hum, maybe that doesn't do what I think it does, now comma types a question mark

bozhidar09:01:13

@didibus You might have to set this before requiring CIDER, as it gets bound in the keymap of cider-repl-mode.

mikerod15:01:50

and a question or 2 perhaps sprung into my mind that I cannot find answers to.

mikerod15:01:13

I notice the mode selected is clojurescript-mode - and it discusses using clojure-mode too.

mikerod15:01:30

How do we know decide what major mode the var needs set in?

mikerod15:01:47

For instance, the example given includes cider-clojure-cli-global-options

mikerod15:01:55

which is used during something like a cider-jack-in-*

mikerod15:01:46

and the buffer you have open can be anything within the project, so not necessarily are you “in” clj/cljs major modes already when you do that action

mikerod15:01:04

if I had to “guess the mode” I would have guessed cider-repl or something

mikerod15:01:15

so how do you know which mode is relevant for commands you run like this

mikerod15:01:07

an as an update to above question, I wanted to set cider-figwheel-main-default-options and tried these 3 in this order - closing and opening a project.clj (has clojure-mode active) buffer each time (the buffer I initiated cider-jack-in-clj&cljs from (since dir-locals are reloaded when buffer opens docs say):

((clojurescript-mode . ((cider-figwheel-main-default-options . "dev")))) ;; <- prompt asked me for build still
((clojure-mode . ((cider-figwheel-main-default-options . "dev")))) ;; <- prompt asked me for build still

((nil . ((cider-figwheel-main-default-options . "dev")))) ;; <- no more prompt - var setting was used

bozhidar18:01:50

clojurescript-mode is derived from clojure-mode, so anything you set for clojure-mode will get applied in clojurescript-mode as well.

bozhidar18:01:11

You can always find the major mode of some buffer by pressing C-h m there.

bozhidar18:01:15

As for the other part of your question - the syntax you’ve used is incorrect.

bozhidar18:01:11

((major-mode
  (some-var . "foo-bar"))

bozhidar18:01:52

I’m puzzled how this worked at all.

mikerod19:01:38

@bozhidar woah! didn’t realize syntax was wrong - will have to try all over again - but yeah, weird the nil case worked if that’s why it wasn’t working

mikerod19:01:03

but you are saying what you do with the M-x command here has it’s mode just depend on the file you are in?

mikerod19:01:34

so clojure-mode is more universal than clojurescript-mode for a clj/cljs project (covers more files). but if I try to jack-in from some, say html file buffer - the mode would still be wrong

bozhidar09:01:22

Yeah, if you want to jack-in from all sorts of buffers you might use nil (all modes) then. I always open some clojure file first, that’s why this is not an issue for me. :)

mikerod19:01:53

even though I think jack-in supports being called upon from any buffer from a file in the project dir

Mehdi H.22:01:55

hi again @dpsutton, M-x cider-version returns CIDER 0.21.0 (New York)

dpsutton22:01:15

can you upgrade your cider version?

Mehdi H.22:01:15

ok yeah will try to move to 0.23.0

Mehdi H.22:01:17

It was indeed all that was needed. Thank you for your guidance. I am mildy embarrassed that it was that easy a fix... but I did try to look at reported issues before asking, albeit not closed ones 🙂 Thanks!

dpsutton22:01:31

no embarrassment ever!

dpsutton22:01:39

happy to help 🙂

Mehdi H.22:01:02

You did! Many thanks!