Skip to content

Commit 2e1a69e

Browse files
committed
Adopt find-ns for repl type detection
1 parent b39bfb4 commit 2e1a69e

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

inf-clojure.el

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ See http://blog.jorgenschaefer.de/2014/05/race-conditions-in-emacs-process-filte
227227
(when (not inf-clojure--repl-type-lock)
228228
(let ((inf-clojure--repl-type-lock t))
229229
(cond
230-
((inf-clojure--lumo-p proc) 'lumo)
231-
((inf-clojure--planck-p proc) 'planck)
230+
((inf-clojure--non-nil-response-p proc inf-clojure--lumo-repl-form) 'lumo)
231+
((inf-clojure--non-nil-response-p proc inf-clojure--planck-repl-form) 'planck)
232232
(t 'clojure)))))
233233

234234
(defun inf-clojure--set-repl-type (proc)
@@ -726,7 +726,10 @@ If you are using REPL types, it will pickup the most approapriate
726726
(define-obsolete-variable-alias 'inf-clojure-completion-command 'inf-clojure-completion-form "2.0.0")
727727

728728
(defcustom inf-clojure-completion-form-lumo
729-
"(doall (map str (lumo.repl/get-completions \"%s\")))"
729+
"(let [ret (atom)]
730+
(lumo.repl/get-completions \"%s\"
731+
(fn [res] (reset! ret (map str res))))
732+
@ret)"
730733
"Lumo form to query inferior Clojure for completion candidates."
731734
:type 'string
732735
:package-version '(inf-clojure . "2.0.0"))
@@ -1248,7 +1251,7 @@ to suppress the usage of the target buffer discovery logic."
12481251
;;;; ====
12491252

12501253
(defcustom inf-clojure--lumo-repl-form
1251-
"(js/global.hasOwnProperty \"$$LUMO_GLOBALS\")"
1254+
"(find-ns 'lumo.repl)"
12521255
"Form to invoke in order to verify that we launched a Lumo REPL."
12531256
:type 'string
12541257
:package-version '(inf-clojure . "2.0.0"))
@@ -1257,18 +1260,11 @@ to suppress the usage of the target buffer discovery logic."
12571260
;;;; ====
12581261

12591262
(defcustom inf-clojure--planck-repl-form
1260-
"(js/global.hasOwnProperty \"PLANCK_VERSION\")"
1263+
"(find-ns 'planck.repl)"
12611264
"Form to invoke in order to verify that we launched a Planck REPL."
12621265
:type 'string
12631266
:package-version '(inf-clojure . "2.0.0"))
12641267

1265-
(defalias 'inf-clojure--planck-p
1266-
(apply-partially 'inf-clojure--response-match-p
1267-
inf-clojure--planck-repl-form
1268-
(lambda (string)
1269-
(string-match-p "\\Ca*true\\Ca*" string)))
1270-
"Ascertain that PROC is a Planck REPL.")
1271-
12721268
(provide 'inf-clojure)
12731269

12741270
;; Local variables:

0 commit comments

Comments
 (0)