[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure f3d6a68 223/313: Add support for joker (#160)
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure f3d6a68 223/313: Add support for joker (#160) |
Date: |
Wed, 11 Aug 2021 10:00:21 -0400 (EDT) |
branch: elpa/inf-clojure
commit f3d6a6878c9b3bbf457c1756443afaa385921b14
Author: Andrea Richiardi <a.richiardi.work@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Add support for joker (#160)
This patch introduces the defcustoms necessary for supporting joker.
---
CHANGELOG.md | 1 +
README.md | 20 ++++++------
inf-clojure.el | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 111 insertions(+), 9 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6701933..c1d3360 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
## master (unreleased)
+* [#160](https://github.com/clojure-emacs/inf-clojure/pull/160): Support
[Joker](https://joker-lang.org/).
* [#135](https://github.com/clojure-emacs/inf-clojure/pull/135): Improve
command sanitation code.
## 2.1.0 (2018-01-02)
diff --git a/README.md b/README.md
index 692f3a7..3420f76 100644
--- a/README.md
+++ b/README.md
@@ -26,8 +26,9 @@ Clojure(Script) development:
* Macroexpansion
* Require `:reload`/`:reload-all`
* Support connecting to socket REPLs
-* Support for Lumo
-* Support for Planck
+* Support for [Lumo](https://github.com/anmonteiro/lumo)
+* Support for [Planck](http://planck-repl.org/)
+* Support for [Joker](https://joker-lang.org/)
For a more powerful/full-featured solution see
[CIDER](https://github.com/clojure-emacs/cider).
@@ -267,9 +268,9 @@ You can see all the configuration options available using
the command
An `inf-clojure` REPL can be of different types: Clojure, ClojureScript, Lumo
and Planck are all potentially valid options.
- At the moment, the default Clojure REPL, the Lumo REPL and the Planck REPL are
-supported (standard ClojureScript is lacking mostly because some features
-require to access the compiler state,
+At the moment, the default Clojure REPL, the Lumo REPL, the Planck REPL and the
+Joker REPL are supported (standard ClojureScript is lacking mostly because some
+features require to access the compiler state,
[cljs-tooling](https://github.com/clojure-emacs/cljs-tooling) is a good
candidate for enabling support).
@@ -311,10 +312,11 @@ You can leave it enabled, it just won't show anything in
the echo area.
#### Code Completion
Code completion is particularly open to customization. Not only you can `setq`
-the customary `inf-clojure-completion-form`, `inf-clojure-completion-form-lumo`
-and `inf-clojure-completion-form-planck` - the form to send to the REPL - but
-you can also use `inf-clojure-completions-fn` for specifying a function that
-given the REPL response should return elisp data compatible with
+the customary `inf-clojure-completion-form`,
+`inf-clojure-completion-form-lumo`, `inf-clojure-completion-form-planck` and
+`inf-clojure-completion-form-joker` - the form to send to the REPL - but you
+can also use `inf-clojure-completions-fn` for specifying a function that given
+the REPL response should return elisp data compatible with
[`completion-at-point-functions`](https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion-in-Buffers.html).
For more info run `M-x describe-variable RET inf-clojure-completions-fn`.
Another option is to have a look at
diff --git a/inf-clojure.el b/inf-clojure.el
index e1cfa31..84eac7d 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -48,6 +48,7 @@
;; * Support connecting to socket REPLs
;; * Support for Lumo
;; * Support for Planck
+;; * Support for Joker
;;
;; For a more powerful/full-featured solution see
https://github.com/clojure-emacs/cider.
;;
@@ -276,6 +277,16 @@ often connecting to a remote REPL process."
:safe #'stringp
:package-version '(inf-clojure . "2.0.0"))
+;;;; Joker
+;;;; ====
+
+(defcustom inf-clojure--joker-repl-form
+ "(find-ns 'joker.repl)"
+ "Form to invoke in order to verify that we launched a Planck REPL."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defvar-local inf-clojure-repl-type nil
"Symbol to define your REPL type.
Its root binding is nil and it can be further customized using
@@ -292,6 +303,7 @@ See
http://blog.jorgenschaefer.de/2014/05/race-conditions-in-emacs-process-filte
(cond
((inf-clojure--some-response-p proc inf-clojure--lumo-repl-form) 'lumo)
((inf-clojure--some-response-p proc inf-clojure--planck-repl-form)
'planck)
+ ((inf-clojure--some-response-p proc inf-clojure--joker-repl-form)
'joker)
(t 'clojure)))))
(defun inf-clojure--set-repl-type (proc)
@@ -374,6 +386,15 @@ Clojure to load that file."
:safe #'stringp
:package-version '(inf-clojure . "2.0.0"))
+(defcustom inf-clojure-load-form-joker "(load-file \"%s\")"
+ "Joker format-string for building a Clojure expression to load a file.
+This format string should use `%s' to substitute a file name and
+should result in a Clojure form that will be sent to the inferior
+Clojure to load that file."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-load-form (proc)
"Return the form to query the Inf-Clojure PROC for var's documentation.
If you are using REPL types, it will pickup the most appropriate
@@ -381,6 +402,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`lumo inf-clojure-load-form-lumo)
(`planck inf-clojure-load-form-planck)
+ (`joker inf-clojure-load-form-joker)
(_ inf-clojure-load-form)))
(defcustom inf-clojure-reload-form "(require '%s :reload)"
@@ -813,6 +835,13 @@ The prefix argument ARG can change the behavior of the
command:
:safe #'stringp
:package-version '(inf-clojure . "2.0.0"))
+(defcustom inf-clojure-var-doc-form-joker
+ "(joker.repl/doc %s)"
+ "Joker form to query inferior Clojure for a var's documentation."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-var-doc-form (proc)
"Return the form to query the Inf-Clojure PROC for a var's documentation.
If you are using REPL types, it will pickup the most appropriate
@@ -821,6 +850,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`lumo inf-clojure-var-doc-form-lumo)
(`planck inf-clojure-var-doc-form-planck)
+ (`joker inf-clojure-var-doc-form-joker)
(_ inf-clojure-var-doc-form))))
(defcustom inf-clojure-var-source-form
@@ -844,6 +874,13 @@ If you are using REPL types, it will pickup the most
appropriate
:safe #'stringp
:package-version '(inf-clojure . "2.0.0"))
+(defcustom inf-clojure-var-source-form-joker
+ ""
+ "Joker form to query inferior Clojure for a var's source."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-var-source-form (proc)
"Return the form to query the Inf-Clojure PROC for a var's source.
If you are using REPL types, it will pickup the most appropriate
@@ -852,6 +889,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`lumo inf-clojure-var-source-form-lumo)
(`planck inf-clojure-var-source-form-planck)
+ (`joker inf-clojure-var-source-form-joker)
(_ inf-clojure-var-source-form))))
(define-obsolete-variable-alias 'inf-clojure-var-source-command
'inf-clojure-var-source-form "2.0.0")
@@ -887,6 +925,18 @@ If you are using REPL types, it will pickup the most
appropriate
:safe #'stringp
:package-version '(inf-clojure . "2.1.0"))
+(defcustom inf-clojure-arglists-form-joker
+ "(try
+ (:arglists
+ (joker.core/meta
+ (joker.core/resolve
+ (joker.core/read-string \"%s\"))))
+ (catch Error _ nil))"
+ "Joker form to query inferior Clojure for a function's arglists."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-arglists-form (proc)
"Return the form to query the Inf-Clojure PROC for arglists of a var.
If you are using REPL types, it will pickup the most appropriate
@@ -895,6 +945,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`lumo inf-clojure-arglists-form-lumo)
(`planck inf-clojure-arglists-form-planck)
+ (`joker inf-clojure-arglists-form-joker)
(_ inf-clojure-arglists-form))))
(defcustom inf-clojure-completion-form
@@ -923,6 +974,13 @@ If you are using REPL types, it will pickup the most
appropriate
:safe #'stringp
:package-version '(inf-clojure . "2.0.0"))
+(defcustom inf-clojure-completion-form-joker
+ ""
+ "Joker form to query inferior Clojure for completion candidates."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-completion-form (proc)
"Return the form to query the Inf-Clojure PROC for completions.
If you are using REPL types, it will pickup the most appropriate
@@ -931,6 +989,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`lumo inf-clojure-completion-form-lumo)
(`planck inf-clojure-completion-form-planck)
+ (`joker inf-clojure-completion-form-joker)
(_ inf-clojure-completion-form))))
(defcustom inf-clojure-ns-vars-form
@@ -954,6 +1013,13 @@ If you are using REPL types, it will pickup the most
appropriate
:safe #'stringp
:package-version '(inf-clojure . "2.0.0"))
+(defcustom inf-clojure-ns-vars-form-joker
+ ""
+ "Joker form to show the public vars in a namespace."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-ns-vars-form (proc)
"Return the form to query the Inf-Clojure PROC for public vars in a
namespace.
If you are using REPL types, it will pickup the most appropriate
@@ -962,6 +1028,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`lumo inf-clojure-ns-vars-form-lumo)
(`planck inf-clojure-ns-vars-form-planck)
+ (`joker inf-clojure-ns-vars-form-joker)
(_ inf-clojure-ns-vars-form))))
(define-obsolete-variable-alias 'inf-clojure-ns-vars-command
'inf-clojure-ns-vars-form "2.0.0")
@@ -987,6 +1054,13 @@ If you are using REPL types, it will pickup the most
appropriate
:safe #'stringp
:package-version '(inf-clojure . "2.0.0"))
+(defcustom inf-clojure-set-ns-form-joker
+ "(in-ns '%s)"
+ "Joker form to set the namespace of the inferior Clojure process."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-set-ns-form (proc)
"Return the form to set the namespace of the Inf-Clojure PROC.
If you are using REPL types, it will pickup the most appropriate
@@ -994,6 +1068,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`planck inf-clojure-set-ns-form-planck)
(`lumo inf-clojure-set-ns-form-lumo)
+ (`joker inf-clojure-set-ns-form-joker)
(_ inf-clojure-set-ns-form)))
(define-obsolete-variable-alias 'inf-clojure-set-ns-command
'inf-clojure-set-ns-form "2.0.0")
@@ -1021,6 +1096,13 @@ If you are using REPL types, it will pickup the most
appropriate
:safe #'stringp
:package-version '(inf-clojure . "2.0.0"))
+(defcustom inf-clojure-apropos-form-joker
+ ""
+ "Joker form to invoke apropos."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-apropos-form (proc)
"Return the form to query the Inf-Clojure PROC for a var's apropos.
If you are using REPL types, it will pickup the most appropriate
@@ -1029,6 +1111,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`lumo inf-clojure-apropos-form-lumo)
(`planck inf-clojure-apropos-form-planck)
+ (`joker inf-clojure-apropos-form-joker)
(_ inf-clojure-apropos-form))))
(define-obsolete-variable-alias 'inf-clojure-apropos-command
'inf-clojure-apropos-form "2.0.0")
@@ -1054,6 +1137,13 @@ If you are using REPL types, it will pickup the most
appropriate
:safe #'stringp
:package-version '(inf-clojure . "2.2.0"))
+(defcustom inf-clojure-macroexpand-form-joker
+ "(macroexpand '%s)"
+ "Joker form to invoke macroexpand."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-macroexpand-form (proc)
"Return the form for macroexpansion in the Inf-Clojure PROC.
If you are using REPL types, it will pickup the most appropriate
@@ -1062,6 +1152,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`lumo inf-clojure-macroexpand-form-lumo)
(`planck inf-clojure-macroexpand-form-planck)
+ (`joker inf-clojure-macroexpand-form-joker)
(_ inf-clojure-macroexpand-form))))
(define-obsolete-variable-alias 'inf-clojure-macroexpand-command
'inf-clojure-macroexpand-form "2.0.0")
@@ -1087,6 +1178,13 @@ If you are using REPL types, it will pickup the most
appropriate
:safe #'stringp
:package-version '(inf-clojure . "2.2.0"))
+(defcustom inf-clojure-macroexpand-1-form-joker
+ "(macroexpand-1 '%s)"
+ "Joker form to invoke macroexpand-1."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.2.0"))
+
(defun inf-clojure-macroexpand-1-form (proc)
"Return the form for macroexpand-1 in the Inf-Clojure PROC.
If you are using REPL types, it will pickup the most appropriate
@@ -1095,6 +1193,7 @@ If you are using REPL types, it will pickup the most
appropriate
(pcase (inf-clojure--set-repl-type proc)
(`lumo inf-clojure-macroexpand-1-form-lumo)
(`planck inf-clojure-macroexpand-1-form-planck)
+ (`joker inf-clojure-macroexpand-1-form-joker)
(_ inf-clojure-macroexpand-1-form))))
(define-obsolete-variable-alias 'inf-clojure-macroexpand-1-command
'inf-clojure-macroexpand-1-form "2.0.0")
- [nongnu] elpa/inf-clojure 784eb40 279/313: Remove unused require, (continued)
- [nongnu] elpa/inf-clojure 784eb40 279/313: Remove unused require, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 56810a7 284/313: Add a note about the required Emacs version, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f333ffd 291/313: Font lock on repl inserts, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure dfc27a3 302/313: [Docs] Add a note about the REPL name inference, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure c23c55e 312/313: Release 3.1.0, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 8c37fba 139/313: Mention some of the essential features in the README, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f420c8a 199/313: Add sanitation to inf-clojure-send-string, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure e68108d 213/313: Make three sections for the socket REPLs, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 1295e58 214/313: [security] Don't execute arbitrary functions (#146), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6913798 217/313: Fix small things in README again, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f3d6a68 223/313: Add support for joker (#160),
ELPA Syncer <=
- [nongnu] elpa/inf-clojure 98db4c8 227/313: Bump the copyright years, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure b29a3f1 221/313: Use CircleCI for CI testing (#159), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0697d6f 233/313: Add insert last sexp and keymap to hold them all, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 7a5b32f 238/313: Extend a bit the README, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 30638a0 242/313: Remove old defcustomed, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 1bac8fe 249/313: Tweak some messages, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f1c8323 261/313: Fix some wording, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 23492b5 263/313: Trim some whitespace, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 8be9cec 269/313: Use kbd-style keybindings everywhere, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 68ab0f7 282/313: Bump the required Emacs version, ELPA Syncer, 2021/08/11