Skip to content

[Fix #58] Add function to connect to remote repl #68

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

Merged
merged 1 commit into from
Apr 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## master (unreleased)

### New Features

* [#57](https://github.com/clojure-emacs/inf-clojure/pull/68): Add `inf-clojure-connect`
* [#66](https://github.com/clojure-emacs/inf-clojure/pull/56): Add Planck support.
* [#51](https://github.com/clojure-emacs/inf-clojure/pull/51): Commands do not prompt by default anymore, unless they receive a non-nil prefix argument.
* [#44](https://github.com/clojure-emacs/inf-clojure/pull/44): Add REPL types and Lumo support.
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ The REPL commands don't prompt by default but a prefix argument will invert
this. For instance: `C-u C-c C-v` will ask for the symbol you want to show the
docstring for.

You can use `M-x inf-clojure-connect` to connect to a running socket-repl.
You will be prompted for host and port.

## REPL Type

An `inf-clojure` REPL can be of different types: Clojure, ClojureScript, Lumo and Planck are all potentially valid options.
Expand Down
7 changes: 7 additions & 0 deletions inf-clojure.el
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,13 @@ of `inf-clojure-*-cmd'). Runs the hooks from
(pop-to-buffer-same-window "*inf-clojure*")
(pop-to-buffer "*inf-clojure*")))

;;;###autoload
(defun inf-clojure-connect (host port)
"Connect to a running socket-repl via `inf-clojure'.
HOST is the host the process is running on, PORT is where it's listening."
(interactive "shost: \nnport: ")
(inf-clojure (cons host port)))

(defun inf-clojure-eval-region (start end &optional and-go)
"Send the current region to the inferior Clojure process.
Prefix argument AND-GO means switch to the Clojure buffer afterwards."
Expand Down