Fork me on GitHub
#cider
<
2016-04-24
>
tomayerst08:04:59

I’m struggling to even install cider at the moment

tomayerst08:04:11

Is this a good place to ask some really basic questions?

xcthulhu11:04:10

@tomayerst: Sure, things are sort of in a state of flux for CIDER right now

tomayerst12:04:21

These are really basic and may be more for emacs but...

tomayerst12:04:58

I finally, I think installed cider with M-x package-install ↩️ cider ↩️

tomayerst12:04:12

which seemed to work

tomayerst12:04:37

I also put (unless (package-installed-p 'cider) (package-install 'cider)) into the init.el

tomayerst12:04:32

but that gives: error: package.el is not yet initialized when I start emacs

tomayerst12:04:36

so I think I installed it but cannot tell...

tomayerst12:04:14

and I don’t understand why the init.el bit breaks stuff (hopefully a really dumb typo)

dpsutton12:04:28

@tomayerst: do you see a line like (require 'package) anywhere in your init?

tomayerst12:04:48

yes, its the first line

dpsutton12:04:14

i found this on stack overflow

dpsutton12:04:28

try the suggestion there

dpsutton12:04:34

you have to initialize the system

dpsutton12:04:30

the configuration requires both lines, requiring and initializing. Can you try that and see if it resolves your issues?

tomayerst12:04:09

I have added the (package-initialize) line which has made the error go away

tomayerst12:04:26

(I obviously have to work on my Stack Overflow skills :thinking_face:

dpsutton12:04:15

i'm glad it worked out

dpsutton12:04:35

read through the documentation as well in case it mentions anything else to make your life easier

dpsutton12:04:56

there's a bit in there to make sure your packages are all installed, so you can version control your settings and put on multiple machines

dpsutton12:04:03

might also come in handy

tomayerst12:04:20

I think I started from a really vanilla state - brew install emacs and there may be a bit to add to the getting started manual (which I would be happy to do).

jsa-aerial14:04:09

@malabarba: Could you point me at the function that does the printing (or construction) of the output? I may take a hack at it. Thanks.

bozhidar15:04:50

it’s in cider-eldoc.el

bozhidar15:04:50

I don’t think that dropping the ns completely is a good idea

bozhidar15:04:06

the fact it wasn’t displayed there for a long time was just an oversight on my part

bozhidar15:04:22

I’d rather use the same shortening options we make available in the REPL

bozhidar15:04:48

as obviously all places displaying the namespace suffer from the same problems

bozhidar15:04:05

anyways, feel free to take a stab at this

bozhidar15:04:36

this is how we handle this in the REPL

bozhidar15:04:41

there are 3 predefined functions

bozhidar15:04:48

and people can add more if they want to

bozhidar15:04:41

I’d just make those functions a bit more generic and add the same config for eldoc

bozhidar16:04:26

btw, I’ve decided to tackle this myself

bozhidar16:04:31

guess this would be easiest

bozhidar16:04:25

@jsa-aerial: see cider-eldoc-ns-function on master

jsa-aerial16:04:41

Why do you believe that the ns is useful? You can always get that for any value of any var/symbol easily enough anytime if you want it. In this case, it is extremely unlikely you wouldn't know the ns involved. Printing the alias for the ns as a qualifier might be useful, but really, again, you have that directly at the point.

bozhidar16:04:27

depends on how familiar you are with a codebase

bozhidar16:04:46

I’d rather not do any guesswork, unless necessary

bozhidar16:04:11

you can always set this to a function that simply drops the ns completely

bozhidar16:04:21

which is pretty much the old behaviour

bozhidar16:04:35

I agree that probably it was a mistake not to make this configurable, but now everyone is free to display the ns however they want (or not at all)

jsa-aerial16:04:51

t need to guess, just eval the value in question - you will get what it is and where it is

jsa-aerial16:04:32

Yes, fair enough, and probably covers all cases now

jsa-aerial16:04:46

Hmmm, looking at the code, it appears that if you drop the ns entirely (have cider-eldoc-ns-function return ""), it will not use the symbol and use the 'thing' branch instead. Also, it only checks ns for being 'empty' when deciding whether to use 'thing'

bozhidar16:04:08

it also checks if it’s nil

bozhidar16:04:27

any function returning nil will do

jsa-aerial16:04:14

Right, if it is nil, it will use the 'thing' branch

bozhidar16:04:45

yes, that’s what I intended

bozhidar16:04:51

don’t see what you’re concerned about

jsa-aerial16:04:06

but what you really want it to do is (format "%s" (cider-propertize symbol 'var))

jsa-aerial16:04:30

From the doc, the 'thing' branch is for java stuff

bozhidar16:04:19

technically speaking this was the only branch before 0.12 simple_smile

bozhidar16:04:33

it’s just whatever was at point

bozhidar16:04:22

I wrote the docstring this way, as only the java stuff doesn’t have namespaces by default

jsa-aerial16:04:36

Oh, I guess I didn't understand that from the doc...

bozhidar17:04:59

guess there’s some room for improvement simple_smile

bozhidar17:04:00

I’ll clean this a bit (if I remember to)

piotrek19:04:53

I am looking into my pull request and formatting

piotrek19:04:05

and I see that there is already an issue with numbering in existing docs

piotrek19:04:57

In the section: http://cider.readthedocs.org/en/latest/up_and_running/#clojurescript-usage first item (with number 1) uses a bit smaller font

piotrek19:04:04

then there is another item with number 1

piotrek19:04:15

I can’t find a way to make it work correcly