Fork me on GitHub
#cider
<
2017-01-19
>
andrewboltachev12:01:40

Hi. Is there a way to set max length (for formatting via C-M-\) to e.g. 120 characters?

bhauman13:01:58

cider 15-snapshot upgrade == effortless. Re-read the docs last night super sweet stuff.

bhauman13:01:30

I think cider-scratch is my new best friend.

dpsutton13:01:59

cider scratch defaults to clojure I believe

dpsutton13:01:20

there's a function called cider-toggle-current-connction or something like that that can switch you to cljs mode

dpsutton13:01:28

things are a little hacky in that though and I'm working on it

bhauman13:01:58

good stuff! Is clojure interation mode significantly different? I looked at the bindings and couldn't really see anything

dpsutton13:01:30

haven't looked into the keybindings but it inherits from clojure-mode so should be very similar

benedek14:01:01

@bhauman re. cider-scratch. same here

qqq14:01:35

how does lispy forward/backward differ from right/left ?

qqq16:01:30

Is there a way in eamcs to bind a hot key to "emulate C-x C-e" ? so I want it to run eval-last-sexp when in .el files, cider-eval-last-esexp in .clj files -- and basically do whatever "the current file format has bound C-x C-e to" ?

dpsutton16:01:23

i believe that's the way keybindings work in general

dpsutton16:01:46

if you hit C-x C-e it will always do "whatever 'the current file format has bound to C-x C-e to'"

qqq16:01:30

say my goal is to bind C-p to do whatever C-x C-e does, how od I do this?

qqq16:01:49

if I bind C-p to eval-last-sexp, then it alos tries it in *.clj files, which is wrong, since it sholud be doing cider-eval-last-sexp

qqq16:01:08

so my goal is to have another hotkey "emulate whatever C-x c-e does"

dpsutton16:01:05

you'd need to add a hook

dpsutton16:01:18

and it looks up what function is bound to C-x C-e and bind it to your keybinding

dpsutton16:01:39

Variable: change-major-mode-after-body-hook This is a normal hook run by run-mode-hooks. It is run before the mode hooks. Variable: after-change-major-mode-hook This is a normal hook run by run-mode-hooks. It is run at the very end of every properly-written major mode command.

qqq16:01:24

Hmm, okay, so my binding is inside a hydra.

qqq16:01:37

If I use a hook, I'd have to have a global varaible somewhere which the hook sets and the hydra calls.

qqq16:01:46

Is there some way in eamcs to say "fake pressing the key C-x C-e" ?

qqq16:01:55

I tried C-h f ... but have not found such a function yet.

mpenet17:01:26

get the name of the function you're interested in via describe-key and the keystrokes/combo you want to it

mpenet17:01:37

that should do it

dpsutton17:01:04

he wants this automatic registration of C-x C-e => C-p in every mode

dpsutton17:01:01

yeah that's why i was saying to look at change-major-mode-hook

dpsutton17:01:56

(lambda () (let ((f (function-lookup-whatever-this-is (kbd "C-c C-e"))) (set-key ...))

mpenet17:01:58

I guess you can hack something around that yes. I wouldn't be surprised if there's a mode that does this already

bhauman19:01:10

hmmm with newlines in exceptions in the *cider-error* buffer aren't printed

bhauman19:01:35

this is rough in a spec world

bhauman19:01:12

newlines being stripped out somewhere lower?