@@ -607,21 +607,21 @@ The prefix argument SWITCH-TO-REPL controls whether to switch to REPL after the
607
607
; ;; =============
608
608
609
609
(defcustom inf-clojure-var-doc-form
610
- " (clojure.repl/doc %s)\n "
610
+ " (clojure.repl/doc %s)"
611
611
" Form to query inferior Clojure for a var's documentation."
612
612
:type 'string
613
613
:package-version '(inf-clojure . " 2.0.0" ))
614
614
615
615
(define-obsolete-variable-alias 'inf-clojure-var-doc-command 'inf-clojure-var-doc-form " 2.0.0" )
616
616
617
617
(defcustom inf-clojure-var-doc-form-lumo
618
- " (lumo.repl/doc %s)\n "
618
+ " (lumo.repl/doc %s)"
619
619
" Lumo form to query inferior Clojure for a var's documentation."
620
620
:type 'string
621
621
:package-version '(inf-clojure . " 2.0.0" ))
622
622
623
623
(defcustom inf-clojure-var-doc-form-planck
624
- " (planck.repl/doc %s)\n "
624
+ " (planck.repl/doc %s)"
625
625
" Planck form to query inferior Clojure for a var's documentation."
626
626
:type 'string
627
627
:package-version '(inf-clojure . " 2.0.0" ))
@@ -630,19 +630,20 @@ The prefix argument SWITCH-TO-REPL controls whether to switch to REPL after the
630
630
" Return the form to query inferior Clojure for a var's documentation.
631
631
If you are using REPL types, it will pickup the most approapriate
632
632
`inf-clojure-var-doc-form` variant."
633
- (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
634
- (`lumo inf-clojure-var-doc-form-lumo)
635
- (`planck inf-clojure-var-doc-form-planck)
636
- (_ inf-clojure-var-doc-form)))
633
+ (inf-clojure--sanitize-command
634
+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
635
+ (`lumo inf-clojure-var-doc-form-lumo)
636
+ (`planck inf-clojure-var-doc-form-planck)
637
+ (_ inf-clojure-var-doc-form))))
637
638
638
639
(defcustom inf-clojure-var-source-form
639
- " (clojure.repl/source %s)\n "
640
+ " (clojure.repl/source %s)"
640
641
" Form to query inferior Clojure for a var's source."
641
642
:type 'string
642
643
:package-version '(inf-clojure . " 2.0.0" ))
643
644
644
645
(defcustom inf-clojure-var-source-form-planck
645
- " (planck.repl/source %s)\n "
646
+ " (planck.repl/source %s)"
646
647
" Planck form to query inferior Clojure for a var's source."
647
648
:type 'string
648
649
:package-version '(inf-clojure . " 2.0.0" ))
@@ -651,9 +652,10 @@ If you are using REPL types, it will pickup the most approapriate
651
652
" Return the form to query inferior Clojure for a var's source.
652
653
If you are using REPL types, it will pickup the most approapriate
653
654
`inf-clojure-var-source-form` variant."
654
- (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
655
- (`planck inf-clojure-var-source-form-planck)
656
- (_ inf-clojure-var-source-form)))
655
+ (inf-clojure--sanitize-command
656
+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
657
+ (`planck inf-clojure-var-source-form-planck)
658
+ (_ inf-clojure-var-source-form))))
657
659
658
660
(define-obsolete-variable-alias 'inf-clojure-var-source-command 'inf-clojure-var-source-form " 2.0.0" )
659
661
@@ -663,7 +665,7 @@ If you are using REPL types, it will pickup the most approapriate
663
665
(clojure.core/meta
664
666
(clojure.core/resolve
665
667
(clojure.core/read-string \" %s\" ))))
666
- (catch Throwable t nil))\n "
668
+ (catch Throwable t nil))"
667
669
" Form to query inferior Clojure for a function's arglists."
668
670
:type 'string
669
671
:package-version '(inf-clojure . " 2.0.0" ))
@@ -680,26 +682,27 @@ If you are using REPL types, it will pickup the most approapriate
680
682
" Return the form to query inferior Clojure for arglists of a var.
681
683
If you are using REPL types, it will pickup the most approapriate
682
684
`inf-clojure-arglists-form` variant."
683
- (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
684
- (`lumo inf-clojure-arglists-form-lumo)
685
- (_ inf-clojure-arglists-form)))
685
+ (inf-clojure--sanitize-command
686
+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
687
+ (`lumo inf-clojure-arglists-form-lumo)
688
+ (_ inf-clojure-arglists-form))))
686
689
687
690
(defcustom inf-clojure-completion-form
688
- " (complete.core/completions \" %s\" )\n "
691
+ " (complete.core/completions \" %s\" )"
689
692
" Form to query inferior Clojure for completion candidates."
690
693
:type 'string
691
694
:package-version '(inf-clojure . " 2.0.0" ))
692
695
693
696
(define-obsolete-variable-alias 'inf-clojure-completion-command 'inf-clojure-completion-form " 2.0.0" )
694
697
695
698
(defcustom inf-clojure-completion-form-lumo
696
- " (doall (map str (lumo.repl/get-completions \" %s\" )))\n "
699
+ " (doall (map str (lumo.repl/get-completions \" %s\" )))"
697
700
" Lumo form to query inferior Clojure for completion candidates."
698
701
:type 'string
699
702
:package-version '(inf-clojure . " 2.0.0" ))
700
703
701
704
(defcustom inf-clojure-completion-form-planck
702
- " (planck.repl/get-completions \" %s\" )\n "
705
+ " (planck.repl/get-completions \" %s\" )"
703
706
" Planck form to query inferior Clojure for completion candidates."
704
707
:type 'string
705
708
:package-version '(inf-clojure . " 2.0.0" ))
@@ -708,25 +711,26 @@ If you are using REPL types, it will pickup the most approapriate
708
711
" Return the form to query inferior Clojure for a var's documentation.
709
712
If you are using REPL types, it will pickup the most approapriate
710
713
`inf-clojure-completion-form` variant."
711
- (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
712
- (`lumo inf-clojure-completion-form-lumo)
713
- (`planck inf-clojure-completion-form-planck)
714
- (_ inf-clojure-completion-form)))
714
+ (inf-clojure--sanitize-command
715
+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
716
+ (`lumo inf-clojure-completion-form-lumo)
717
+ (`planck inf-clojure-completion-form-planck)
718
+ (_ inf-clojure-completion-form))))
715
719
716
720
(defcustom inf-clojure-ns-vars-form
717
- " (clojure.repl/dir %s)\n "
721
+ " (clojure.repl/dir %s)"
718
722
" Form to show the public vars in a namespace."
719
723
:type 'string
720
724
:package-version '(inf-clojure . " 2.0.0" ))
721
725
722
726
(defcustom inf-clojure-ns-vars-form-lumo
723
- " (lumo.repl/dir %s)\n "
727
+ " (lumo.repl/dir %s)"
724
728
" Lumo form to show the public vars in a namespace."
725
729
:type 'string
726
730
:package-version '(inf-clojure . " 2.0.0" ))
727
731
728
732
(defcustom inf-clojure-ns-vars-form-planck
729
- " (planck.repl/dir %s)\n "
733
+ " (planck.repl/dir %s)"
730
734
" Planck form to show the public vars in a namespace."
731
735
:type 'string
732
736
:package-version '(inf-clojure . " 2.0.0" ))
@@ -735,21 +739,22 @@ If you are using REPL types, it will pickup the most approapriate
735
739
" Return the form to query inferior Clojure for public vars in a namespace.
736
740
If you are using REPL types, it will pickup the most approapriate
737
741
`inf-clojure-ns-vars-form` variant."
738
- (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
739
- (`lumo inf-clojure-ns-vars-form-lumo)
740
- (`planck inf-clojure-ns-vars-form-planck)
741
- (_ inf-clojure-ns-vars-form)))
742
+ (inf-clojure--sanitize-command
743
+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
744
+ (`lumo inf-clojure-ns-vars-form-lumo)
745
+ (`planck inf-clojure-ns-vars-form-planck)
746
+ (_ inf-clojure-ns-vars-form))))
742
747
743
748
(define-obsolete-variable-alias 'inf-clojure-ns-vars-command 'inf-clojure-ns-vars-form " 2.0.0" )
744
749
745
750
(defcustom inf-clojure-set-ns-form
746
- " (clojure.core/in-ns '%s)\n "
751
+ " (clojure.core/in-ns '%s)"
747
752
" Form to set the namespace of the inferior Clojure process."
748
753
:type 'string
749
754
:package-version '(inf-clojure . " 2.0.0" ))
750
755
751
756
(defcustom inf-clojure-set-ns-form-planck
752
- " (in-ns '%s)\n "
757
+ " (in-ns '%s)"
753
758
" Planck form to set the namespace of the inferior Clojure process."
754
759
:type 'string
755
760
:package-version '(inf-clojure . " 2.0.0" ))
@@ -758,22 +763,23 @@ If you are using REPL types, it will pickup the most approapriate
758
763
" Return the form to set the ns of the inferior Clojure process.
759
764
If you are using REPL types, it will pickup the most approapriate
760
765
`inf-clojure-set-ns-form` variant."
761
- (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
762
- (`planck inf-clojure-set-ns-form-planck)
763
- (_ inf-clojure-set-ns-form)))
766
+ (inf-clojure--sanitize-command
767
+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
768
+ (`planck inf-clojure-set-ns-form-planck)
769
+ (_ inf-clojure-set-ns-form))))
764
770
765
771
(define-obsolete-variable-alias 'inf-clojure-set-ns-command 'inf-clojure-set-ns-form " 2.0.0" )
766
772
767
773
(defcustom inf-clojure-apropos-form
768
774
" (doseq [var (sort (clojure.repl/apropos \" %s\" ))]
769
- (println (str var)))\n "
775
+ (println (str var)))"
770
776
" Form to invoke apropos."
771
777
:type 'string
772
778
:package-version '(inf-clojure . " 2.0.0" ))
773
779
774
780
(defcustom inf-clojure-apropos-form-planck
775
781
" (doseq [var (sort (planck.repl/apropos \" %s\" ))]
776
- (println (str var)))\n "
782
+ (println (str var)))"
777
783
" Planck form to invoke apropos."
778
784
:type 'string
779
785
:package-version '(inf-clojure . " 2.0.0" ))
@@ -782,20 +788,21 @@ If you are using REPL types, it will pickup the most approapriate
782
788
" Return the form to query inferior Clojure for public vars in a namespace.
783
789
If you are using REPL types, it will pickup the most approapriate
784
790
`inf-clojure-ns-vars-form` variant."
785
- (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
786
- (`planck inf-clojure-apropos-form-planck)
787
- (_ inf-clojure-apropos-form)))
791
+ (inf-clojure--sanitize-command
792
+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
793
+ (`planck inf-clojure-apropos-form-planck)
794
+ (_ inf-clojure-apropos-form))))
788
795
789
796
(define-obsolete-variable-alias 'inf-clojure-apropos-command 'inf-clojure-apropos-form " 2.0.0" )
790
797
791
798
(defcustom inf-clojure-macroexpand-form
792
- " (clojure.core/macroexpand '%s)\n "
799
+ " (clojure.core/macroexpand '%s)"
793
800
" Form to invoke macroexpand."
794
801
:type 'string
795
802
:package-version '(inf-clojure . " 2.0.0" ))
796
803
797
804
(defcustom inf-clojure-macroexpand-form-planck
798
- " (macroexpand '%s)\n "
805
+ " (macroexpand '%s)"
799
806
" Planck form to invoke macroexpand."
800
807
:type 'string
801
808
:package-version '(inf-clojure . " 2.0.0" ))
@@ -804,20 +811,21 @@ If you are using REPL types, it will pickup the most approapriate
804
811
" Return the form for macroexpansion in the inferior Clojure process.
805
812
If you are using REPL types, it will pickup the most approapriate
806
813
`inf-clojure-macroexpand-form` variant."
807
- (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
808
- (`planck inf-clojure-macroexpand-form-planck)
809
- (_ inf-clojure-macroexpand-form)))
814
+ (inf-clojure--sanitize-command
815
+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
816
+ (`planck inf-clojure-macroexpand-form-planck)
817
+ (_ inf-clojure-macroexpand-form))))
810
818
811
819
(define-obsolete-variable-alias 'inf-clojure-macroexpand-command 'inf-clojure-macroexpand-form " 2.0.0" )
812
820
813
821
(defcustom inf-clojure-macroexpand-1-form
814
- " (clojure.core/macroexpand-1 '%s)\n "
822
+ " (clojure.core/macroexpand-1 '%s)"
815
823
" Form to invoke macroexpand-1."
816
824
:type 'string
817
825
:package-version '(inf-clojure . " 2.0.0" ))
818
826
819
827
(defcustom inf-clojure-macroexpand-1-form-planck
820
- " (macroexpand-1 '%s)\n "
828
+ " (macroexpand-1 '%s)"
821
829
" Planck form to invoke macroexpand-1."
822
830
:type 'string
823
831
:package-version '(inf-clojure . " 2.0.0" ))
@@ -826,9 +834,10 @@ If you are using REPL types, it will pickup the most approapriate
826
834
" Return the form for macroexpand-1 in the inferior Clojure process.
827
835
If you are using REPL types, it will pickup the most approapriate
828
836
`inf-clojure-macroexpand-1-form` variant."
829
- (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
830
- (`planck inf-clojure-macroexpand-1-form-planck)
831
- (_ inf-clojure-macroexpand-1-form)))
837
+ (inf-clojure--sanitize-command
838
+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
839
+ (`planck inf-clojure-macroexpand-1-form-planck)
840
+ (_ inf-clojure-macroexpand-1-form))))
832
841
833
842
(define-obsolete-variable-alias 'inf-clojure-macroexpand-1-command 'inf-clojure-macroexpand-1-form " 2.0.0" )
834
843
@@ -885,16 +894,6 @@ prefix argument PROMPT-FOR-SYMBOL, it prompts for a symbol name."
885
894
(inf-clojure-symbol-at-point))))
886
895
(comint-proc-query (inf-clojure-proc) (format (inf-clojure-var-source-form) var))))
887
896
888
- (defun inf-clojure-match-arglists (input-form string )
889
- " Return the arglists match from INPUT-FORM and STRING.
890
- The output depends on the correct REPL type. We assume the
891
- `inf-clojure-repl-type` var is already set, therefore this is
892
- safe to call only from inside `inf-clojure-arglists`."
893
- (pcase inf-clojure-repl-type
894
- (`lumo (let ((input-end (and (string-match input-form string) (match-end 0 ))))
895
- (and (string-match " (.+)" string input-end) (match-string 0 string))))
896
- (_ (and (string-match " (.+)" string) (match-string 0 string)))))
897
-
898
897
; ; Originally from:
899
898
; ; https://github.com/glycerine/lush2/blob/master/lush2/etc/lush.el#L287
900
899
(defun inf-clojure-results-from-process (process command &optional beg-string end-string )
0 commit comments