Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process project's repl-options #30

Closed
jsnikeris opened this issue Jul 23, 2012 · 10 comments
Closed

Process project's repl-options #30

jsnikeris opened this issue Jul 23, 2012 · 10 comments

Comments

@jsnikeris
Copy link
Contributor

It would be nice if the project's init and init-ns settings were processed in the same way that REPL-y processes them.

@technomancy
Copy link
Contributor

This actually needs to be handled server-side, probably in nREPL, but possibly with some changes to Leiningen's repl task.

@jsnikeris
Copy link
Contributor Author

A workaround:

(defun my-nrepl-connected-hook ()
  (nrepl-interactive-eval
   "(do (set! *print-length* 103) (set! *print-level* 15))"))

(add-hook 'nrepl-connected-hook 'my-nrepl-connected-hook)

@kenrestivo
Copy link
Contributor

If it could grab :port from either project.clj or profiles.clj, then mayb eit wouldn't need to prompt for one.

@kingtim
Copy link
Member

kingtim commented Nov 14, 2012

This is fixed in leiningen now.
See issue technomancy/leiningen#788.

@kingtim kingtim closed this as completed Nov 14, 2012
@mtopolnik
Copy link

What exactly is fixed? In the pull request mentioned in the referenced issue, only a patch specific to honoring :init is involved. This still leaves :init-ns, which is doubly convenient: it both compiles the initial namespace and sets it as the current namespace. Since practically every repl session starts with this routine performed manually, honoring init-ns in nrepl.el would obviously be a major convenience. I was actually looking into writing some elisp code that would open the .clj file of the initial namespace since this is the third part of the regular routine. I was going to rely on nrepl-current-ns, but unfortunately this doesn't get set to the init-ns.

UPDATE: I realized by reading repl task's source code that :init-ns is baked into :init. This has other issues, though: the behavior of the nrepl server is now different for headful and headless mode regarding the initial namespace (at least it looks like it).

@weissjeffm
Copy link
Contributor

I couldn't get either :init-ns or :init to do anything at all in my nrepl.el repl.

I tried running nrepl-jack-in, :init-ns is ignored. lein repl :headless and then nrepl to connect, ignored. If I run a plain lein repl then it works. I think this needs to be re-opened since the only way to get it to work is to not use nrepl.el at all.

@mtopolnik
Copy link

nrepl.el needs to be fixed such that it doesn't change the current namespace upon connect. The namespace at the nrepl server side is already set to the configured initial namespace.

@weissjeffm
Copy link
Contributor

@mtopolnik to me that sounds like this issue should be re-opened, or possibly open a new issue, then?

@mtopolnik
Copy link

@weissjeffm Perhaps a new issue focused on the exact requirement. I posted to nrepl.el Google Groups some time ago with this request. It would probably be better to raise an issue here.

@weissjeffm
Copy link
Contributor

Opened #316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants