Fork me on GitHub
#cider
<
2018-07-11
>
dpsutton01:07:59

@hagmonk what kind of emacs are you running? it looks like that's been deprecated but you should still have the info

(make-obsolete-variable
 'find-tag-marker-ring
 "use `xref-push-marker-stack' or `xref-pop-marker-stack' instead."
 "25.1")
> etags.el

hagmonk01:07:21

Doom emacs v2.0.9, emacs v26.1

hagmonk01:07:57

cider-find-var is what I'm invoking

dpsutton01:07:06

what does C-h V find-tag-marker-ring say?

hagmonk01:07:28

eww, it doesn't exist

dpsutton01:07:38

my emacs has etags.el built in

hagmonk01:07:53

huh so etags.el is potentially missing entirely

dpsutton01:07:11

oh is doom the executable or the init package?

hagmonk01:07:43

it's a spacemacs like distro, so it's all hung off the init

dpsutton01:07:04

do you brew install the executable? where do you get that from?

dpsutton01:07:13

there's aquamacs, brew, gnu, etc

hagmonk01:07:14

so etags.el should have come with that?

dpsutton01:07:22

i'm still looking for that actually. in the source

hagmonk01:07:37

./Contents/Resources/lisp/progmodes/etags.el.gz

dpsutton01:07:12

that sounds like it should be visible then. hmm

hagmonk01:07:57

how it's normally loaded?

hagmonk01:07:36

emacs.d for doom just has this to say:

modules/config/default/+bindings.el
124:        :i "C-]"   #'company-etags

modules/feature/evil/+everywhere.el
62:    etags-select

