cider
cider copied to clipboard
Add a visual progress for when evaluating a directory recursively
Recently, since I'm working with a big clj project, I periodically use cider-eval-all-files, and it works fine. The only problem is that I always underestimate the time it takes to compile all the files in a directory, and endup evaluating another directory while the first one is still in progress.
That's what I try to solve with this PR. By adding a visual progress, it becomes easier to know if its OK to continue evaluating other modules of my code that depends on the thing that's currently being done.
BTW, I ran eldev lint, and some errors showed up, but none of them had to do with my changes.
Before submitting the PR make sure the following things have been done (and denote this by checking the relevant checkboxes):
- [X] The commits are consistent with our contribution guidelines
- [X] You've added tests (if possible) to cover your change(s)
- [X] All tests are passing (
eldev test) - [X] All code passes the linter (
eldev lint) which is based onelisp-lintand includes- byte-compilation,
checkdoc, check-declare, packaging metadata, indentation, and trailing whitespace checks.
- byte-compilation,
- [X] You've updated the changelog (if adding/changing user-visible functionality)
- [X] You've updated the user manual (if adding/changing user-visible functionality)
Thanks!
If you're just starting out to hack on CIDER you might find this section of its manual extremely useful.
@J0sueTM ping :-)
Thanks for pinging @bbatsov completely forgot about it! My time hasn't been the most generous recently :sweat_smile: . I'll be coming with changes in the coming days.
Btw, I still don't like that we're now passing some text around. Might be better to make the message optional or move the progress reporting to the function that deals with many namespaces or to rename the progress param to something like msg, so it's clearer what this is.
Also - for a lot of files some status bar might be a better option (e.g. https://www.gnu.org/software/emacs/manual/html_node/elisp/Progress.html or spinner.el that we're using elsewhere in the code)
@J0sueTM ping :-)
hey @bbatsov. I'm probably not able to finish this PR in the way you guys want. Nothing wrong with that, of course, I just don't know much about ELisp or have enough time in order to accomodate your quality requests :sweat_smile:.
I'm sorry for taking your time. Could you please either close the PR or backlog it so, if on interest of anyone, implement this better later?
Thanks for the great lib. I use it daily and it work flawlessly!
It's no issue. Normally in these cases someone from us can pick up the branch and do whatever's needed, preserving attribution to you.
(Will do)
@katomuso That's a fairly small and simple task, that might be interesting to you if you're looking for more tickets to tackle.
@katomuso That's a fairly small and simple task, that might be interesting to you if you're looking for more tickets to tackle.
I will look into it sometime this month. Do I need to create a separate PR and link to this one, or is there a better way to do this?
@katomuso You can just do a separate PR - as noted in my comments, I think it's much better (and simpler) to just use a real progress indicator (either a built-in one or coming from spinner.el, which is a CIDER dep) instead of indicating progress via a message printed in the minibuffer.
@katomuso You can just do a separate PR - as noted in my comments, I think it's much better (and simpler) to just use a real progress indicator (either a built-in one or coming from spinner.el, which is a CIDER dep) instead of indicating progress via a message printed in the minibuffer.
As far as I understand, spinner.el can't show exact progress (number of evaluated files / number of total files). I will look into the ways in which this is possible, as it is not very reassuring to wait a minute or two without knowing how much longer it will take.
That's the classic built-in approach - https://www.gnu.org/software/emacs/manual/html_node/elisp/Progress.html I mentioned spinner just because some indication that something is happening will still be an improvement over no indication. :-)