summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--cider-interaction.el9
-rw-r--r--cider-mode.el2
-rw-r--r--doc/cider-refcard.tex1
-rw-r--r--doc/interactive_programming.md1
5 files changed, 14 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 68fcc216..30169e44 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
### New Features
+* Add new function `cider-load-all-files`, along with menu bar update.
* Add new customization variable `cider-special-mode-truncate-lines`.
* Add an option `cider-inspector-fill-frame` to control whether the cider inspector window fills its frame.
* [#1893](https://github.com/clojure-emacs/cider/issues/1893): Add negative prefix argument to `cider-refresh` to inhibit invoking of cider-refresh-functions
diff --git a/cider-interaction.el b/cider-interaction.el
index c0d965da..5a7e760a 100644
--- a/cider-interaction.el
+++ b/cider-interaction.el
@@ -1622,9 +1622,18 @@ The heavy lifting is done by `cider-load-buffer'."
(find-file filename)
(cider-load-buffer (current-buffer))))
+(defun cider-load-all-files (directory)
+ "Load all files in DIRECTORY (recursively). Useful when the running nREPL on remote host."
+ (interactive "DLoad files beneath directory: ")
+ (mapcar #'cider-load-file
+ (directory-files-recursively directory ".clj$")))
+
(defalias 'cider-eval-file 'cider-load-file
"A convenience alias as some people are confused by the load-* names.")
+(defalias 'cider-eval-all-files 'cider-load-all-files
+ "A convenience alias as some people are confused by the load-* names.")
+
(defalias 'cider-eval-buffer 'cider-load-buffer
"A convenience alias as some people are confused by the load-* names.")
diff --git a/cider-mode.el b/cider-mode.el
index af4b8723..d7c3d930 100644
--- a/cider-mode.el
+++ b/cider-mode.el
@@ -235,6 +235,7 @@ Configure `cider-cljs-*-repl' to change the ClojureScript REPL to use for your b
"--"
["Load this buffer" cider-load-buffer]
["Load another file" cider-load-file]
+ ["Recursively load all files in directory" cider-load-all-files]
["Load all project files" cider-load-all-project-ns]
["Refresh loaded code" cider-refresh]
["Run project (-main function)" cider-run])
@@ -314,6 +315,7 @@ Configure `cider-cljs-*-repl' to change the ClojureScript REPL to use for your b
(define-key map (kbd "C-c C-o") #'cider-find-and-clear-repl-output)
(define-key map (kbd "C-c C-k") #'cider-load-buffer)
(define-key map (kbd "C-c C-l") #'cider-load-file)
+ (define-key map (kbd "C-c C-M-l") #'cider-load-all-files)
(define-key map (kbd "C-c C-b") #'cider-interrupt)
(define-key map (kbd "C-c ,") 'cider-test-commands-map)
(define-key map (kbd "C-c C-t") 'cider-test-commands-map)
diff --git a/doc/cider-refcard.tex b/doc/cider-refcard.tex
index cddaf5d0..7f09e249 100644
--- a/doc/cider-refcard.tex
+++ b/doc/cider-refcard.tex
@@ -79,6 +79,7 @@
\begin{keylist}[labelwidth=\widthof{\keyify{C-c RET}}]
\item[C-c C-k] cider-load-buffer
\item[C-c C-l] cider-load-file
+ \item[C-c C-M-l] cider-load-all-files
\item[C-c C-r] cider-eval-region
\item[C-c C-n] cider-eval-ns-form
\item[C-x C-e] \ns{cider-eval-last-sexp}
diff --git a/doc/interactive_programming.md b/doc/interactive_programming.md
index 8e2c4bd9..d9716e32 100644
--- a/doc/interactive_programming.md
+++ b/doc/interactive_programming.md
@@ -41,6 +41,7 @@ Here's a list of `cider-mode`'s keybindings:
`cider-find-and-clear-repl-output` |<kbd>C-c C-o</kbd> | Clear the last output in the REPL buffer. With a prefix argument it will clear the entire REPL buffer, leaving only a prompt. Useful if you're running the REPL buffer in a side by side buffer.
`cider-load-buffer` |<kbd>C-c C-k</kbd> | Load (eval) the current buffer.
`cider-load-file` |<kbd>C-c C-l</kbd> | Load (eval) a Clojure file.
+`cider-load-all-files` |<kbd>C-c C-M-l</kbd> | Load (eval) all Clojure files below a directory.
`cider-refresh` |<kbd>C-c C-x</kbd> | Reload all modified files on the classpath. If invoked with a prefix argument, reload all files on the classpath. If invoked with a double prefix argument, clear the state of the namespace tracker before reloading.
`cider-doc` |<kbd>C-c C-d d</kbd> <br/> <kbd>C-c C-d C-d</kbd> | Display doc string for the symbol at point. If invoked with a prefix argument, or no symbol is found at point, prompt for a symbol.
`cider-javadoc` |<kbd>C-c C-d j</kbd> <br/> <kbd>C-c C-d C-j</kbd> | Display JavaDoc (in your default browser) for the symbol at point. If invoked with a prefix argument, or no symbol is found at point, prompt for a symbol.