modules/feature/lookup/config.el
98:;; By default, `etags--xref-backend' is the default xref backend. No need. We'll
104:  (let ((xref-backend-functions '(etags--xref-backend t)))

dpsutton01:07:44

do you see find-tag-marker-ring in that file?

hagmonk01:07:48

hmm no actually

dpsutton01:07:05

so its just not in that file at all?

dpsutton01:07:58

i don't understand who controls these files. maybe it is clobbered by doom? this is in emacs/lisp/progmodes/etags.el.

dpsutton01:07:02

one thing to try: in cider-jump-to replace (ring-insert find-tag-marker-ring (point-marker)) with the suggested change: (ring-insert xref-push-marker-stack' (point-marker))

dpsutton01:07:15

maybe there's a reason it's been deprecated

hagmonk01:07:40

I'm trying to make the repl start again ... where's that -SNAPSHOT fix?? lol

hagmonk01:07:24

error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.io.FileNotFoundException: Could not locate orchard/misc__init.class or orchard/misc.clj on classpath., compiling:(cider/nrepl/middleware/pprint.clj:1:1)

dpsutton01:07:39

Oh what a pain

dpsutton01:07:38

Did you lein install it recently when testing your patience?

dpsutton01:07:05

There's some Mr Anderson shenanigans in there

hagmonk01:07:06

no I'm all clojure-cli / deps.edn

hagmonk01:07:47

rebooting emacs, let's see ...

dpsutton01:07:44

Are you trying this in cljs or a clojure project

dpsutton01:07:25

Cider nrepl does some source rewriting to prevent cider depend from interfering with project dependencies. Are you using git coordinates for that?

hagmonk01:07:40

hmm said xref-push-marker-stack can't be found either

dpsutton01:07:50

I thought that was emacs built in 25

dpsutton01:07:10

I'm starting to suspect your install

hagmonk01:07:02

yeah it wouldn't hurt for me to throw down a new emacs

hagmonk01:07:32

downloading a nightly build, because that's how I roll (and how I get into these situations)

dpsutton01:07:30

build from source!

dpsutton01:07:33

it's really easy

hagmonk01:07:02

I used to build from source, I had a brew command that worked pretty well ...

dpsutton01:07:04

i actually switched to linux from my beloved mac because i started building from source. and xcode said I could have gcc buti had to ask apple nicely to install them 😞

hagmonk01:07:44

well I'm on 27.0.50 now, lol

hagmonk02:07:01

you should check out Alacritty, that's the only other thing I habitually build from source

dpsutton02:07:01

same here. and its smooth sailing

dpsutton02:07:19

i'm on it now

hagmonk02:07:21

I've never used it on Linux, actually

dpsutton02:07:46

ah one of the new rust programs

dpsutton02:07:00

no scrollback. is this your standard terminal?

hagmonk02:07:29

yeah the idea is that you tmux your way through everything :)

dpsutton02:07:29

oh and wayland funkiness. i'm on fedora 27 so that would bite me

hagmonk02:07:51

it was a nice forcing function, I had to become proficient in tmux as a result

dpsutton02:07:17

you are in and out of many machines? I'm largely if not exclusively on my own all the time

dpsutton02:07:43

otherwise i would. i also need to learn tramp from emacs

hagmonk02:07:45

when you say in and out - you mean do I move between different physical machines?

dpsutton02:07:54

no remoting to many

dpsutton02:07:04

which i understood to be the principal benefit of tmux

hagmonk02:07:03

oh I'd say the principal benefit is that it's basically a window manager for your terminal

hagmonk02:07:53

there's also a modal selection you can drop in to, so you can scroll back in the buffer, search for text, highlight it, yank it … it's quite emacs-ish

dpsutton02:07:52

are you able to start up a repl and if so, jump to definition?

hagmonk02:07:18

I had to flush doom emacs completely out first, trying again now

hagmonk02:07:26

alright, after all that

hagmonk02:07:40

find-tag-marker-ring symbol is still void, lol

dpsutton02:07:02

well at least you got those fresh emacs bits

dpsutton02:07:12

can you eval (require 'etags) and try again?

hagmonk02:07:50

that seems to have done the trick!

dpsutton02:07:14

ha. you should reopen that issue. it seems that require is no longer in the code

dpsutton02:07:33

it will be a super simple fix. i guess somewhere in my init that gets required so i've never seen it

dpsutton02:07:52

how long have you been without find-var? that would be unbearable for me

hagmonk02:07:09

I think something else in my stack was probably autoloading it, it has been on and off …

hagmonk02:07:42

is there a protocol for re-opening issues, or should I just file a new issue?

dpsutton02:07:26

i put a comment on that issue and tagged bbatsov. i bet he sees this chat history at some point as well

hagmonk02:07:48

cool - thanks for working through that problem with me, much appreciated!

dpsutton02:07:07

thanks for the tip about tmux and allacrity

vinai05:07:47

This morning I've started getting error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.IllegalArgumentException: No matching ctor found for class java.net.InetSocketAddress when starting up the repl with cider-jack-in-cljs Yesterday evening things where working. Any idea what might have happened?

euccastro05:07:44

@vinai: it's explained above. I worked around it by setting cider-clojure-cli-parameters to -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init {:middleware %s :port 0 :bind "::"})'

euccastro05:07:30

that's assuming you're in a tools.deps project

euccastro05:07:04

see other variants in today's slack history if this exact incantation doesn't work for you

vinai06:07:27

Thank you @euccastro

vinai06:07:58

What command is C-u C-m M-j mapped to for you?

euccastro06:07:01

I don't have it mapped to anything since I'm in spacemacs, but I think it's cider-jack-in with an universal argument (to override arguments to clojure)

euccastro06:07:32

so it's basically the same trick as I say, but for a single cider-jack-in invocation

euccastro06:07:22

in spacemacs I would say SPC u , '

vinai06:07:18

Okay, thanks

vinai06:07:15

@euccastro That workaround worked great, thank you

euccastro06:07:09

np, glad to know that!

euccastro06:07:54

@hagmonk and @cjsauer did all the work 🙂

bozhidar07:07:37

@hagmonk Fixed. Likely I deleted the require accidentally during some refactoring. I’ve been restructuring the code a lot recently.

bozhidar07:07:09

@euccastro That’s now patched upstream. An unfortunate side-effect of the auto-deployments having failed recently.

euccastro07:07:05

thanks @bozhidar!

hkjels08:07:50

My build also worked yesterday and failing now. I’m receiving a different error though

error in process filter: progn: Sync nREPL request timed out (op clone id 1)
error in process filter: Sync nREPL request timed out (op clone id 1)

hkjels08:07:38

I’ve bumped cider/piggieback and nrepl. Same result

hkjels08:07:12

hmm.. Things have broken outside of emacs as well and in multiple projects. Geeee!

hkjels08:07:16

This doesn’t make any sense.. I’m rebooting

hkjels08:07:26

apparently it’s not able to merge the alias map of my deps file, but I’m not able to spot any issues

andrea.crotti09:07:34

one of my colleagues had a strange problem with jack-in-clojurescript that was firing up only one REPL instead of two

andrea.crotti09:07:10

she was using 0.18 snapshot, I made her switch to 0.17 stable to see if it was related to that and now it works fine

andrea.crotti09:07:27

however to other people with 0.18 and the same config it seems to work 😕

andrea.crotti09:07:58

we are using a custom repl type like

(eval . (cider-register-cljs-repl-type
           'figwheel+integrant
           "(do (require 'figwheel-sidecar.repl-api)
               (require 'integrant.repl)
               (integrant.repl/go)
               (figwheel-sidecar.repl-api/cljs-repl))"))
which I think might be related

bozhidar09:07:21

> one of my colleagues had a strange problem with jack-in-clojurescript that was firing up only one REPL instead of two

bozhidar09:07:43

@andrea.crotti It’s not a problem, it’s the new standard behaviour of CIDER 0.18. 🙂

bozhidar09:07:04

jack-in-clojurescript now starts just a ClojureScript REPL (as many people as for this).

bozhidar09:07:17

There’s a separate command to start both REPLs.

bozhidar09:07:39

Btw, we wrote a ton of documentation of all those changes, people should started reading the changelog and the manual. 🙂

andrea.crotti09:07:08

ah ok yes I started looking at the docs, but then my other colleagues told me it worked for them, so I got confused

andrea.crotti09:07:16

not sure how it works for them then 😄

andrea.crotti09:07:34

from the docs then there is no key binding by default for the new command to fire up both repls?

manuel09:07:41

C-c M-x lets you pick the command you want

andrea.crotti09:07:29

yes ok well I can just rebind it

andrea.crotti09:07:37

I always need or both or just CLJ anyway

andrea.crotti09:07:52

just curious, why would anyone only want the CLJS anyway?

andrea.crotti09:07:06

unless you somehow have a cljs only project?

manuel09:07:16

In my case, I happen to work on CLJS-only projects sometimes, I don't need the extra CLJ REPL

bozhidar10:07:53

> from the docs then there is no key binding by default for the new command to fire up both repls?

bozhidar10:07:06

We’ll likely put all those commands in a common keymap.

bozhidar10:07:10

(we’re just figuring out the details - e.g. something like C-c C-x j/J/c/C/s)

minikomi11:07:48

I'm using boot, along with boot-cljs-repl, so I typically use cider-connect to get a clojure repl for my project, and then in the rare cases where I want a cljs repl, use (start-repl) in there. So, I don't typically have a "cljs repl" and a "clj repl" -- they're one and the same. I used to be able to switch to the clj repl fine from cljs files, but now I get the message user-error: No cljs REPL in current session (project-name)

minikomi11:07:49

switching from a clj file works fine..

minikomi11:07:20

I assume this is something to do with the connection changes in 0.18.0 .. is there a hook i can do something with to associate the clj repl with cljs files?

minikomi11:07:33

oh, i just started up a cljs repl with start-repl, and was able to switch from a cljs file//. interesting.

minikomi11:07:33

I think i get it...

bozhidar12:07:20

> So, I don’t typically have a “cljs repl” and a “clj repl” -- they’re one and the same.

bozhidar12:07:27

They can never be the same. 🙂

bozhidar12:07:49

It’s either a Clojure or a ClojureScript REPL.

bozhidar12:07:41

@eraad You can try the command like invocation in a terminal and try connecting with cider-connect. Everything seems OK to me in your log, but likely something goes wrong with the server init if CIDER can’t connect to it.

eraad12:07:27

@bozhidar Thanks, will look into it

eggsyntax14:07:02

@bozhidar this seems to be breaking quite a lot of people's workflow. I don't know enough about it to do this myself, but I suggest writing up a brief guide for folks who are coming to the channel and saying, "help, my CIDER just broke!" so that we can all have something standard to point them to (and take some of the repetition off your shoulders). Something short that just says, "here's what changed, here's what you need to change in your workflow."

eggsyntax14:07:59

That's definitely the best thing we've got so far that I've seen 🙂

eggsyntax14:07:31

(caveat: I just found out about it 15 min ago, so I'm still in the process of reading through it)

bozhidar14:07:19

@eggsyntax I understand this change is probably somewhat surprising, but I think it’s for the better overall. Generally we plan to downplay the various jack-in-commands down the road and steer most people to the M-x cider - when you see the list of all possible entry points all the confusion disappears IMO.

bozhidar14:07:12

But yeah, we always knew that reworking the connection management was going to be painful. The release is not ready yet, the final docs will be even better.

eggsyntax14:07:23

Agreed. And to some extent folks who are choosing to use the snapshot are accepting some breakage (although a lot of folks, including beginners, end up on bleeding-edge by accident because spacemacs defaults to it). Just wondering if there's some good way to save you some time answering the same questions over & over, and to get the word out to the community that if they're gonna update to 0.18.0-SNAPSHOT they must read the new docs.

eggsyntax14:07:44

Maybe that alone is enough: "Your workflow broke? You probably updated to the new snapshot; either pin cider to melpa-stable, or go read http://docs.cider.mx/en/latest/managing_connections/ ." I'll default to telling people that for now.

bozhidar14:07:49

I think that I can just added a few breaking markers to the changelog and hope people will actually read it. 🙂

bozhidar14:07:21

Or add the breaking changes to the REPL startup messages.

bozhidar14:07:38

But yeah - a ton of my time goes into support and that’s extremely tiring.

bozhidar14:07:16

I often miss the days when I had completely ignored this channel for a year and half.. And I’m strongly considering doing it again. 🙂

eggsyntax15:07:35

"add the breaking changes to the REPL startup messages" -- I think that might really help (although I find if I'm not paying attention, my eye skips right over startup messages once I've seen them enough times). "strongly considering doing it again" -- mental health / sustainable development comes first! Your input here is awesome, but the rest of us will muddle by 😉

andre.stylianos15:07:12

> my eye skips right over startup messages once I've seen them enough times I'm pretty sure that's what will happen

bozhidar15:07:30

(I’ve added a few notes about the bigger breaking changes here)

dpsutton15:07:50

I wish there was an easy way for the startup message to display 4 random defcustoms and their docstrings

dpsutton15:07:57

be a good way to learn about the knobs of CIDER

dominicm15:07:49

> Allow evaling top level forms in a comment form rather than the entire comment form with cider-eval-toplevel-inside-comment-form. Can someone explain the rationale of this to me? Do I want to port this to other editors?

dpsutton15:07:02

(comment
  (def db (get-dev-database))
  (def users (query db :users))
  (let [user (first users)]
    (make-admin user)))
Imagine something like this in the repl. When you execute cider-eval-defun you will get nil because that's what any comment form evals to. This option checks to see if you're inside a comment form and if so readjusts what "top level" means.

dpsutton15:07:50

and you want toplevel to mean the first level inside of the comment form where your cursor is. ie, you want (def db (get-dev-database)) not (comment ...)

andre.stylianos15:07:06

Yup, otherwise you have to keep finding the right spot to move the cursor to so you can call cider-eval-last-sexp or something like that

dpsutton15:07:28

exactly. you can take pains to put point right after the sexp or you can just eval as normal with this defcustom

andre.stylianos15:07:08

Probably does not affect vim-fireplace users as much since you have a more general selection of what you're evaluating with text objects

andre.stylianos15:07:19

but it might still be a nice touch

dpsutton15:07:20

vim surround is the bomb

eggsyntax15:07:09

Available in emacs via evil-surround IIRC

dominicm15:07:41

I see. So it doesn't "eval top level sexps inside a comment form" it "eval-top-level-form by selecting from a comment first"

dominicm15:07:56

Yeah, vim-sexp gives me way more control, so I don't need this. Great 😄

dpsutton15:07:54

I'm not sure i follow.

dominicm15:07:33

@dpsutton I was reading as taking:

(defn foo [])
and turning it into
(comment
  (defn foo []))
which made no sense to me.

dominicm15:07:58

It's redefining what "top-level-form" means, as opposed to evaluating the top level inside a comment

dpsutton15:07:59

haha yeah. it takes the latter and realizes that you most probably want to think of it as the former

dpsutton15:07:15

@bozhidar pointed out a problem in that this probably needs to live in clojure-mode so it can affect beginning-of-defun rather than at certain calls

dominicm15:07:49

If you like vim-surround from the perspective of true text obj + operator, you'll love vim-sandwich. I recently made the switch, it's very good.

dominicm15:07:02

Defining custom surrounds which take params is ❤️.

hagmonk17:07:58

@bozhidar I'm worried there might have been a bug in #537

hagmonk17:07:00

I only put two and two together after waking up this morning - init is taking middleware, not handlers

eraad18:07:47

Hi! May this be causing a timeout when trying to connect to a clojure-cli repl? I get this on the repl: ERROR: Unhandled REPL handler exception processing message {:op clone, :id 1} java.lang.IllegalArgumentException: Key must be integer at clojure.lang.APersistentVector.invoke(APersistentVector.java:294) at clojure.tools.nrepl.server$handle_STAR_.invokeStatic(server.clj:19) at clojure.tools.nrepl.server$handle_STAR_.invoke(server.clj:16) at clojure.tools.nrepl.server$handle$fn__1005.invoke(server.clj:28) at clojure.core$binding_conveyor_fn$fn__5476.invoke(core.clj:2022) at clojure.lang.AFn.call(AFn.java:18) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

euccastro03:07:05

@eraad yes, this is the cause; see a workaround in #cider

bozhidar17:07:58

@hagmonk Likely you’re right. I’m having a very busy day and didn’t look carefully at the patch, but I was surprised by the handler part. I just assumed you tested this and knowing it only affects clojure-cli users decided to merge it without fretting too much over it.

hagmonk17:07:53

I tested starting the REPL, which worked, but the bug shows up as soon as you try to send a command to the REPL :( Totally my fault, I apologize. I can submit another PR with a test case that covers this more thoroughly

bozhidar17:07:11

@hagmonk Yeah, that’d be great.

myguidingstar18:07:06

if I have clj and cljs repls, the code in (cider-interactive-eval "(some-clj-code)") get evaluated in both of them. How to eval in just clj?

eggsyntax18:07:56

I've just switched back to 0.17.0, since I was having trouble with 0.18.0 after updating, but now I'm getting Symbol’s function definition is void: cider-current-repl Ring any immediate bells for anyone? Googling that only brings up two results, neither of which seems to fit.

dpsutton18:07:47

i believe that's what cider-current-connection has become in 0.18

dpsutton18:07:30

it shouldn't be present if you've gone back to 0.17 unless you have custom code or maybe an updated helper package

eggsyntax18:07:16

Yeah, that latter is what I just started wondering. I'm gonna turn the debugger on & try to see where it's coming from. Thanks!

eggsyntax18:07:36

Hmm, call chain is spacemacs/cider-send-ns-form-to-repl -> spacemacs//cider-eval-in-repl-no-focus -> save-current-buffer -> (set-buffer (cider-current-repl))

eggsyntax19:07:21

cider-eval-in-repl-no-focus is from the clojure layer, not cider. So maybe the clojure layer has to be pinned as well 🤔

dpsutton19:07:14

no idea. but that layer could use the new insert in repl commands

eggsyntax19:07:58

Just to be sure I'm clear, you're saying that clojure might use commands that require cider 0.18.0-SNAPSHOT, right?

dpsutton19:07:58

i have no insight into what the clojure layer of spacemacs does. I was just saying cider-eval-in-repl-no-focus is not a cider command and they could use some new functionality without making a custom version

eggsyntax19:07:52

Nah, pinning clojure doesn't fix it. Investigation continues.

eggsyntax19:07:02

Turns out to be a spacemacs thing, details in #spacemacs in case anyone else encounters it.

eggsyntax15:07:57

Minor follow-up -- author of the original Spacemacs patch has submitted a new PR to SM so that the new cider-current-repl will only be use if CIDER > 17, so this should hopefully be fixed soon for SM folks.

hagmonk19:07:45

@bozhidar @richiardiandrea I have a new PR that fixes the cider-nrepl regression I introduced: https://github.com/clojure-emacs/cider-nrepl/pull/539

bozhidar20:07:20

> Symbol’s function definition is void: cider-current-repl

bozhidar20:07:34

@eggsyntax This used to be named cider-current-repl-buffer is 0.17.

eggsyntax20:07:25

Got it. Turns out to be a Spacemacs thing; it uses cider-current-repl regardless of cider version.

bozhidar20:07:27

@hagmonk I’ll take a look tomorrow, as I’m too tired today already. Seems @richiardiandrea already gave some feedback with respect to the boot plugin.

dpsutton20:07:40

They added an alias for cider current connection o think. Should be easy to patch up spacemacs

bozhidar20:07:24

The alias was always there. It’s not something new.

hagmonk20:07:46

@bozhidar thanks! looks like @richiardiandrea’s comment might have been from yesterday. There some strange test failures in unrelated areas - I can try re-running to see if they are intermittent.

richiardiandrea23:07:42

Yeah my comment was not regarding the new add-on to the patch, unfortunately cannot check this now..after the 16th I will be able to...

dpsutton20:07:55

[Fix #2342] Alias and obsolete variables after #2324 on CommitDate: Sat Jun 30 19:24:48 2018 +0200. cider-current-connection went away and then came back i believe

eggsyntax20:07:57

& then the name change to cider-current-repl is at https://github.com/syl20bnr/spacemacs/pull/10954/commits/3651c57253ebe1a68ca15cfde3a1ade1054a6840 Which is fine in general, but incompatible with CIDER 0.17.0.

dpsutton20:07:35

right. so i believe the alias cider-current-connection was added back so that older tooling and newer tooling had the same vocabulary

eraad23:07:51

Hi! Please, can anyone provide clues on how to load deps from an deps.edn alias when doing clojure-jack-in? By default, they don´t seem to get loaded

euccastro23:07:18

@eraad: you can supply arbitrary command line arguments to clojure by changing cider-clojure-cli-parameters or, for a one-time thing, by prefixing your clojure-jack-in with an universal argument (`C-u` in emacs or SPC u in spacemacs)

eraad11:07:42

Just to let you know, got it working using cider-clojure-cli-global-options

euccastro16:07:42

nice, thanks for the pointer!

eraad23:07:11

Thanks @euccastro

euccastro23:07:59

np. I guess it would be most convenient to be able to set that in a per project basis, but I don't know how to do that