Skip to content

Commit 1507faa

Browse files
arichiardibbatsov
authored andcommitted
Add dir support in Lumo
This patch adds `inf-clojure-ns-vars-form-lumo` and a function that return the correct `inf-clojure-ns-vars-form` variant given the REPL type.
1 parent b02ce23 commit 1507faa

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

inf-clojure.el

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword
133133
["Show arglist" inf-clojure-show-arglist t]
134134
["Show documentation for var" inf-clojure-show-var-documentation t]
135135
["Show source for var" inf-clojure-show-var-source t]
136-
["Show vars in ns" inf-clojure-show-ns-varst]
136+
["Show vars in ns" inf-clojure-show-ns-vars t]
137137
["Apropos" inf-clojure-apropos t]
138138
["Macroexpand" inf-clojure-macroexpand t]
139139
"--"
@@ -651,6 +651,20 @@ If you are using REPL types, it will pickup the most approapriate
651651
:type 'string
652652
:package-version '(inf-clojure . "2.0.0"))
653653

654+
(defcustom inf-clojure-ns-vars-form-lumo
655+
"(lumo.repl/dir %s)\n"
656+
"Lumo form to show the public vars in a namespace."
657+
:type 'string
658+
:package-version '(inf-clojure . "2.0.0"))
659+
660+
(defun inf-clojure-ns-vars-form ()
661+
"Return the form to query inferior Clojure for public vars in a namespace.
662+
If you are using REPL types, it will pickup the most approapriate
663+
`inf-clojure-ns-vars-form` variant."
664+
(pcase (inf-clojure--set-repl-type (inf-clojure-proc))
665+
(`lumo inf-clojure-ns-vars-form-lumo)
666+
(_ inf-clojure-ns-vars-form)))
667+
654668
(define-obsolete-variable-alias 'inf-clojure-ns-vars-command 'inf-clojure-ns-vars-form "2.0.0")
655669

656670
(defcustom inf-clojure-set-ns-form
@@ -786,7 +800,7 @@ prefix argument PROMPT-FOR-NS, it prompts for a namespace name."
786800
(let ((ns (if prompt-for-ns
787801
(car (inf-clojure-symprompt "Ns vars" (clojure-find-ns)))
788802
(clojure-find-ns))))
789-
(comint-proc-query (inf-clojure-proc) (format inf-clojure-ns-vars-form ns))))
803+
(comint-proc-query (inf-clojure-proc) (format (inf-clojure-ns-vars-form) ns))))
790804

791805
(defun inf-clojure-set-ns (prompt-for-ns)
792806
"Set the ns of the inferior Clojure process to NS.

0 commit comments

Comments
 (0)