@@ -678,39 +678,39 @@ The supplied string will be wrapped in a do form if needed."
678
678
(format " (do %s ) " form))))
679
679
680
680
(defvar cider-cljs-repl-types
681
- '((" Nashorn " " (cemerick.piggieback/cljs-repl (cljs.repl.nashorn/repl-env))"
681
+ '((nashorn " (cemerick.piggieback/cljs-repl (cljs.repl.nashorn/repl-env))"
682
682
cider-check-nashorn-requirements)
683
- (" Figwheel " " (do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))"
683
+ (figwheel " (do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))"
684
684
cider-check-figwheel-requirements)
685
- (" Node " " (do (require 'cljs.repl.node) (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)))"
685
+ (node " (do (require 'cljs.repl.node) (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)))"
686
686
cider-check-node-requirements)
687
- (" Weasel " " (do (require 'weasel.repl.websocket) (cemerick.piggieback/cljs-repl (weasel.repl.websocket/repl-env :ip \" 127.0.0.1\" :port 9001)))"
687
+ (weasel " (do (require 'weasel.repl.websocket) (cemerick.piggieback/cljs-repl (weasel.repl.websocket/repl-env :ip \" 127.0.0.1\" :port 9001)))"
688
688
cider-check-weasel-requirements)
689
- (" Boot " " (do (require 'adzerk.boot-cljs-repl) (adzerk.boot-cljs-repl/start-repl))"
689
+ (boot " (do (require 'adzerk.boot-cljs-repl) (adzerk.boot-cljs-repl/start-repl))"
690
690
cider-check-boot-requirements)
691
- (" Shadow " cider-shadow-cljs-init-form cider-check-shadow-cljs-requirements)
692
- (" Custom " cider-custom-cljs-repl-init-form nil ))
691
+ (shadow cider-shadow-cljs-init-form cider-check-shadow-cljs-requirements)
692
+ (custom cider-custom-cljs-repl-init-form nil ))
693
693
" A list of supported ClojureScript REPLs.
694
694
695
695
For each one we have its name, the form we need to evaluate in a Clojure
696
696
REPL to start the ClojureScript REPL and functions to very their requirements.
697
697
698
698
The form should be either a string or a function producing a string." )
699
699
700
- (defun cider-register-cljs-repl-type (name init-form &optional requirements-fn )
700
+ (defun cider-register-cljs-repl-type (type init-form &optional requirements-fn )
701
701
" Register a new ClojureScript REPL type.
702
702
703
703
Types are defined by the following:
704
704
705
- - NAME - string identifier that will be used to refer to the REPL typel
705
+ - TYPE - symbol identifier that will be used to refer to the REPL type
706
706
- INIT-FORM - string or function (symbol) producing string
707
707
- REQUIREMENTS-FN - function to check whether the REPL can be started.
708
708
This param is optional.
709
709
710
710
All this function does is modifying `cider-cljs-repl-types' .
711
711
It's intended to be used in your Emacs config."
712
- (unless (stringp name )
713
- (user-error " The REPL name must be a string " ))
712
+ (unless (symbolp type )
713
+ (user-error " The REPL type must be a symbol " ))
714
714
(unless (or (stringp init-form) (symbolp init-form))
715
715
(user-error " The init form must be a string or a symbol referring to a function" ))
716
716
(unless (or (null requirements-fn) (symbolp requirements-fn))
@@ -724,15 +724,15 @@ This affects commands like `cider-jack-in-clojurescript'. Generally it's
724
724
intended to be set via .dir-locals.el for individual projects, as its
725
725
relatively unlikely you'd like to use the same type of REPL in each project
726
726
you're working on."
727
- :type '(choice (const " Nashorn" )
728
- (const " Figwheel" )
729
- (const " Node" )
730
- (const " Weasel" )
731
- (const " Boot" )
732
- (const " Shadow" )
733
- (const " Custom" ))
727
+ :type '(choice (const :tag " Nashorn" nashorn )
728
+ (const :tag " Figwheel" figwheel )
729
+ (const :tag " Node" node )
730
+ (const :tag " Weasel" weasel )
731
+ (const :tag " Boot" boot )
732
+ (const :tag " Shadow" shadow )
733
+ (const :tag " Custom" custom ))
734
734
:group 'cider
735
- :safe #'stringp
735
+ :safe #'symbolp
736
736
:package-version '(cider . " 0.17.0" ))
737
737
738
738
(make-obsolete-variable 'cider-cljs-lein-repl 'cider-default-cljs-repl " 0.17" )
@@ -742,13 +742,13 @@ you're working on."
742
742
(defun cider-select-cljs-repl ()
743
743
" Select the ClojureScript REPL to use with `cider-jack-in-clojurescript' ."
744
744
(let ((repl-types (mapcar #'car cider-cljs-repl-types)))
745
- (completing-read " Select ClojureScript REPL type: " repl-types)))
745
+ (intern ( completing-read " Select ClojureScript REPL type: " repl-types) )))
746
746
747
747
(defun cider-cljs-repl-form (repl-type )
748
748
" Get the cljs REPL form for REPL-TYPE."
749
749
(let ((repl-form (cadr (seq-find
750
750
(lambda (entry )
751
- (equal (car entry) repl-type))
751
+ (eq (car entry) repl-type))
752
752
cider-cljs-repl-types))))
753
753
; ; repl-form can be either a string or a function producing a string
754
754
(if (symbolp repl-form)
@@ -759,7 +759,7 @@ you're working on."
759
759
" Verify that the requirements for REPL-TYPE are met."
760
760
(when-let* ((fun (nth 2 (seq-find
761
761
(lambda (entry )
762
- (equal (car entry) repl-type))
762
+ (eq (car entry) repl-type))
763
763
cider-cljs-repl-types))))
764
764
(funcall fun)))
765
765
0 commit comments