Malabarba / spinner.el

Emacs mode-line spinner for operations in progress
104 stars 21 forks source link

More spinners #13

Open wasamasa opened 6 years ago

wasamasa commented 6 years ago

I've come across https://github.com/FGRibreau/spinners just now which looks like a good source to steal some more spinner patterns.

seagle0128 commented 4 years ago

Maybe the simple way is making spinner-types customizable. @Malabarba Am I right?

https://github.com/Malabarba/spinner.el/blob/a5d721eea578abb0f13e2a7ba668033d6009f38f/spinner.el#L103

Malabarba commented 4 years ago

Making it customizable would allow people to change existing spinners, but wouldn't allow them to add new ones. That said, the variable is there only to provide a few convenient spinners for package authors to use. But the packages are free to call spinner-create with a vector of strings and that vector will be used as the spinner.

seagle0128 commented 4 years ago

Hmm, I'm thinking perhaps spinner-types includes built-in types and user types. Of course, calling spinner-create is fine.

gonewest818 commented 4 years ago

It's pretty easy to generalize a spinner "generator" too, see: https://gist.github.com/gonewest818/42b14e2dac632857b871754d6f6b9614

Where the default progress-bar can be produced with:

(generate "====" "[" "]" 4)

of course the input string is up to you. Other animations are possible, and even a rolling "marquee":

(generate "Please wait... I'm working on it" "[" "]" 6)
;; => ["[Please]"
;;     "[lease ]"
;;     "[ease w]"
;;     "[ase wa]"
;;     "[se wai]"
;;     "[e wait]"
;;     "[ wait.]"
;;     "[wait..]"
;;     "[ait...]"
;;      etc. ]