Fork me on GitHub
#cider
<
2016-06-21
>
robert-stuttaford07:06:07

one small extra bit of info on this - C-g restores the Emacs UI. so it's not hanging, it's just that command that's stuck

reefersleep09:06:45

I'm using Spacemacs and for some reason cider-jump-to-resource is void. I have the Clojure layer active, and some Cider commands work. Does anyone have an idea why this particular command does not work? I've connected to a working ClojureScript repl. I've also tried including an nrepl in ~/.lein/profiles.clj

reefersleep09:06:41

Symbol's function definition is void: cider-jump-to-resource

reefersleep09:06:56

Well, actually, the functionality I was looking for turned out to be jump-to-var, which works fine. I still wonder why the other definition is void, though.

robert-stuttaford12:06:49

@benedek, i haven't gotten to writing up a github issue, but i do have one more thing to report. when prompted for a filename to save, if i save it in .clj in the classpath, it saves the cleaned file to the name i nominate. so the bug is that it's not saving to the path it read from, and instead is prompting me for a filename for each file.

robert-stuttaford12:06:37

@benedek this bit, here, is what's causing it to ask me for a filename https://github.com/clojure-emacs/clj-refactor.el/blob/0f75216908c54948e5ad01564c3284d61488ce8c/clj-refactor.el#L274-L278 . perhaps something to do with how my emacs is setup as it relates to with-temp-file and/or insert-file-contents?

robert-stuttaford14:06:00

hmm. i think it may be because we're gitignoring emacs' temp files

robert-stuttaford14:06:29

nope. that's not it

robert-stuttaford14:06:47

@benedek: i think i may have the bug .. https://github.com/clojure-emacs/clj-refactor.el/blob/0f75216908c54948e5ad01564c3284d61488ce8c/clj-refactor.el#L1030-L1032 arg is 'filename' but the body of this fn checks (buffer-file-name). this fn is only used by project-clean

benedek14:06:11

haha, that looks pretty bad

benedek14:06:37

not sure how this results in saving the cleaned namespace tho...

benedek14:06:02

that should just let loads of crap through… (which is bad enough)

robert-stuttaford14:06:13

so, i know nothing about elisp, but i think i may have found the issue

robert-stuttaford14:06:12

i put this right after dolist here https://github.com/clojure-emacs/clj-refactor.el/blob/0f75216908c54948e5ad01564c3284d61488ce8c/clj-refactor.el#L1976:

(cljr--post-command-message " filename: %s clojure-filename: %s  excluded: %s "
                                    filename
                                    (cljr--clojure-filename-p filename)
                                    (cljr--excluded-from-project-clean-p filename))

robert-stuttaford14:06:26

and, nothing actually happens to my files, but, i get output like this:

robert-stuttaford14:06:48

Cleaning your project might change many of your clj files. Do you want to proceed? (y or n) y
Project clean done.
 filename: /Users/robert/Cognician/Server//src/shoreleave/middleware/rpc.clj is being cleaned!
 filename: /Users/robert/Cognician/Server//src/shoreleave/middleware/rpc.clj clojure-filename: t  excluded: nil 
 filename: /Users/robert/Cognician/Server//src/cognician/yeller.clj is being cleaned!
 filename: /Users/robert/Cognician/Server//src/cognician/yeller.clj clojure-filename: t  excluded: nil 

robert-stuttaford14:06:05

perhaps the double / is affecting with-temp-file?

robert-stuttaford14:06:24

i see that cljr--project-files is also only used by this code

robert-stuttaford14:06:40

of course, clojure-filename is always t because i do this while the active buffer has a clj file in it

robert-stuttaford14:06:19

i put this inside the when:

(cljr--post-command-message " filename: %s is being cleaned!"
                                      filename)

robert-stuttaford14:06:58

that pretty much exhausts my knowledge, though. i hope this is helpful?

benedek14:06:20

indeed it is. have you tried to fix the bug above and rerun? eg, just fix the buggy cljr--clojure-filename-p then C-x C-e at the end of the function and rerun project clean

robert-stuttaford14:06:39

i've fixed that, and it's returning t, but i'm still being prompted to enter a new filename to save the file to

benedek14:06:49

hm… will dig around this as soon as i get some time on my hands. thanks for info

robert-stuttaford14:06:15

how might i replace // with / in filename, @benedek ?

robert-stuttaford14:06:32

i want to try doing that as a last-ditch thing before accepting defeat 🙂

robert-stuttaford14:06:38

i found s-replace, trying that

robert-stuttaford14:06:28

nope. that didn't help

robert-stuttaford14:06:42

my namespaces shall remain dirty for now 🙂

benedek14:06:34

sad times...

benedek14:06:29

thx for the PR