Cider: Profile selection at cider-jack-in

Created on 22 Aug 2014  ·  3Comments  ·  Source: clojure-emacs/cider

I would like to be able to edit the lein command used for cider-jack-in so that I can change profile.
There was support for this in 0.7 although it was broken. Commit 3e5a73b1ffb631b5e4352c17d8ec4810a34a020a fixed the breakage by removing the support!

Workaround is to launch lein myself, or set-variable cider-lein-parameters

Most helpful comment

For anyone else need this feature, try this:

(defun start-cider-repl-with-profile ()
  (interactive)
  (letrec ((profile (read-string "Enter profile name: "))
           (lein-params (concat "with-profile +" profile " repl :headless")))
    (message "lein-params set to: %s" lein-params)
    (set-variable 'cider-lein-parameters lein-params)
    (cider-jack-in)))

All 3 comments

For anyone else need this feature, try this:

(defun start-cider-repl-with-profile ()
  (interactive)
  (letrec ((profile (read-string "Enter profile name: "))
           (lein-params (concat "with-profile +" profile " repl :headless")))
    (message "lein-params set to: %s" lein-params)
    (set-variable 'cider-lein-parameters lein-params)
    (cider-jack-in)))

For anyone else need this feature, try this:

(defun start-cider-repl-with-profile ()
  (interactive)
  (letrec ((profile (read-string "Enter profile name: "))
           (lein-params (concat "with-profile +" profile " repl :headless")))
    (message "lein-params set to: %s" lein-params)
    (set-variable 'cider-lein-parameters lein-params)
    (cider-jack-in)))

I get a error like "eval-region: Wrong number of arguments: (1 . 1), 0" in GNU Emacs 26.2 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109)) of 2019-04-13. But just a very little rewrite:

(defun cider-jack-in-with-profile ()
  (interactive)
  (letrec ((profile (read-string "Enter profile name: "))
           (lein-params (concat "with-profile +" profile " repl :headless")))
    (message "lein-params set to: %s" lein-params)
    (set-variable 'cider-lein-parameters lein-params)
    ;; just a empty parameter
    (cider-jack-in '())))

It is work now.

"eval-region: Wrong number of arguments: (1 . 1), 0"

I'm a little annoyed about this kind of error.
I have been doing Golang stuff for about one year, and return to clojure this week to maintain a cljs project, there are break changes related to cider that I have to dig about, this error is one of them, others are:

While Clojure itself is quite stable, but the tools are not. I really hope maintainers care about compatibility a lot more.
If break changes have to be made, bump major version in SemVer, which it is designed for. Go is good at maintaining compatibility, which I think is one reason to its success.

Cider is awesome, please make it better. Thanks.

Was this page helpful?
0 / 5 - 0 ratings