Function: spinner--timer-function

spinner--timer-function is a byte-compiled function defined in spinner.el.

Signature

(spinner--timer-function SPINNER)

Documentation

Function called to update SPINNER.

If SPINNER is no longer active, or if its buffer has been killed, stop the SPINNER's timer.

Source Code

;; Defined in ~/.emacs.d/elpa/spinner-1.7.4/spinner.el
(defun spinner--timer-function (spinner)
  "Function called to update SPINNER.
If SPINNER is no longer active, or if its buffer has been killed,
stop the SPINNER's timer."
  (let ((buffer (spinner--buffer spinner)))
    (if (or (not (spinner--active-p spinner))
            (and buffer (not (buffer-live-p buffer))))
        (spinner-stop spinner)
      ;; Increment
      (cl-callf (lambda (x) (if (< x 0)
                           (1+ x)
                         (% (1+ x) (length (spinner--frames spinner)))))
          (spinner--counter spinner))
      ;; Update mode-line.
      (if (buffer-live-p buffer)
          (with-current-buffer buffer
            (force-mode-line-update))
        (force-mode-line-update)))))