Malabarba / spinner.el

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

spinner.el pollutes mode-line-process #26

Open cpitclaudel opened 2 years ago

cpitclaudel commented 2 years ago

Hi there,

To add itself to mode-line-process spinner.el creates a new mode line format that embeds the previous mode line as a sublist instead of appending itself to the existing mode-line-format.

    (unless (and (listp mode-line-process)
                 (memq 'spinner--mode-line-construct mode-line-process))
      (setq mode-line-process
            (list (or mode-line-process "")
                  'spinner--mode-line-construct))))

The problem with this approach is that if other modes do like spinner.el they will step on each other's toes: when the mode line format (A1 ... An), spinner.el changes it to ((A1 ... An) spinner--mode-line-construct). This breaks the type of membership tests that spinner itself uses: (memq 'A1 mode-line-process) returns nil after the changes that spinner applies.

cpitclaudel commented 1 year ago

Hi @Malabarba , would you merge a PR for this bug?

Malabarba commented 1 year ago

Sure. Feel free to tackle it if you'd like.