~johnhamelink/dape-spinner

A Dape activity spinner in your modeline

aa0f146 docs(README): README.org -> README.md

a month ago

388e262 docs: Also add the animation on a light theme to match the light theme of sourcehut

a month ago

#Dape Spinner

Demo Video

Dape Spinner is a small quality of life addon for the Dape debugger. Often, it can be useful to have a modest activity indicator whose movement indicates chatter. Dape Spinner adds an unobtrusive spinner to the modeline, which rotates in response to events received by Dape. After Dape stops receiving events, the spinner will timeout and hide again, keeping the modeline clean. If the DAP server is very chatty, and a large influx of events occurs in a short space of time, the spinner will throttle its spin rate, thus avoiding performance penalties.

Patches and PRs welcome!

#Why?

This project started while working on a more ambitious project. I found it quite useful to have a responsive widget to indicate chatter that would get out of my way when not in use. The result is dape-spinner.

#Installation

Installation with use-package on Emacs >= 30.0 is predictably simple:

(use-package dape-spinner
  :ensure t
  :vc (:url "https://git.sr.ht/~johnhamelink/dape-spinner" :rev :newest)
  :config
  (dape-spinner-setup))

#Setup

Regardless of how you install, you can add dape-spinner to the mode-line with (dape-spinner-setup). The spinner will only be visible when dape is active, and there has been event chatter that occurred within the dape-spinner-mode-line-timeout threshold. You can run a dape session (even a failing one) and then evaluate (dape-spinner-spin) to manually verify the spinner is working.

#Configuration

This is a fairly simple package, but there are a few options to tweak.

  • The spinner itself is configurable by modifying dape-spinner-mode-line-spinner. The spinner can have as many or as few characters as you'd like. Here's some examples to try:
-\|/
v<^>
┤┘┴└├┌┬┐
◢◣◤◥
◴◷◶◵
◐◓◑◒
▉▊▋▌▍▎▏▎▍▌▋▊▉
◇◈◆
⠁⠂⠄⡀⢀⠠⠐⠈
◜◝◞◟
.oO@*
  • You can adjust the spinner timeout with dape-spinner-mode-line-timeout.
  • You can trigger additional spin events yourself by simply calling dape-spinner-spin while dape is active.
  • You can adjust dape-spinner-time-min-interval to allow the spinner to spin at a faster rate - potentially at the cost of performance due to the refreshing of the UI, By default, the spinner will spin one full rotation per second.

#FAQ

#Why are there two README files?

I wish to write up documentation for this project in org-mode, and a build script converts the org docs into Github-flavoured markdown, which is something SourceHut's web UI can render. I'll stop doing this if SourceHut ever manage to support org-mode in some meaningful way.