C-c C-k compilation not working #123

Closed
dakrone opened this Issue Sep 27, 2012 · 13 comments

Comments

Projects
None yet
5 participants

dakrone commented Sep 27, 2012

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

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\
er--) --cl-rest--)))

My init.el looks like this:

(add-to-list 'load-path "~/src/elisp/nrepl.el")
(require 'nrepl)
(add-hook 'nrepl-interaction-mode-hook
          'nrepl-turn-on-eldoc-mode)
Owner

kingtim commented Sep 27, 2012

Thank you for reporting this.
What version of nrepl.el are you using?

dakrone commented Sep 27, 2012

nrepl.el from git, pulled as of this morning.

Owner

kingtim commented Oct 2, 2012

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?

dakrone commented Oct 2, 2012

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.

dakrone commented Oct 2, 2012

Here is the project I can reproduce it on: http://writequit.org/files/zktest.tgz

Steps:

;; 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
Owner

kingtim commented Nov 14, 2012

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.

Owner

kingtim commented Nov 29, 2012

@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 24.1.50.3.

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.

Owner

kingtim commented Nov 30, 2012

Aha. Okay, I believe the Namespace not found issue is fixed in 1.6.0-preview.

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
emacs nr-test/src/nr_test/core.clj

My file is loaded in an emacs buffer with clojure-mode

M-x nrepl-jack-in

I get my repl just fine

; nREPL 0.1.6-preview

But when I go to my clojure buffer and try

C-c C-k

I get "C-c C-k is undefined" but without the errors above in *messages*

Update:
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.

Owner

kingtim commented Feb 3, 2013

@jimaltieri Your issue sounds similar to this one purcell/ac-nrepl#24.
Are you using ac-nrepl?

bbatsov closed this Jul 24, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment