Skip to content

Commit 86d0b60

Browse files
arichiardibbatsov
authored andcommitted
Adopt find-ns for detecting the repl type
1 parent 37b30be commit 86d0b60

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

inf-clojure.el

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ See http://blog.jorgenschaefer.de/2014/05/race-conditions-in-emacs-process-filte
228228
(when (not inf-clojure--repl-type-lock)
229229
(let ((inf-clojure--repl-type-lock t))
230230
(cond
231-
((inf-clojure--lumo-p proc) 'lumo)
232-
((inf-clojure--planck-p proc) 'planck)
231+
((inf-clojure--some-response-p proc inf-clojure--lumo-repl-form) 'lumo)
232+
((inf-clojure--some-response-p proc inf-clojure--planck-repl-form) 'planck)
233233
(t 'clojure)))))
234234

235235
(defun inf-clojure--set-repl-type (proc)
@@ -1307,35 +1307,20 @@ for evaluation, therefore FORM should not include it."
13071307
;;;; ====
13081308

13091309
(defcustom inf-clojure--lumo-repl-form
1310-
"(js/global.hasOwnProperty \"$$LUMO_GLOBALS\")"
1310+
"(find-ns 'lumo.repl)"
13111311
"Form to invoke in order to verify that we launched a Lumo REPL."
13121312
:type 'string
13131313
:package-version '(inf-clojure . "2.0.0"))
13141314

1315-
(defalias 'inf-clojure--lumo-p
1316-
(apply-partially 'inf-clojure--response-match-p
1317-
inf-clojure--lumo-repl-form
1318-
(lambda (string)
1319-
(string-match-p "\\Ca*true\\Ca*" string)))
1320-
"Ascertain that PROC is a Lumo REPL.")
1321-
1322-
13231315
;;;; Planck
13241316
;;;; ====
13251317

13261318
(defcustom inf-clojure--planck-repl-form
1327-
"(js/global.hasOwnProperty \"PLANCK_VERSION\")"
1319+
"(find-ns 'planck.repl)"
13281320
"Form to invoke in order to verify that we launched a Planck REPL."
13291321
:type 'string
13301322
:package-version '(inf-clojure . "2.0.0"))
13311323

1332-
(defalias 'inf-clojure--planck-p
1333-
(apply-partially 'inf-clojure--response-match-p
1334-
inf-clojure--planck-repl-form
1335-
(lambda (string)
1336-
(string-match-p "\\Ca*true\\Ca*" string)))
1337-
"Ascertain that PROC is a Planck REPL.")
1338-
13391324
(provide 'inf-clojure)
13401325

13411326
;; Local variables:

0 commit comments

Comments
 (0)