-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show progress when evaluating files using cider-load-all-files
#3714
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1839,9 +1839,15 @@ all ns aliases and var mappings from the namespace before reloading it." | |
Useful when the running nREPL on remote host. | ||
When UNDEF-ALL is non-nil or called with \\[universal-argument], removes | ||
all ns aliases and var mappings from the namespaces being reloaded" | ||
(interactive "DLoad files beneath directory: \nP") | ||
(mapcar (lambda (file) (cider-load-file file undef-all)) | ||
(directory-files-recursively directory "\\.clj[cs]?$"))) | ||
(interactive "DRecursively load files in directory: \nP") | ||
(let* ((files (directory-files-recursively directory "\\.clj[cs]?$")) | ||
(reporter (make-progress-reporter "Loading files" 0 (length files)))) | ||
(seq-do-indexed (lambda (file idx) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have probably used a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, it's a chore to manually manipulate the counter, and I couldn't pass up such a sweet function! |
||
(let ((inhibit-message t)) | ||
(cider-load-file file undef-all)) | ||
(progress-reporter-update reporter (1+ idx) file)) | ||
files) | ||
(progress-reporter-done reporter))) | ||
|
||
(defalias 'cider-eval-file #'cider-load-file | ||
"A convenience alias as some people are confused by the load-* names.") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should mention the directory name in the message as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, in every reporter message, there is already a name for the loaded file (the
file
argument of(progress-reporter-update reporter (1+ idx) file)
), so I think there is no need to change anything.