emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/inf-clojure eec15c4 086/313: Accept cons pair for tcp conn


From: ELPA Syncer
Subject: [nongnu] elpa/inf-clojure eec15c4 086/313: Accept cons pair for tcp connections (#34)
Date: Wed, 11 Aug 2021 09:59:52 -0400 (EDT)

branch: elpa/inf-clojure
commit eec15c43f9ea4deccf7cf64d329d75b1f9bcbdcd
Author: Mark Hinshaw <mahinshaw@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>

    Accept cons pair for tcp connections (#34)
---
 README.md      |  7 +++++++
 inf-clojure.el | 11 ++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 6034312..5a44b86 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,13 @@ Add the following to your Emacs config to enable
 (add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)
 ```
 
+`inf-clojure-program` is a custom variable that defines a program to run
+or the tcp socket to connect to when starting `inf-clojure`. By default
+this var is set to `lein repl`, which will start a repl via leiningen.
+However, it is possible to use a cons pair like `("localhost" . 5555)` to
+connect to a socket repl like the one provided with 
[planck](http://planck-repl.org/),
+which can be started from the command line with `planck -n 5555`.
+
 **Don't enable `inf-clojure-minor-mode` and `cider-mode` at the same
 time.  They have overlapping functionality and keybindings and the
 result will be nothing short of havoc.**
diff --git a/inf-clojure.el b/inf-clojure.el
index 7490028..138e721 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -139,8 +139,11 @@ The following commands are available:
                #'inf-clojure-completion-at-point))
 
 (defcustom inf-clojure-program "lein repl"
-  "Program name for invoking an inferior Clojure in Inferior Clojure mode."
-  :type 'string
+  "Either a program name or a connection cons pair consisting of a host
+and port number (e.g. (\"localhost\" . 5555)), for invoking an inferior Clojure
+in Inferior Clojure mode."
+  :type '(choice (string)
+                 (cons string integer))
   :group 'inf-clojure)
 
 (defcustom inf-clojure-load-command "(clojure.core/load-file \"%s\")\n"
@@ -322,7 +325,9 @@ of `inf-clojure-program').  Runs the hooks from
   (if (not (comint-check-proc "*inf-clojure*"))
       ;; run the new process in the project's root when in a project folder
       (let ((default-directory (inf-clojure-project-root))
-            (cmdlist (split-string cmd)))
+            (cmdlist (if (consp cmd)
+                         (list cmd)
+                       (split-string cmd))))
         (set-buffer (apply #'make-comint
                            "inf-clojure" (car cmdlist) nil (cdr cmdlist)))
         (inf-clojure-mode)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]