Doing a nrepl-jack-in in a clj buffer, then attempting to use C-c C-k to compile the file, I'm getting C-c C-k is undefined
C-c C-k is undefined
This error occurs in *messages*:
File mode specification error: (wrong-type-argument stringp (lambda (&rest --cl-rest--) (apply (quote (lambda (G93614 G93615 G93616 G93617 G93618 response) (let ((value (cdr (assoc "value" response))) (ns (cdr (assoc "ns" response))) (ou\
t (cdr (assoc "out" response))) (err (cdr (assoc "err" response))) (status (cdr (assoc "status" response))) (id (cdr (assoc "id" response))) (ex (cdr (assoc "ex" response))) (root-ex (cdr (assoc "root-ex" response)))) (cond (value (save-\
current-buffer (set-buffer (symbol-value G93618)) (if ns (setq nrepl-buffer-ns ns))) (if (symbol-value G93617) (funcall (symbol-value G93617) (symbol-value G93618) value))) (out (if (symbol-value G93616) (funcall (symbol-value G93616) (s\
ymbol-value G93618) out))) (err (if (symbol-value G93615) (funcall (symbol-value G93615) (symbol-value G93618) err))) (status (if (member "interrupted" status) (message "Evaluation interrupted.")) (if (member "eval-error" status) (funcal\
l nrepl-err-handler (symbol-value G93618) ex root-ex)) (if (member "namespace-not-found" status) (message "Namespace not found.")) (if (member "need-input" status) (nrepl-need-input (symbol-value G93618))) (if (member "done" status) (pro\
gn (remhash id nrepl-requests) (if (symbol-value G93614) (funcall (symbol-value G93614) (symbol-value G93618)))))))))) (quote --done-handler--) (quote --stderr-handler--) (quote --stdout-handler--) (quote --value-handler--) (quote --buff\
My init.el looks like this:
(add-to-list 'load-path "~/src/elisp/nrepl.el")
Thank you for reporting this.
What version of nrepl.el are you using?
nrepl.el from git, pulled as of this morning.
Hmm... I am having a hard time reproducing this issue. C-c C-k is working for me on all the various versions of nrepl / lein that I have tried.
Does it happen on all .clj buffers or just certain ones?
Just certain projects, I have a particular project that I can reproduce it every time on. It looks as though the buffer isn't having the nREPL mode added to it.
Here is the project I can reproduce it on: http://writequit.org/files/zktest.tgz
;; download thing
% tar zkvf zktest.tgz
% cd zktest
% emacs src/zktest/core.clj
;; M-x nrepl-jack-in
;; attempt to compile file with C-c C-k
Are you still having this issue?
I am not able to reproduce this issue with the latest version lein and nrepl-0.1.6-preview using the sample project you provided.
If you are still having the issue we will need to try to narrow it down some more so I can reproduce.
I sometimes have this problem, too, but not always. There is no obvious condition that causes it, other than it seems to happen when compiling a file that defines a new namespace that doesn't exist yet. As a workaround, if I go to the REPL and manually do "(ns foo.bar)" to create the new namespace and switch into it, then go back and C-c C-k the source file, the compilation succeeds.
@pjlegato which version of nrepl.el and leiningen are you running?
@kingtim I have nrepl.el 0.1.5, leiningen 2.0.0-preview10, and Aquamacs Emacs 18.104.22.168.
Sorry, I misread the original ticket. I do not get C-c C-k is undefined. I get Namespace not found. when I do C-c C-k on a file with a namespace that Clojure doesn't yet know about. If I manually make the namespace with (ns whatever), then C-c C-k works.
Namespace not found.
Aha. Okay, I believe the Namespace not found issue is fixed in 1.6.0-preview.
Namespace not found
I am having the same symptom that dakrone describes. I have a new computer (running ubuntu 12.04) that I've installed clojure 1.4, emacs 24 (with clojure-mode), nrepl.el 0.1.6preview, lein 2.0.0-preview10, etc. I run
lein new nr-test
My file is loaded in an emacs buffer with clojure-mode
I get my repl just fine
; nREPL 0.1.6-preview
But when I go to my clojure buffer and try
I get "C-c C-k is undefined" but without the errors above in *messages*
I can manually turn on nrepl-interaction-mode, and it works, but for some reason, that mode isn't turning on when I jack in.
@jimaltieri Your issue sounds similar to this one purcell/ac-nrepl#24.
Are you using ac-nrepl?