Skip to content

Commit 89e4f4c

Browse files
author
Bozhidar Batsov
committed
Require everything in clojure.main/repl-requires on startup
1 parent e1d4d26 commit 89e4f4c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ are used to translate filenames from/to the nREPL server (default Cygwin impleme
2525
* New interactive command `cider-close-nrepl-session`.
2626
* New interactive command `cider-describe-nrepl-session`.
2727
* New interactive command `cider-toggle-trace-ns` (mapped to <kbd>C-c M-t n</kbd>)
28+
* New interactive command `cider-repl-require-repl-utils`.
2829

2930
### Changes
3031

cider-repl.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,19 @@ PROJECT-DIR, PORT and HOST are as in `nrepl-make-buffer-name'."
174174
(cider-repl-reset-markers))
175175
buf))
176176

177+
(defun cider-repl-require-repl-utils ()
178+
"Require standard REPL util functions into the current REPL."
179+
(interactive)
180+
(cider-eval
181+
"(when (clojure.core/resolve 'clojure.main/repl-requires)
182+
(clojure.core/map clojure.core/require clojure.main/repl-requires))"
183+
(lambda (response) nil)))
184+
177185
(defun cider-repl-init (buffer &optional no-banner)
178186
"Initialize the REPL in BUFFER.
179187
BUFFER must be a REPL buffer with `cider-repl-mode' and a running
180188
client process connection. Unless NO-BANNER is non-nil, insert a banner."
189+
(cider-repl-require-repl-utils)
181190
(unless no-banner
182191
(cider-repl--insert-banner-and-prompt buffer))
183192
(when cider-repl-display-in-current-window

0 commit comments

Comments
 (0)