Skip to content

Commit 632c5d7

Browse files
committed
Add flavor support for inf-clojure-var-doc-command
1 parent a31848e commit 632c5d7

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
@@ -547,6 +547,19 @@ The prefix argument SWITCH-TO-REPL controls whether to switch to REPL after the
547547
"Command to query inferior Clojure for a var's documentation."
548548
:type 'string)
549549

550+
(defcustom inf-clojure-var-doc-command-lumo
551+
"(lumo.repl/doc %s)\n"
552+
"Lumo command to query inferior Clojure for a var's documentation."
553+
:type 'string)
554+
555+
(defun inf-clojure-var-doc-form ()
556+
"Return the form to query inferior Clojure for a var's documentation.
557+
If you are using flavors, it will pickup the most approapriate
558+
`inf-clojure-var-doc-command` variant."
559+
(pcase inf-clojure-repl-flavor
560+
(lumo inf-clojure-var-doc-command-lumo)
561+
(_ inf-clojure-var-doc-command)))
562+
550563
(defcustom inf-clojure-var-source-command
551564
"(clojure.repl/source %s)\n"
552565
"Command to query inferior Clojure for a var's source."
@@ -639,9 +652,9 @@ The value is nil if it can't find one."
639652

640653
(defun inf-clojure-show-var-documentation (var)
641654
"Send a command to the inferior Clojure to give documentation for VAR.
642-
See variable `inf-clojure-var-doc-command'."
655+
See function `inf-clojure-var-doc-form'."
643656
(interactive (inf-clojure-symprompt "Var doc" (inf-clojure-var-at-pt)))
644-
(comint-proc-query (inf-clojure-proc) (format inf-clojure-var-doc-command var)))
657+
(comint-proc-query (inf-clojure-proc) (format (inf-clojure-var-doc-form) var)))
645658

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

0 commit comments

Comments
 (0)