murtaza52
murtaza52

Reputation: 47441

:repl-options do not take effect when used with :main in project.clj

Below is my partial project.clj file

  :aot [almonds.runner]
  :main almonds.runner
  :profiles {:dev
             {:dependencies [[org.clojure/tools.namespace "0.2.4"]]
              :repl-options {:init-ns user
                             :init (refresh)}
              :source-paths ["dev"]}}

I am using cider with emacs. When I run cider-jack-in the repl starts in the almonds.main ns instead of the user ns. How do I make it start in the user ns and also run the refresh fn ?

Upvotes: 1

Views: 146

Answers (1)

Tim X
Tim X

Reputation: 4235

It seems there have been some technical challenges in getting cider-jack-in 'honour' the repo-options namespace. While it seems that most issues relate to having the real NOT start in the user namespace, it is possible that changes/fixes to address that issue are impacting on your requirements. Have a look at the issues logged against the cider github repo - in particular #777 and #919. They may give you enough background/pointers to work out either how to fix the problem or work around it.

I've actually moved away from using cider-jack-in and now prefer to run the real in it's own terminal and use cider-connect from within emacs.

Note also that there has been an update to lein (2.5.1), so you may want to start with that version (though beware there have been some issues with the installer on Windows platforms - I upgraded under Linux with no problems). As cider is also a fairly fast moving target, you probably want to also be using the latest packages.

Upvotes: 1

Related Questions