Skip to content

Commit ce0510b

Browse files
arichiardibbatsov
authored andcommitted
Split inf-clojure-load-form by repl type
1 parent 5ef6bdf commit ce0510b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

inf-clojure.el

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,22 @@ Clojure to load that file."
232232

233233
(define-obsolete-variable-alias 'inf-clojure-load-command 'inf-clojure-load-form "2.0.0")
234234

235+
(defcustom inf-clojure-load-form-lumo "(clojure.core/load-file \"%s\")"
236+
"Format-string for building a Clojure expression to load a file.
237+
This format string should use `%s' to substitute a file name and
238+
should result in a Clojure form that will be sent to the inferior
239+
Clojure to load that file."
240+
:type 'string
241+
:package-version '(inf-clojure . "2.0.0"))
242+
243+
(defun inf-clojure-load-form ()
244+
"Return the form to query inferior Clojure for a var's documentation.
245+
If you are using REPL types, it will pickup the most approapriate
246+
`inf-clojure-var-doc-form` variant."
247+
(pcase (inf-clojure--set-repl-type (inf-clojure-proc))
248+
(`lumo inf-clojure-load-form-lumo)
249+
(_ inf-clojure-load-form)))
250+
235251
(defcustom inf-clojure-prompt "^[^=> \n]+=> *"
236252
"Regexp to recognize prompts in the Inferior Clojure mode."
237253
:type 'regexp)
@@ -544,7 +560,7 @@ The prefix argument SWITCH-TO-REPL controls whether to switch to REPL after the
544560
(setq inf-clojure-prev-l/c-dir/file (cons (file-name-directory file-name)
545561
(file-name-nondirectory file-name)))
546562
(inf-clojure--send-string (inf-clojure-proc)
547-
(format inf-clojure-load-form file-name))
563+
(format (inf-clojure-load-form) file-name))
548564
(when switch-to-repl
549565
(inf-clojure-switch-to-repl t))))
550566

0 commit comments

Comments
 (0)