Skip to content

Commit 3ab2709

Browse files
authored
[Fix #3615] Show progress when evaluating files using cider-load-all-files (#3714)
Show progress in echo area while recursively evaluating files in directory using cider-load-all-files. As I've noticed that messages from evaluations keep popping up, so it's very hard to see progress message, I've used inhibit-message around cider-load-file. One possible downside of this is that error messages are not displayed as well (though it will be really hard to notice some error message while messages pop up one after the other). Also, I've tweaked the prompt of cider-load-all-files because it might not be clear how files are loaded as the word "beneath" is ambiguous (it may mean one level of depth which is not the case).
1 parent f5928eb commit 3ab2709

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
### Changes
88

9+
- [#3714](https://github.com/clojure-emacs/cider/pull/3714): Show progress when evaluating files using `cider-load-all-files`.
10+
911
### Bugs fixed
1012

1113
## 1.15.0 (2024-06-10)

cider-eval.el

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,9 +1839,15 @@ all ns aliases and var mappings from the namespace before reloading it."
18391839
Useful when the running nREPL on remote host.
18401840
When UNDEF-ALL is non-nil or called with \\[universal-argument], removes
18411841
all ns aliases and var mappings from the namespaces being reloaded"
1842-
(interactive "DLoad files beneath directory: \nP")
1843-
(mapcar (lambda (file) (cider-load-file file undef-all))
1844-
(directory-files-recursively directory "\\.clj[cs]?$")))
1842+
(interactive "DRecursively load files in directory: \nP")
1843+
(let* ((files (directory-files-recursively directory "\\.clj[cs]?$"))
1844+
(reporter (make-progress-reporter "Loading files" 0 (length files))))
1845+
(seq-do-indexed (lambda (file idx)
1846+
(let ((inhibit-message t))
1847+
(cider-load-file file undef-all))
1848+
(progress-reporter-update reporter (1+ idx) file))
1849+
files)
1850+
(progress-reporter-done reporter)))
18451851

18461852
(defalias 'cider-eval-file #'cider-load-file
18471853
"A convenience alias as some people are confused by the load-* names.")

0 commit comments

Comments
 (0)