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

A way to specify a default for "Which command should be used?" in cider-jack-in #1672

Closed
harold opened this issue Apr 12, 2016 · 6 comments
Closed

Comments

@harold
Copy link
Contributor

harold commented Apr 12, 2016

My thought

  1. When I do M-x cider-jack-in (C-c M-j) I am presented with a minibuffer saying:

Which command should be used? ... I believe this is because our team semi-recently put some boot scripts along side our project.clj.

It would be nice if I could set an elisp variable, or some other mechanism, to force always lein there, to remove one-last enter-key press before the repl starts for projects where I know I always want to start the repl with lein.

Thanks!

CIDER version information

;; CIDER 0.11.0 (Bulgaria), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_77

Lein/Boot version

2.5.3

Emacs version

24.4.1

Operating system

Ubuntu 15.04

@bbatsov
Copy link
Member

bbatsov commented Apr 13, 2016

This makes sense. We can certainly do it.

@Malabarba
Copy link
Member

I'm think we could change the prompt to something like this:

Choose the command to use: **l**ein, **b**oot.
Hold Shift to make the choice permanent.

If the user holds shift, we save the choice to a custom variable.

They can make CIDER “forget” the choice by invoking cider-jack-in with a prefix argument.
The prefix argument is already used as “prompt for the project”, but I think it makes sense to extend it to “prompt for things”.

@bbatsov
Copy link
Member

bbatsov commented Apr 13, 2016

Interesting idea, although it's not something I've seen so far in Emacs (the "hold shift" part at least).

@Malabarba
Copy link
Member

Yeah. It would at least let us avoid an extra prompt, and probably make things easier for everybody.

@expez expez changed the title [improvement] A way to specify a default for "Which command should be used?" in cider-jack-in A way to specify a default for "Which command should be used?" in cider-jack-in Apr 14, 2016
@dpsutton
Copy link
Contributor

We talked about this in slack. Thinking so far (and this is by no means binding or the "right" answer):

Have a single defvar that holds the preferred lein or boot, set to nil and must be explicitly set. When there are multiple build systems identified, check to see if the resolution strategy (this variable) is set. If so, use this one, otherwise do the current behavior which is to ask the user.

@Malabarba
Copy link
Member

Sounds good! Just 3 small changes:

Have a single defcustom that holds the preferred lein, boot, or gradle , set to nil and must be explicitly set. When there are multiple build systems identified, check to see if the resolution strategy (this variable) is set and if it is one of the available options. If so, use this one, otherwise do the current behavior which is to ask the user.

ajchemist pushed a commit to ajchemist/cider that referenced this issue Apr 25, 2016
…d choice (clojure-emacs#1705)

When there are artifacts from multiple build systems, eg: lein, boot,
etc, look in `cider-preferred-build-system`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants