Fork me on GitHub
#cider
<
2018-03-19
>
wusticality03:03:37

Is there a setting to force the *cider-inspect* window to update it’s values when you’re debugging in another window? Gets frustrating having to navigate to it to refresh it. I’m sure there is and I’m not finding it, thanks in advance. 🙂

theeternalpulse04:03:00

I'm using the boot cider repl -s wait command and when I go to use cider-connect I have to manually enter the port. I remember it used to detect the running repl instance.

bozhidar04:03:04

> Is there a setting to force the *cider-inspect* window to update it’s values when you’re debugging in another window? Gets frustrating having to navigate to it to refresh it. I’m sure there is and I’m not finding it, thanks in advance. 🙂 (edited)

bozhidar04:03:37

@iwannaseethelight No, there’s no such way currently. How do you use the inspector and the debugger together?

bozhidar04:03:15

@theeternalpulse I think there was some port detection logic only for leiningen, that was parsing the the output of ps or something like this. See https://github.com/clojure-emacs/cider/blob/master/cider.el#L871

theeternalpulse04:03:07

I'd love to take a look at that when I have the time. I'm a bit less fluent in lisp than I am in clojure, so I need to get set up with testing and the lisp environment, but would like to take a look. Do you need an issue first @bozhidar

bozhidar04:03:15

It’s easier than it looks. 🙂 No need for a ticket, but you can always file one if you want.

theeternalpulse04:03:29

cool, do you usually just test something like this eval'ing with certain arguments piece by piece?

theeternalpulse15:03:37

So I looked into it deeper last night, the boot process sadly doesn't emit the parent directory, so finding the .nrepl port can not be found. I was wondering if it would be too out of scope for me to do a secondary look up the parent project path, up to the home path for the .nrepl-port file if the initial file ends up empty?

theeternalpulse15:03:29

3638 24.5 4.9 7822492 801312 pts/2 Ssl+ 08:12 0:57 java -Dboot.app.path=/usr/local/bin/boot -jar /usr/local/bin/boot -i (require 'cider.tasks) -d org.clojure/tools.nrepl:0.2.13 -d com.billpiel/sayid:0.0.15 -d refactor-nrepl:2.4.0-SNAPSHOT -d cider/cider-nrepl:0.17.0-SNAPSHOT cider.tasks/add-middleware -m com.billpiel.sayid.nrepl-middleware/wrap-sayid -m refactor-nrepl.middleware/wrap-refactor -m cider.nrepl/cider-middleware repl -s -H :: wait

theeternalpulse15:03:44

that's an example of the boot process

theeternalpulse15:03:47

learned a handful of lisp along the way so thanks for that lol

bozhidar04:03:30

This and the regexp after it have to tweaked to support boot as well., which should be super simple.

bozhidar04:03:35

(or boot can write an .nrepl-port file)

wusticality04:03:34

Hey @bozhidar - I have a split window in emacs, displaying local vars on one side and the code I’m debugging on the other. The ideal use case would be for the local vars to update as I step in the debugging window. Currently I have to type l and then C-x o back to my code to refresh the buffer.

bozhidar04:03:00

I see. Well, you can file a feature request ticket and we can see what we can do about this.

wusticality04:03:21

For sure, will do

wusticality04:03:35

I’d also like to point out that cider is fucking awesome 😉

wusticality04:03:53

It’s allowed me to stay inside emacs, thank god

bozhidar04:03:35

It was my plan for myself when I started working on it, but I never actually got to using Clojure professionally. 😄

wusticality05:03:43

Yeah I took a gig down under writing clojure but f*ck IntelliJ 😉

mitchelkuijpers09:03:58

Is there something changed in how cider detects piggieback? I have been using shadow-cljs happily for the past few months but after an upgrade it gives me:

error in process filter: Piggieback is not available.  See  for details
Btw shadow-cljs shims piggieback

bozhidar09:03:24

Yeah, I realized this just yesterday.

bozhidar09:03:16

I’ll update the detection to not be global. I had no idea there was another cljs nREPL eval middleware.

bozhidar09:03:05

@mitchelkuijpers Btw, how exactly do you start the cljs repl with shadow-cljs?

bozhidar09:03:18

Have you added a new entry to the list of known cljs repls or what?

mitchelkuijpers10:03:40

I have this in my dir-locals:

(setq cider-cljs-lein-repl "(start-cljs-repl)")

mitchelkuijpers10:03:54

But I am not sure how to configure this anymore

bozhidar10:03:30

I’ve just committed a fix for the piggieback check.

bozhidar10:03:12

As for the rest - you’ll have to update the list of known cljs repls and add there some entry for shadow-cljs.

bozhidar10:03:17

(defconst cider-cljs-repl-types
  '(("Rhino" "(cemerick.piggieback/cljs-repl (cljs.repl.rhino/repl-env))"
     nil)
    ("Nashorn" "(cemerick.piggieback/cljs-repl (cljs.repl.nashorn/repl-env))"
     cider-check-nashorn-requirements)
    ("Figwheel" "(do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))"
     cider-check-figwheel-requirements)
    ("Node" "(do (require 'cljs.repl.node) (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)))"
     cider-check-node-requirements)
    ("Weasel" "(do (require 'weasel.repl.websocket) (cemerick.piggieback/cljs-repl (weasel.repl.websocket/repl-env :ip \"127.0.0.1\" :port 9001)))"
     cider-check-weasel-requirements)
    ("Boot" "(do (require 'adzerk.boot-cljs-repl) (adzerk.boot-cljs-repl/start-repl))"
     cider-check-boot-requirements))
  "A list of supported ClojureScript REPLs.

