Fork me on GitHub
#cider
<
2017-05-03
>
ag00:05:37

whenever I create sibling-cljs-repl CIDER would ask “”Visit localhost in a browser? “. I don’t like that, how do I disable?

dpsutton02:05:54

@ag why would you want this? I'm asking because i'm adding this for you and i need help in naming the var and the docstring

dpsutton02:05:38

in creating the sibling repl, this is the last expression: (cider--offer-to-open-app-in-browser nrepl-server-buffer)

ag03:05:25

dpsutton: what’s the convention for naming predicates in elisp? Maybe: cider--offer-to-open-app-in-browser?

dpsutton03:05:50

that's the name of the function that actually opens the app in the browser haha

dpsutton04:05:38

(defcustom cider-inhibit-asking-about-browser nil
  "When nil, do not inject repl dependencies (most likely nREPL middlewares) at `cider-jack-in' time."
  :type 'boolean
  :version '(cider . "0.11.0"))

(defun cider--offer-to-open-app-in-browser (server-buffer)
  "Look for a server address in SERVER-BUFFER and offer to open it."
  (when (and (not cider-inhibit-asking-about-browser)
             (buffer-live-p server-buffer))
    (with-current-buffer server-buffer
      (save-excursion
        (goto-char (point-min))
        (when-let ((url (and (search-forward-regexp "" nil 'noerror)
                             (match-string 0))))
          (when (y-or-n-p (format "Visit ‘%s’ in a browser? " url))
            (browse-url url)))))))

dpsutton04:05:18

i'm confused about its usage though. do you this set all the time? or just a certain project? would it be a dir local?

bozhidar05:05:46

Seems someone copy/pasted the docstring of another defcustom.

dpsutton12:05:36

ha very true. i always copy them to get groupings and type correct

dpsutton12:05:28

i'm not submitting a patch because i don't understand the use case though. would you ever want this to reliably not ask you? would you set a dir-local value? or just global. I don't do much cljs development so it seems strange to me and I want to hear the use case

ag23:05:45

I honestly think the default should be “not to ask” and the variable that can be set “to prompt” and “to open without asking”

macrobartfast03:05:06

seems like every 8 times I cider-jack-in it takes several minutes

macrobartfast03:05:16

sometimes 10 minutes

macrobartfast03:05:27

can't ever figure out what's going on.

hans03:05:43

did you look in the nrepl buffer? maybe the dependency downloads are small.

macrobartfast03:05:23

well, I don't think there is an nrepl buffer at the point it 'hangs'...

hans03:05:38

"think" does not sound convincing.

macrobartfast03:05:31

well, after M-x cider-jack-in the pointer sits at the first position of the minibuffer until it resolves (it's been sitting there since I whined above about it)...

hans03:05:01

ah, ok. i don't recognize that failure mode.

macrobartfast03:05:02

so I can't switch to another buffer, but I'm used to seeing the nrepl buffer at the end of a successful jack in.

macrobartfast03:05:08

I can C-g to get out of the cider-jack-in process, and just did, but there's no nrepl buffer open.

macrobartfast03:05:53

I'll hang up my spurs for the night. Too frustrating.

macrobartfast03:05:04

Thanks for taking a crack at it, though.

dpsutton03:05:01

is there anything in the *Messages* buffer?

hans03:05:20

i recently spent some time figuring out why i could not open two project's cider repls at the same time. i found that the problem was in a mode that i loaded which bound the symbol `default to some value. this caused cider to fail, because it somewhere has a function which had an optional argument called 'default and expects it to be nil or a string. the global binding was a symbol, though.

hans03:05:37

this was more than a WTF moment.

hans03:05:18

i mean yes, no namespaces, how cute. but a global binding that overwrites the binding of a named function argument? i beg your f*ing pardon. </rant>

hans03:05:40

made me never ever want to touch elisp again. thank you very much.

oskarkv04:05:52

Hm, that is not supposed to happen, even in Elisp. I don't understand.

bozhidar05:05:56

@macrobartfast What’s your CIDER version? What do you call the nrepl buffer?

bozhidar05:05:26

@hans where exactly’s that?

hans05:05:18

@bozhidar i will try to find it - i was in rage mode and forgot to take notes 😞

hans05:05:57

This is what causes the problem (from rnc-mode.el): (defvar default 'default)

hans05:05:52

Here is where it causes the issue (seq-25.el): (cl-defgeneric seq-find (pred sequence &optional default)

hans05:05:41

@bozhidar I can't reproduce the problem in isolation, though.

oskarkv05:05:28

I'm new to Emacs. Can anyone recommend a fuzzy file finder? I can't believe I have not found one yet.

oskarkv05:05:48

... A good one.

oskarkv06:05:25

Hm helm-projectile maybe...

benedek06:05:56

@macrobartfast you can use clj-refactor to pull in deps into a running REPL. no need to restart. feature is called add-project-dependency. key combo is ap

bozhidar06:05:14

@hans Got it. I thought it was something in CIDER itself.

bozhidar06:05:04

@oskarkv ivy might be a good helm alternative. Or ido with ido-flx.

oskarkv06:05:47

@bozhidar thanks i'll check them out

oskarkv08:05:58

Oh yeah, found what I was looking for. https://github.com/bling/fzf.el