Fork me on GitHub
#cider
<
2016-04-22
>
malabarba00:04:55

There's always something else to fix simple_smile

dpsutton00:04:41

Now that I have a better feel for the code base I need to write some more tests

jsa-aerial00:04:34

OK, I almost have cider 12 more or less working - it's astonishing how much effort this appears to require (moving from 9 to 12). I'm not sure, but I think the only odd thing left is cider-connect no longer has cider mode enabled by default in the cider-nrepl buffer. Other than adding hooks to try to force this, is there anything 'obvious' that I may be missing?

malabarba00:04:55

I don't think cider-mode was ever turned on by default on the repl-buffer

jsa-aerial00:04:50

OK, maybe there was something else in operation that gave function args previously?

jsa-aerial01:04:14

Yes, but the old hook for that cider-turn-on-eldoc-mode, or whatever, was removed (previously deprecated) and supposedly should be replaced by eldoc-mode, but that appears to not have any effect

malabarba01:04:00

Have you tried (add-hook 'cider-repl-mode-hook #'eldoc-mode)

malabarba01:04:29

Or just (global-eldoc-mode 1) anywhere (though that will affect more than just cider)

jsa-aerial01:04:32

Worth a try, this: (add-hook 'cider-mode-hook 'cider-turn-on-eldoc-mode)`` used to work

malabarba01:04:33

It's strange that it worked

malabarba01:04:00

turn-on-eldoc-mode basically just set up a variable and then called eldoc-mode

malabarba01:04:30

Strange that turning it on in cider-mode would affect cider-repl-mode

jsa-aerial01:04:36

Also, why in the world, when giving function signature, does the new cider stuff (I have no ideas what combination is doing this), print the fully qualified name space for the function?? Is that configurable?

malabarba01:04:52

It's not configurable ATM

jsa-aerial01:04:58

Well, that was the only place that eldoc mode occurred in my setup. It's possible that adding the hook you suggest won't work either - I need to try that...

malabarba01:04:04

though I believe we can add a toggle for that

malabarba01:04:50

fwiw, here's the entirerity of my clojure hooks

malabarba01:04:56

