Skip to content

Commit b50102f

Browse files
slipsetbbatsov
authored andcommitted
[Fix #58] Add a function to connect to remote socket repl (#68)
1 parent 431c068 commit b50102f

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## master (unreleased)
44

55
### New Features
6-
6+
* [#57](https://github.com/clojure-emacs/inf-clojure/pull/68): Add `inf-clojure-connect`
77
* [#66](https://github.com/clojure-emacs/inf-clojure/pull/56): Add Planck support.
88
* [#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.
99
* [#44](https://github.com/clojure-emacs/inf-clojure/pull/44): Add REPL types and Lumo support.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ The REPL commands don't prompt by default but a prefix argument will invert
7474
this. For instance: `C-u C-c C-v` will ask for the symbol you want to show the
7575
docstring for.
7676

77+
You can use `M-x inf-clojure-connect` to connect to a running socket-repl.
78+
You will be prompted for host and port.
79+
7780
## REPL Type
7881

7982
An `inf-clojure` REPL can be of different types: Clojure, ClojureScript, Lumo and Planck are all potentially valid options.

inf-clojure.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,13 @@ of `inf-clojure-*-cmd'). Runs the hooks from
467467
(pop-to-buffer-same-window "*inf-clojure*")
468468
(pop-to-buffer "*inf-clojure*")))
469469

470+
;;;###autoload
471+
(defun inf-clojure-connect (host port)
472+
"Connect to a running socket-repl via `inf-clojure'.
473+
HOST is the host the process is running on, PORT is where it's listening."
474+
(interactive "shost: \nnport: ")
475+
(inf-clojure (cons host port)))
476+
470477
(defun inf-clojure-eval-region (start end &optional and-go)
471478
"Send the current region to the inferior Clojure process.
472479
Prefix argument AND-GO means switch to the Clojure buffer afterwards."

0 commit comments

Comments
 (0)