For each one we have its name, the form we need to evaluate in a Clojure
REPL to start the ClojureScript REPL and functions to very their requirements.")

bozhidar10:03:32

You can use add-to-list to extend this.

bozhidar10:03:39

And finally - set cider-default-cljs-repl to whatever name you decide to give to this new entry you’ve added.

mitchelkuijpers10:03:45

Ah ok the hard part is that you have to choose the build for shadow-cljs

mitchelkuijpers10:03:59

But I will try it out thank you so much @bozhidar

bozhidar10:03:55

I’m afraid I have no idea what this is. 🙂 I recently revamped the cljs support, but at the time I didn’t even know what shadow-cljs was.

mitchelkuijpers10:03:42

No problem, I'll try it out. Maybe you would like a PR to add shadow-cljs support?

bozhidar10:03:10

Yeah, I’d love this!

bozhidar10:03:33

(that’s why I learned about shadow-cljs just yesterday)

mitchelkuijpers11:03:48

Very cool @bozhidar this works:

(add-to-list 'cider-cljs-repl-types '("Shadow CLJS" "(do (shadow.cljs.devtools.server/start!) (shadow.cljs.devtools.api/watch :app) (shadow.cljs.devtools.api/nrepl-select :app))" nil))
But the problem is that I specified the build :app which you cannot know beforehand

bozhidar11:03:36

What are those builds?

bozhidar11:03:57

If we can read them from somewhere maybe we can prompt the user to select one?

mitchelkuijpers11:03:51

Yes there is a shadow-cljs.edn with a :builds key and the a map

thheller11:03:19

hey everyone!

mitchelkuijpers11:03:40

@bozhidar @thheller is the creator of shadow-cljs

mitchelkuijpers11:03:46

But you maybe already know that

thheller11:03:55

he knows 😉

bozhidar11:03:19

Hey Thomas!

thheller11:03:49

Hey Bug 😉

thheller11:03:59

is there some way to configure what cider-jack-in calls?

thheller11:03:13

ie. not lein?

bozhidar11:03:47

Yeah. It tries to detect your project type, in the absence of a project it uses clojure (tools.deps) Let me find the relevant section of the manual.

bozhidar11:03:06

And you can also override the command invoked for each project type.

thheller11:03:01

my emacs knowledge pretty much ends at starting it so I wouldn't even know where to start configuring it

thheller11:03:13

I only used cider-connect so far since I couldn't get cider-jack-in to work

bozhidar11:03:37

What’s the problem you’re encountering with it?

thheller11:03:43

its probably my weird project setup in shadow-cljs. I usually start a seperate process via lein with-profiles +cljs repl

bozhidar11:03:48

As for configuration - simply put you need to add entries like (setq some-var some-value) in your init.el configuration file.

thheller11:03:04

and then just connect remotely with cursive/cider-connect

bozhidar11:03:32

doesn’t seem that weird to me 🙂

bozhidar11:03:51

at least the invocation bit that is

thheller11:03:05

I don't know that I did ... but I can't for the life of me figure out why things appear in the line below M-x cider- and I can't edit the command anymore?

bozhidar11:03:41

That looks odd indeed.

thheller11:03:53

restart fixed it ... but this happens frequently so its really annoying

bozhidar11:03:13

Trust me, it’s not a standard Emacs thing. 🙂

bozhidar11:03:10

I haven’t used Spacemacs, I don’t like using a setup I haven’t crafter myself, because that means I don’t know what exactly’s going on there.

thheller11:03:12

its probably a key binding I'm used to using from Cursive but I can't figure out how to get out of it 😛

thheller11:03:16

emacs is great because you can do everything. its also horrible because you have to do everything.

bozhidar11:03:25

Control+G most likely.

thheller11:03:36

got tired of my setup breaking constantly that I moved on years ago

bozhidar11:03:49

If you want something simpler - you might look into my one-file config https://github.com/bbatsov/emacs.d/blob/master/init.el

bozhidar11:03:14