(dolist (fn '(paredit-mode
              subword-mode
              eldoc-mode))
  (when (fboundp fn)
    (add-hook 'clojure-mode-hook fn)
    (add-hook 'cider-repl-mode-hook fn)))

jsa-aerial01:04:37

that's a nice generalized way to do this stuff

jsa-aerial01:04:45

OK, your hook does enable this again, without having full cider mode.

jsa-aerial01:04:59

But the odd thing now is when connecting the final result is a weird 'Project directory: <directory of file cider-connect launched from> in the mini buffer. What is that? And why is it there?

malabarba01:04:45

you should be getting a message instead

malabarba01:04:52

one of the random quotes

jsa-aerial01:04:52

Actually, that's really annoying as it isn't the actual project directory!!

jsa-aerial01:04:15

You get the random quote if you remove the hook

malabarba01:04:52

that makes no sense 😄

malabarba01:04:04

none of those hooks know anything about project directories

jsa-aerial01:04:10

OK, I'm wrong about that - I removed that hook and for some reason I no longer get the random message - could this be related to using a second editor session to connect up to the server? The first connection (which I didn't shutdown) still gives the random message

malabarba01:04:54

I'm not sure I get what you're saying

malabarba01:04:06

Have two emacs instance running?

malabarba01:04:14

Or an emacs and an emacsclient

jsa-aerial01:04:42

I had a session running and that one didn't have your hook. But I was trying out your hook in a totally separate editor session

jsa-aerial01:04:11

So, two totally different emacs instances running against the same server

jsa-aerial01:04:36

OK, I shut everything down and am putting the hook back and will see what happens here

malabarba01:04:29

after you cider-connect Emacs will prompt you for the project-directory

malabarba01:04:36

You can just hit RET there

malabarba01:04:52

that has nothing to do with the hooks, though

malabarba01:04:48

The thing is that cider-jack-in knows the project its connecting to, but cider-connect doesn't. So we need you to confirm the directory.

jsa-aerial01:04:21

That's odd. The first emacs didn't ask for that and just gave the random quote. I now shutdown both emacs and fired up a new one with the hook but didn't stop the server. Still get the weird project dir msg and no random quote. Will now stop server as well and retry

malabarba01:04:47

when you say server, do you mean a clojure server?

malabarba01:04:51

or an emacs server?

jsa-aerial01:04:38

I mean clojure server. And yes, shutting that down and the emacs (all of them) down and running a new emacs with your hook now: starts cider-nrepl, gives the random quote with no weird project directory mini buffer request, and does provide function signatures.

jsa-aerial01:04:59

I have no idea what toxic interactions were happening

malabarba01:04:16

are you doing jack-in or connect?

jsa-aerial01:04:55

cider-connect. And just tried a second emacs into the new clojure server and - yes, now in that second emacs when issuing cider-connect, upon connection, I get no random message and the weird Project directory mini buffer request.

malabarba01:04:57

here's a correction to my previous statement

malabarba01:04:19

cider-connect will ask you for a project-directory if it can't find one

jsa-aerial01:04:23

I'm not sure I ever had two emacs going into the same clojure server using cider and nrepl. I know this worked seamlessly with the old swank/slime combo.

malabarba01:04:39

That's not the issue

jsa-aerial01:04:41

How could it not find one?

malabarba01:04:51

You're invoking it from outside the project

malabarba01:04:05

"find" is the wrong word

malabarba01:04:16

It just checks if you're inside a clojure project

jsa-aerial01:04:19

You mean running the emacs outside the directory ?

malabarba01:04:43

I mean the file you're visiting when you run M-x cider-connect

jsa-aerial01:04:00

Let me try that

malabarba01:04:09

If call cider-connect while actually inside a clojure project, cider-connect will not ask you anything

malabarba01:04:25

if you call it outside a clojure project, it will ask you for a directory

jsa-aerial01:04:43

Confirmed - if I start it from a file that is nested in the src of a project no project directory request and random msg is given

jsa-aerial01:04:02

I think the better way of saying that is if you issue cider-connect in a buffer on a file that is in the src directory of a project it won't ask anything

jsa-aerial01:04:42

Actually, why does cider care about this??? That seems like a server side issue only

malabarba01:04:00

Doesn't have to be in the src directory

malabarba01:04:05

anywhere inside the project is fine

jsa-aerial01:04:34

does it just look up the directory tree from the files position until/unless it finds a project.clj?

malabarba01:04:50

or build.boot

jsa-aerial01:04:13

OK, but again, why does cider care about this at all??

malabarba01:04:25

Cider cares about this so it can tell which project a connection belongs to

malabarba01:04:34

it matters if you have more than one active connection

malabarba01:04:52

If only have one connection, it doesn't affect you

jsa-aerial01:04:18

I don't get that - the connections are on different sockets, right? And the servers would have the different name spaces for the projects involved

jsa-aerial01:04:45

So, cider should not need to know anything about projects

jsa-aerial01:04:02

That seems like a strictly server side concern

malabarba01:04:46

Think of it this way

malabarba01:04:58

if you visit a file, and evaluate an expression

malabarba01:04:10

which connection should cider use for that evaluation?

malabarba01:04:43

What it does, is look up which project this file is in

malabarba01:04:01

That's all the information we have

malabarba01:04:13

And then it uses the connection associated with that directory

jsa-aerial01:04:14

Ah, ok, that does make sense

jsa-aerial01:04:02

Well, many thanks malabarba for wasting some cycles on this to get things a bit clearer on my side

jsa-aerial01:04:29

I hope/think I now have a new working cider 12 setup

jstaffans06:04:40

@bozhidar: re: “ is ConcurrentList imported in your namespace?” - I was trying to trigger the completion within the :import namespace section: (:import [ConcurrentLi…]). Should completion work there?

bozhidar07:04:06

I seem to recall Alex Yakushev had added special support for import

bozhidar07:04:24

I don’t have time to test it now myself

malabarba13:04:59

@nooga: there's a variable that controls whether overlays use font locking, you can find that if you browse the customize menu. Just make sure it's t.

malabarba13:04:23

But I don't see anything wrong with the image you posted. Try evaluating something that actually has font locking, like a var or a map with keywords.

tianshu13:04:59

Hi, will cider look for upgrade when it load? My cider startup very slowly now. Is it possible a network issue?

malabarba13:04:25

but lein/boot usually do

malabarba13:04:36

But how slow is it?

malabarba13:04:42

~ 30 sec is normal

tianshu13:04:26

It's slow when elisp eval (use-package cider) or (require 'cider). It takes about 2 minutes.

tianshu13:04:43

It used to be about 1 second.

tianshu14:04:52

How can I find the statement that is blocked?

malabarba14:04:22

sounds like a tramp issue

malabarba14:04:38

Mike had the same problem here recently

malabarba14:04:54

let me search the history

tianshu14:04:57

How did he solved the problem?

malabarba14:04:26

His solution involved changing the dns server

malabarba14:04:42

but I'm sure there's an easier one

tianshu14:04:12

Debugger entered--Lisp error: (quit) call-process("ssh" nil t nil "-o" "ControlPath=%C" "host.does.not.exist")

tianshu14:04:38

like the tramp issue

tianshu14:04:33

exactly the same problem with his

malabarba14:04:56

it's a common problem if you google for it

malabarba14:04:03

which emacs version are you on?

tianshu14:04:35

emacs for osx, 24.5

tianshu14:04:44

does the version matter?

malabarba14:04:58

I believe it's fixed on 25

malabarba14:04:10

You can also try (setq tramp-ssh-controlmaster-options "-o ControlMaster=auto -o ControlPath='tramp.%%r@%%h:%%p' -o ControlPersist=no")

malabarba14:04:38

Supposedly that fixes it, but I can't test

tianshu14:04:31

I'm trying update to 25

nooga14:04:31

@malabarba: I don’t like the yellow border ;D

malabarba14:04:04

Ah. Customize the face:simple_smile:

tianshu14:04:51

Is it on emacs?

malabarba14:04:09

I'm not a light-theme user, so I'm open to pull requests on that

tianshu14:04:31

Is this the ligature?

nooga14:04:48

yeah, the font is called FiraCode, look it up on github

nooga14:04:01

should work on OS X cocoa emacs without problems

nooga14:04:20

with retina smoothing and all

tianshu14:04:39

what is cocoa emacs?

nooga14:04:12

it’s emacs with cocoa (OS X native) gui

nooga14:04:40

you probably have it already

tianshu14:04:48

GNU Emacs For Mac OS X?

tianshu14:04:02

Yes, I have it.

nooga14:04:09

I just did brew install emacs —with-cocoa

nooga14:04:50

@malabarba: any idea where to look for that face? I’m quite a newb in .el stuff

malabarba14:04:39

(customize-face 'cider-result-overlay-face)

harold15:04:57

What if cider-repl-set-ns managed a ring of namespaces (ala emacs' yank ring)? Then it would be easy to loop through recent namespaces and pop back and forth between a couple.

malabarba16:04:28

If you're looping a lot between namespaces, maybe you should be using files instead. :-)

dpsutton16:04:52

doesn't cider keep a ring of recent buffers?

dpsutton16:04:20

so you can easily loop through those and then C-u C-c M-z brings up the current ns in the repl

dpsutton16:04:40

or maybe its just C-c M-z

dpsutton16:04:02

but there's definitely a load ns of current buffer and take me to the repl

jsa-aerial20:04:56

did the name of this cider--region-for-defun-at-point change post version 0.9? I'm getting a 'Symbol's definition is void ...' for this when trying to compile (via C-c C-c). I'm also using package cider-eval-sexp-fu for brief highlighting and am thinking this is where the problem is coming from

richiardiandrea21:04:45

@jsa-aerial: I had to update cider-eval-sexp-fu, I don't remember if it was for that particular function but I now have 0.12 and latest master for cider-eval-sexp-fu

jsa-aerial21:04:32

yes, I see in the 'fu' code a change on just this point

jsa-aerial21:04:18

Ah - is that available via package update or does it require manual stuff

richiardiandrea21:04:08

I always do manual, maybe ping the maintainer if you don't see the updated package

jsa-aerial21:04:45

yes, the code was updated on git, but package-list-packages doesn't see an update available for the package...

jsa-aerial21:04:28

There's something odd here - the MELPA site actually has the version with the fix, but I can't get emacs package system to realize it is a package with an update. I did get it to work by hacking the .el and 'installing from buffer', but that seems like a recipe for errors

malabarba21:04:33

Can you find it in the package menu? What does it say there?

jsa-aerial21:04:14

Yes, but it apparently is the 'old' one

jsa-aerial21:04:39

Hey @malabarba, what is the magic switch to turn off the 'ghostly' in buffer result Cider gives upon form evaluation?

malabarba21:04:31

cider-use-overlays

malabarba21:04:34

or something like that

malabarba21:04:03

Open the cider customize menu and search for -use-

jsa-aerial21:04:11

that's it! Thanks!