Skip to content

Commit 77e43a0

Browse files
committed
Add flavor support for inf-clojure-var-doc-command
1 parent 695910e commit 77e43a0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

inf-clojure.el

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,19 @@ The prefix argument SWITCH-TO-REPL controls whether to switch to REPL after the
553553
"Command to query inferior Clojure for a var's documentation."
554554
:type 'string)
555555

556+
(defcustom inf-clojure-var-doc-command-lumo
557+
"(lumo.repl/doc %s)\n"
558+
"Lumo command to query inferior Clojure for a var's documentation."
559+
:type 'string)
560+
561+
(defun inf-clojure-var-doc-form ()
562+
"Return the form to query inferior Clojure for a var's documentation.
563+
If you are using flavors, it will pickup the most approapriate
564+
`inf-clojure-var-doc-command` variant."
565+
(pcase inf-clojure-repl-flavor
566+
(lumo inf-clojure-var-doc-command-lumo)
567+
(_ inf-clojure-var-doc-command)))
568+
556569
(defcustom inf-clojure-var-source-command
557570
"(clojure.repl/source %s)\n"
558571
"Command to query inferior Clojure for a var's source."
@@ -645,9 +658,9 @@ The value is nil if it can't find one."
645658

646659
(defun inf-clojure-show-var-documentation (var)
647660
"Send a command to the inferior Clojure to give documentation for VAR.
648-
See variable `inf-clojure-var-doc-command'."
661+
See function `inf-clojure-var-doc-form'."
649662
(interactive (inf-clojure-symprompt "Var doc" (inf-clojure-var-at-pt)))
650-
(comint-proc-query (inf-clojure-proc) (format inf-clojure-var-doc-command var)))
663+
(comint-proc-query (inf-clojure-proc) (format (inf-clojure-var-doc-form) var)))
651664

652665
(defun inf-clojure-show-var-source (var)
653666
"Send a command to the inferior Clojure to give source for VAR.

0 commit comments

Comments
 (0)