At leat it’d be easier for me to tell you what to modify and where.

thheller11:03:10

can I get evil-mode easily this way?

bozhidar11:03:28

Generally all the config you need is:

(require 'package)

(add-to-list 'package-archives
             '("melpa" . "") t)
;; keep the installed packages in .emacs.d
(setq package-user-dir (expand-file-name "elpa" user-emacs-directory))
(package-initialize)
;; update the package metadata is the local cache is missing
(unless package-archive-contents
  (package-refresh-contents))

(use-package cider
  :ensure t
  :config
  (add-hook 'cider-mode-hook #'eldoc-mode)
  (add-hook 'cider-repl-mode-hook #'eldoc-mode))

thheller11:03:37

error: Package ‘use-package-’ is unavailable

bozhidar11:03:03

What’s your Emacs version?

bozhidar11:03:01

Can you do M-x package-refresh-packages?

bozhidar11:03:36

I now see the problem

bozhidar11:03:52

Do M-x package-install RET use-package and restart.

bozhidar11:03:13

I have installed it manually and forgot to add a check to install it if it’s missing.

thheller11:03:53

Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
For information about GNU Emacs and the GNU system, type C-h C-a.
Contacting host: 
gnutls.c: [1] (Emacs) GnuTLS library not found
Contacting host: 
Opening TLS connection to ‘’...
Opening TLS connection with ‘gnutls-cli --x509cafile nil -p 443 ’...failed
Opening TLS connection with ‘gnutls-cli --x509cafile nil -p 443  --protocols ssl3’...failed
Opening TLS connection with ‘openssl s_client -connect  -no_ssl2 -ign_eof’...failed
Opening TLS connection to ‘’...failed
Package refresh done
Failed to download ‘melpa’ archive.

thheller11:03:07

I guess thats why nothing works 😛

bozhidar11:03:49

Just edit the file I sent you and change https to http.

bozhidar11:03:25

Those lame ssl problems lately have been killing me.

xiongtx23:03:46

@U4PUTN69G I thought this was fixed on the ELPA side?

gonewest81823:03:21

? where? travis?

gonewest81823:03:09

Oh, now I see the @thheller discussion. It looks like Emacs was installed, maybe, without gnutls support compiled in nor the gnutls-cli available… ?

gonewest81823:03:28

Oh, interesting. I

gonewest81823:03:03

I’m not able to resolve http://melpa.org

$ ping 
PING  (198.105.244.130): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C

gonewest81823:03:29

and now I can:

Neils-MBP:~ neilo$ ping 
PING  (104.239.207.44): 56 data bytes
64 bytes from 104.239.207.44: icmp_seq=0 ttl=44 time=55.442 ms
64 bytes from 104.239.207.44: icmp_seq=1 ttl=44 time=56.520 ms
64 bytes from 104.239.207.44: icmp_seq=2 ttl=44 time=55.828 ms
^C

gonewest81823:03:11

Different IP addresses, mind you. There is some round robin thing going on, and one of the servers is unresponsive.

xiongtx01:03:51

Maybe report this to the ELPA maintainers?

gonewest81814:03:38

I’ll check again later and report. That was Melpa, by the way, not Elpa. So that’s Steve Purcell et al.

thheller11:03:30

ok now its installing stuff

thheller11:03:01

can I pin a version somehow? I'm not a fan of using SNAPSHOT deps

bozhidar11:03:03

is this in a clean project?

bozhidar11:03:07

Seems that for some reason one of the deps in not downloaded or something, but I can’t imagine why.

bozhidar11:03:35

Did the project use clojure to start?

thheller11:03:05

no its my shadow-cljs project via project.clj

thheller11:03:14

it asked if I wanted to use lein or clojure

thheller11:03:22

picked lein then the error above happened

bozhidar11:03:03

Can you create one test project with lein new and see if jack-in will work there?

dpsutton15:03:32

is anyone having trouble with cider-default-cljs-repl not being read from the dir-locals?

bozhidar15:03:20

I think this was a problem I fixed shortly after introducing it.

bozhidar15:03:37

One call to hack-dir-local-variables was misplaced.

dpsutton15:03:20

was this recently? i pulled last night and re-eval'd just now and now its working.

dpsutton15:03:31

but looks like a false alarm either way

bozhidar16:03:59

That’s nice. Seems finally Cursive stopped growing this year. Guess now we know how many people actually enjoy using Emacs, as opposed to having been forced to use it. 😄

bozhidar16:03:44

And I find it funny that there’s a mention of Spacemacs. 😄

emacs 1
bozhidar17:03:39

Looking at this data it seems to me we can drop support (or at least remove the CI builds for Clojure 1.7 and Java 1.7).

mikerod18:03:14

No more Java 7 so soon? 😧

wusticality20:03:25

morning from nz all