New on Elpa: Spinner.el, mode-line spinners and progress-bars09 Mar 2015, by Artur Malabarba.
New on Elpa post series
- New on (M)Elpa: speed-of-thought-lisp
- New on Elpa: Spinner.el, mode-line spinners and progress-bars
After adding asynchronous operations to Paradox, I saw the need to provide some visual feedback to the user. In the simplest sense, this could be a fixed message on the mode-line, such as “Upgrading…” or “Working”, but this is not enough. I needed movement. Movement implies something is ongoing. It catches your eye and gives you that subconscious reassurance that progress is being made. A tiny spinning wheel, hourglass, or rainbow is enough to sooth all your doubts, unerringly restoring your confidence on the software and those who made it.
Today, I introduce spinner.el, Emacs’ version of the spinning hourglass.
The spinner is added to the mode-line of a specific buffer, and stays there
until stopped by the program. In the case of Paradox, for instance, you get a
spinner on the
*Packages* buffer to indicate background operations are
ongoing, and it is immediately removed once they are finished.
Using the package is as simple as calling
(eventually followed by
spinner-stop). There are currently 17 different
spinners available (see above), and you can also specify the animation speed or
even add your own animations.
Spinner.el is available to all Emacs versions running
package.el, so hopefully
other packages will make use of it as well.