Skip to content

Commit

Permalink
Rename cider-cljs-repl to cider-cljs-lein-repl
Browse files Browse the repository at this point in the history
  • Loading branch information
Malabarba committed Dec 9, 2015
1 parent 9dce1e7 commit 313a0df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ present in your REPL session.
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
```

2. Issue <kbd>M-x</kbd> `customize-variable` <kbd>RET</kbd> `cider-cljs-repl` if
2. Issue <kbd>M-x</kbd> `customize-variable` <kbd>RET</kbd> `cider-cljs-lein-repl` if
you'd like to change the REPL used (the default is `rhino`).

3. Open a file in your project and issue <kbd>M-x</kbd>
Expand All @@ -650,7 +650,7 @@ Using Weasel, you can also have a browser-connected REPL.

1. Add `[weasel "0.7.0"]` to your project's `:dependencies`.

2. Issue <kbd>M-x</kbd> `customize-variable` <kbd>RET</kbd> `cider-cljs-repl`
2. Issue <kbd>M-x</kbd> `customize-variable` <kbd>RET</kbd> `cider-cljs-lein-repl`
and choose the `Weasel` option.

3. Add this to your ClojureScript code:
Expand Down
16 changes: 9 additions & 7 deletions cider.el
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Sub-match 1 must be the project path.")
("boot" cider-boot-parameters)
("gradle" cider-gradle-parameters)))

(defcustom cider-cljs-repl "(cemerick.piggieback/cljs-repl (cljs.repl.rhino/repl-env))"
(defcustom cider-cljs-lein-repl "(cemerick.piggieback/cljs-repl (cljs.repl.rhino/repl-env))"
"Clojure form that returns a ClojureScript REPL environment.
This is evaluated in a Clojure REPL and it should start a ClojureScript
REPL."
Expand All @@ -208,6 +208,7 @@ REPL."
"(do (require 'weasel.repl.websocket) (cemerick.piggieback/cljs-repl (weasel.repl.websocket/repl-env :ip \"127.0.0.1\" :port 9001)))")
(string :tag "Custom"))
:group 'cider)
(define-obsolete-variable-alias 'cider-cljs-repl 'cider-cljs-lein-repl "0.11.0")

(defun cider-create-sibling-cljs-repl (client-buffer)
"Create a ClojureScript REPL with the same server as CLIENT-BUFFER.
Expand All @@ -231,7 +232,7 @@ should be the regular Clojure REPL started by the server process filter."
(list "op" "eval"
"ns" (cider-current-ns)
"session" nrepl-session
"code" cider-cljs-repl)
"code" cider-cljs-lein-repl)
(cider-repl-handler (current-buffer))))))

(defun cider--select-zombie-buffer (repl-buffers)
Expand Down Expand Up @@ -278,7 +279,7 @@ If CLJS-TOO is non-nil, also start a ClojureScript REPL session with its
own buffer."
(interactive "P")
(setq cider-current-clojure-buffer (current-buffer))
(let ((project-type (or (cider-project-type) cider-default-repl-command)))
(let ((project-type (cider-project-type)))
(if (funcall (cider-command-present-p project-type))
(let* ((project (when prompt-project
(read-directory-name "Project: ")))
Expand Down Expand Up @@ -431,10 +432,11 @@ If more than one project file types are present, prompt the user to choose."
'(("lein" . "project.clj")
("boot" . "build.boot")
("gradle" . "build.gradle"))))))
(if (> (length choices) 1)
(completing-read "Which command shoud be used? " choices
nil t (car choices))
(car choices))))
(or (if (> (length choices) 1)
(completing-read "Which command shoud be used? " choices
nil t (car choices))
(car choices))
cider-default-repl-command)))

;; TODO: Implement a check for `cider-lein-command' over tramp
(defun cider--lein-present-p ()
Expand Down

0 comments on commit 313a0df

Please sign in to comment.