@@ -596,7 +596,7 @@ If you are using REPL types, it will pickup the most approapriate
596596
597597(define-obsolete-variable-alias 'inf-clojure-var-source-command 'inf-clojure-var-source-form " 2.0.0" )
598598
599- (defcustom inf-clojure-arglist -form
599+ (defcustom inf-clojure-arglists -form
600600 " (try
601601 (:arglists
602602 (clojure.core/meta
@@ -607,7 +607,21 @@ If you are using REPL types, it will pickup the most approapriate
607607 :type 'string
608608 :package-version '(inf-clojure . " 2.0.0" ))
609609
610- (define-obsolete-variable-alias 'inf-clojure-arglist-command 'inf-clojure-arglist-form " 2.0.0" )
610+ (define-obsolete-variable-alias 'inf-clojure-arglist-command 'inf-clojure-arglists-form " 2.0.0" )
611+
612+ (defcustom inf-clojure-arglists-form-lumo
613+ " (lumo.repl/get-arglists \" %s\" )"
614+ " Lumo form to query inferior Clojure for a function's arglist."
615+ :type 'string
616+ :package-version '(inf-clojure . " 2.0.0" ))
617+
618+ (defun inf-clojure-arglists-form ()
619+ " Return the form to query inferior Clojure for arglists of a var.
620+ If you are using REPL types, it will pickup the most approapriate
621+ `inf-clojure-arglist-form` variant."
622+ (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
623+ (`lumo inf-clojure-arglists-form-lumo)
624+ (_ inf-clojure-arglists-form)))
611625
612626(defcustom inf-clojure-completion-form
613627 " (complete.core/completions \" %s\" )\n "
@@ -725,6 +739,16 @@ prefix argument PROMPT-FOR-SYMBOL, it prompts for a symbol name."
725739 (inf-clojure-symbol-at-point))))
726740 (comint-proc-query (inf-clojure-proc) (format inf-clojure-var-source-form var))))
727741
742+ (defun inf-clojure-match-arglists (input-form string )
743+ " Return the arglists match from INPUT-FORM and STRING.
744+ The output depends on the correct REPL type. We assume the
745+ `inf-clojure-repl-type` var is already set, therefore this is
746+ safe to call only from inside `inf-clojure-arglist`."
747+ (pcase inf-clojure-repl-type
748+ (`lumo (let ((input-end (and (string-match input-form string) (match-end 0 ))))
749+ (and (string-match " (.+)" string input-end) (match-string 0 string))))
750+ (_ (and (string-match " (.+)" string) (match-string 0 string)))))
751+
728752(defun inf-clojure-arglist (fn )
729753 " Send a query to the inferior Clojure for the arglist for function FN.
730754See variable `inf-clojure-arglist-form' ."
@@ -734,11 +758,11 @@ See variable `inf-clojure-arglist-form'."
734758 eldoc)
735759 (set-process-filter proc (lambda (_proc string ) (setq kept (concat kept string))))
736760 (unwind-protect
737- (let ((eldoc-snippet (format inf-clojure-arglist -form fn)))
738- (process -send-string proc eldoc-snippet)
761+ (let ((eldoc-snippet (format ( inf-clojure-arglists -form) fn)))
762+ (inf-clojure- -send-string proc eldoc-snippet)
739763 (while (and (not (string-match inf-clojure-prompt kept))
740764 (accept-process-output proc 2 )))
741- (setq eldoc (and ( string- match " (.+) " kept) ( match-string 0 kept) )))
765+ (setq eldoc (inf-clojure- match-arglists eldoc-snippet kept)))
742766 (set-process-filter proc comint-filt))
743767 eldoc))
744768
0 commit comments