Skip to content

Commit

Permalink
[Fix #949] Define custom cider-default-repl-command.
Browse files Browse the repository at this point in the history
Custom var is used with `cider-jack-in` when connecting to
project-less REPLs.
  • Loading branch information
pandeiro committed Jan 16, 2015
1 parent 99f262a commit 73f9271
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
`nrepl-client` connection logic from CIDER. New hooks `cider-connected-hook`
and `cider-disconnected-hook`.
* [#920](https://github.com/clojure-emacs/cider/issues/920): Support `cider-jack-in` for boot-based projects.
* [#949](https://github.com/clojure-emacs/cider/issues/949): New custom var: `cider-default-repl-command`.

### Changes

Expand Down
11 changes: 10 additions & 1 deletion cider.el
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ version from the CIDER package or library.")
:group 'cider
:package-version '(cider . "0.9.0"))

(defcustom cider-default-repl-command
"lein"
"Determines the default command and parameters to use when connecting to nREPL.
This value will only be consulted when no identifying file types, ie project.clj for
leiningen or build.boot for boot, could be found."
:type 'string
:group 'cider
:package-version '(cider . "0.9.0"))

(defcustom cider-known-endpoints nil
"Specify a list of custom endpoints where each endpoint is a list.
For example: '((\"label\" \"host\" \"port\")).
Expand Down Expand Up @@ -158,7 +167,7 @@ If PROMPT-PROJECT is t, then prompt for the project for which to
start the server."
(interactive "P")
(setq cider-current-clojure-buffer (current-buffer))
(let ((project-type (cider-project-type)))
(let ((project-type (or (cider-project-type) cider-default-repl-command)))
(if (funcall (cider-command-present-p project-type))
(let* ((nrepl-create-client-buffer-function #'cider-repl-create)
(project (when prompt-project
Expand Down

0 comments on commit 73f9271

Please sign in to comment.