48
48
; ; * Support connecting to socket REPLs
49
49
; ; * Support for Lumo
50
50
; ; * Support for Planck
51
+ ; ; * Support for Joker
51
52
; ;
52
53
; ; For a more powerful/full-featured solution see https://github.com/clojure-emacs/cider.
53
54
; ;
@@ -276,6 +277,16 @@ often connecting to a remote REPL process."
276
277
:safe #'stringp
277
278
:package-version '(inf-clojure . " 2.0.0" ))
278
279
280
+ ; ;;; Joker
281
+ ; ;;; ====
282
+
283
+ (defcustom inf-clojure--joker-repl-form
284
+ " (find-ns 'joker.repl)"
285
+ " Form to invoke in order to verify that we launched a Planck REPL."
286
+ :type 'string
287
+ :safe #'stringp
288
+ :package-version '(inf-clojure . " 2.2.0" ))
289
+
279
290
(defvar-local inf-clojure-repl-type nil
280
291
" Symbol to define your REPL type.
281
292
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
292
303
(cond
293
304
((inf-clojure--some-response-p proc inf-clojure--lumo-repl-form) 'lumo )
294
305
((inf-clojure--some-response-p proc inf-clojure--planck-repl-form) 'planck )
306
+ ((inf-clojure--some-response-p proc inf-clojure--joker-repl-form) 'joker )
295
307
(t 'clojure )))))
296
308
297
309
(defun inf-clojure--set-repl-type (proc )
@@ -374,13 +386,23 @@ Clojure to load that file."
374
386
:safe #'stringp
375
387
:package-version '(inf-clojure . " 2.0.0" ))
376
388
389
+ (defcustom inf-clojure-load-form-joker " (load-file \" %s\" )"
390
+ " Joker format-string for building a Clojure expression to load a file.
391
+ This format string should use `%s' to substitute a file name and
392
+ should result in a Clojure form that will be sent to the inferior
393
+ Clojure to load that file."
394
+ :type 'string
395
+ :safe #'stringp
396
+ :package-version '(inf-clojure . " 2.2.0" ))
397
+
377
398
(defun inf-clojure-load-form (proc )
378
399
" Return the form to query the Inf-Clojure PROC for var's documentation.
379
400
If you are using REPL types, it will pickup the most appropriate
380
401
`inf-clojure-var-doc-form` variant."
381
402
(pcase (inf-clojure--set-repl-type proc)
382
403
(`lumo inf-clojure-load-form-lumo)
383
404
(`planck inf-clojure-load-form-planck)
405
+ (`joker inf-clojure-load-form-joker)
384
406
(_ inf-clojure-load-form)))
385
407
386
408
(defcustom inf-clojure-reload-form " (require '%s :reload)"
@@ -813,6 +835,13 @@ The prefix argument ARG can change the behavior of the command:
813
835
:safe #'stringp
814
836
:package-version '(inf-clojure . " 2.0.0" ))
815
837
838
+ (defcustom inf-clojure-var-doc-form-joker
839
+ " (joker.repl/doc %s)"
840
+ " Joker form to query inferior Clojure for a var's documentation."
841
+ :type 'string
842
+ :safe #'stringp
843
+ :package-version '(inf-clojure . " 2.2.0" ))
844
+
816
845
(defun inf-clojure-var-doc-form (proc )
817
846
" Return the form to query the Inf-Clojure PROC for a var's documentation.
818
847
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
821
850
(pcase (inf-clojure--set-repl-type proc)
822
851
(`lumo inf-clojure-var-doc-form-lumo)
823
852
(`planck inf-clojure-var-doc-form-planck)
853
+ (`joker inf-clojure-var-doc-form-joker)
824
854
(_ inf-clojure-var-doc-form))))
825
855
826
856
(defcustom inf-clojure-var-source-form
@@ -844,6 +874,13 @@ If you are using REPL types, it will pickup the most appropriate
844
874
:safe #'stringp
845
875
:package-version '(inf-clojure . " 2.0.0" ))
846
876
877
+ (defcustom inf-clojure-var-source-form-joker
878
+ " "
879
+ " Joker form to query inferior Clojure for a var's source."
880
+ :type 'string
881
+ :safe #'stringp
882
+ :package-version '(inf-clojure . " 2.2.0" ))
883
+
847
884
(defun inf-clojure-var-source-form (proc )
848
885
" Return the form to query the Inf-Clojure PROC for a var's source.
849
886
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
852
889
(pcase (inf-clojure--set-repl-type proc)
853
890
(`lumo inf-clojure-var-source-form-lumo)
854
891
(`planck inf-clojure-var-source-form-planck)
892
+ (`joker inf-clojure-var-source-form-joker)
855
893
(_ inf-clojure-var-source-form))))
856
894
857
895
(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
887
925
:safe #'stringp
888
926
:package-version '(inf-clojure . " 2.1.0" ))
889
927
928
+ (defcustom inf-clojure-arglists-form-joker
929
+ " (try
930
+ (:arglists
931
+ (joker.core/meta
932
+ (joker.core/resolve
933
+ (joker.core/read-string \" %s\" ))))
934
+ (catch Error _ nil))"
935
+ " Joker form to query inferior Clojure for a function's arglists."
936
+ :type 'string
937
+ :safe #'stringp
938
+ :package-version '(inf-clojure . " 2.2.0" ))
939
+
890
940
(defun inf-clojure-arglists-form (proc )
891
941
" Return the form to query the Inf-Clojure PROC for arglists of a var.
892
942
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
895
945
(pcase (inf-clojure--set-repl-type proc)
896
946
(`lumo inf-clojure-arglists-form-lumo)
897
947
(`planck inf-clojure-arglists-form-planck)
948
+ (`joker inf-clojure-arglists-form-joker)
898
949
(_ inf-clojure-arglists-form))))
899
950
900
951
(defcustom inf-clojure-completion-form
@@ -923,6 +974,13 @@ If you are using REPL types, it will pickup the most appropriate
923
974
:safe #'stringp
924
975
:package-version '(inf-clojure . " 2.0.0" ))
925
976
977
+ (defcustom inf-clojure-completion-form-joker
978
+ " "
979
+ " Joker form to query inferior Clojure for completion candidates."
980
+ :type 'string
981
+ :safe #'stringp
982
+ :package-version '(inf-clojure . " 2.2.0" ))
983
+
926
984
(defun inf-clojure-completion-form (proc )
927
985
" Return the form to query the Inf-Clojure PROC for completions.
928
986
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
931
989
(pcase (inf-clojure--set-repl-type proc)
932
990
(`lumo inf-clojure-completion-form-lumo)
933
991
(`planck inf-clojure-completion-form-planck)
992
+ (`joker inf-clojure-completion-form-joker)
934
993
(_ inf-clojure-completion-form))))
935
994
936
995
(defcustom inf-clojure-ns-vars-form
@@ -954,6 +1013,13 @@ If you are using REPL types, it will pickup the most appropriate
954
1013
:safe #'stringp
955
1014
:package-version '(inf-clojure . " 2.0.0" ))
956
1015
1016
+ (defcustom inf-clojure-ns-vars-form-joker
1017
+ " "
1018
+ " Joker form to show the public vars in a namespace."
1019
+ :type 'string
1020
+ :safe #'stringp
1021
+ :package-version '(inf-clojure . " 2.2.0" ))
1022
+
957
1023
(defun inf-clojure-ns-vars-form (proc )
958
1024
" Return the form to query the Inf-Clojure PROC for public vars in a namespace.
959
1025
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
962
1028
(pcase (inf-clojure--set-repl-type proc)
963
1029
(`lumo inf-clojure-ns-vars-form-lumo)
964
1030
(`planck inf-clojure-ns-vars-form-planck)
1031
+ (`joker inf-clojure-ns-vars-form-joker)
965
1032
(_ inf-clojure-ns-vars-form))))
966
1033
967
1034
(define-obsolete-variable-alias 'inf-clojure-ns-vars-command 'inf-clojure-ns-vars-form " 2.0.0" )
@@ -987,13 +1054,21 @@ If you are using REPL types, it will pickup the most appropriate
987
1054
:safe #'stringp
988
1055
:package-version '(inf-clojure . " 2.0.0" ))
989
1056
1057
+ (defcustom inf-clojure-set-ns-form-joker
1058
+ " (in-ns '%s)"
1059
+ " Joker form to set the namespace of the inferior Clojure process."
1060
+ :type 'string
1061
+ :safe #'stringp
1062
+ :package-version '(inf-clojure . " 2.2.0" ))
1063
+
990
1064
(defun inf-clojure-set-ns-form (proc )
991
1065
" Return the form to set the namespace of the Inf-Clojure PROC.
992
1066
If you are using REPL types, it will pickup the most appropriate
993
1067
`inf-clojure-set-ns-form` variant."
994
1068
(pcase (inf-clojure--set-repl-type proc)
995
1069
(`planck inf-clojure-set-ns-form-planck)
996
1070
(`lumo inf-clojure-set-ns-form-lumo)
1071
+ (`joker inf-clojure-set-ns-form-joker)
997
1072
(_ inf-clojure-set-ns-form)))
998
1073
999
1074
(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
1021
1096
:safe #'stringp
1022
1097
:package-version '(inf-clojure . " 2.0.0" ))
1023
1098
1099
+ (defcustom inf-clojure-apropos-form-joker
1100
+ " "
1101
+ " Joker form to invoke apropos."
1102
+ :type 'string
1103
+ :safe #'stringp
1104
+ :package-version '(inf-clojure . " 2.2.0" ))
1105
+
1024
1106
(defun inf-clojure-apropos-form (proc )
1025
1107
" Return the form to query the Inf-Clojure PROC for a var's apropos.
1026
1108
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
1029
1111
(pcase (inf-clojure--set-repl-type proc)
1030
1112
(`lumo inf-clojure-apropos-form-lumo)
1031
1113
(`planck inf-clojure-apropos-form-planck)
1114
+ (`joker inf-clojure-apropos-form-joker)
1032
1115
(_ inf-clojure-apropos-form))))
1033
1116
1034
1117
(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
1054
1137
:safe #'stringp
1055
1138
:package-version '(inf-clojure . " 2.2.0" ))
1056
1139
1140
+ (defcustom inf-clojure-macroexpand-form-joker
1141
+ " (macroexpand '%s)"
1142
+ " Joker form to invoke macroexpand."
1143
+ :type 'string
1144
+ :safe #'stringp
1145
+ :package-version '(inf-clojure . " 2.2.0" ))
1146
+
1057
1147
(defun inf-clojure-macroexpand-form (proc )
1058
1148
" Return the form for macroexpansion in the Inf-Clojure PROC.
1059
1149
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
1062
1152
(pcase (inf-clojure--set-repl-type proc)
1063
1153
(`lumo inf-clojure-macroexpand-form-lumo)
1064
1154
(`planck inf-clojure-macroexpand-form-planck)
1155
+ (`joker inf-clojure-macroexpand-form-joker)
1065
1156
(_ inf-clojure-macroexpand-form))))
1066
1157
1067
1158
(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
1087
1178
:safe #'stringp
1088
1179
:package-version '(inf-clojure . " 2.2.0" ))
1089
1180
1181
+ (defcustom inf-clojure-macroexpand-1-form-joker
1182
+ " (macroexpand-1 '%s)"
1183
+ " Joker form to invoke macroexpand-1."
1184
+ :type 'string
1185
+ :safe #'stringp
1186
+ :package-version '(inf-clojure . " 2.2.0" ))
1187
+
1090
1188
(defun inf-clojure-macroexpand-1-form (proc )
1091
1189
" Return the form for macroexpand-1 in the Inf-Clojure PROC.
1092
1190
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
1095
1193
(pcase (inf-clojure--set-repl-type proc)
1096
1194
(`lumo inf-clojure-macroexpand-1-form-lumo)
1097
1195
(`planck inf-clojure-macroexpand-1-form-planck)
1196
+ (`joker inf-clojure-macroexpand-1-form-joker)
1098
1197
(_ inf-clojure-macroexpand-1-form))))
1099
1198
1100
1199
(define-obsolete-variable-alias 'inf-clojure-macroexpand-1-command 'inf-clojure-macroexpand-1-form " 2.0.0" )
0 commit comments