Function: cider--eval-pending-overlay-start

cider--eval-pending-overlay-start is a byte-compiled function defined in cider-eval.el.

Signature

(cider--eval-pending-overlay-start END)

Documentation

Show a spinner overlay where the result of the form ending at END will go.

The spinner appears after cider-spinner-delay seconds, at the position dictated by cider-eval-result-position, and animates until cider--eval-pending-overlay-remove clears it. Return the overlay.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-eval.el
(defun cider--eval-pending-overlay-start (end)
  "Show a spinner overlay where the result of the form ending at END will go.
The spinner appears after `cider-spinner-delay' seconds, at the position
dictated by `cider-eval-result-position', and animates until
`cider--eval-pending-overlay-remove' clears it.  Return the overlay."
  (let* ((frames (cider--eval-pending-spinner-frames))
         (buffer (current-buffer))
         (pos (save-excursion
                (goto-char end)
                (skip-chars-backward "\r\n[:blank:]")
                (pcase cider-eval-result-position
                  ('at-eol (line-end-position))
                  (_ (point)))))
         (ov (make-overlay pos pos))
         (index 0)
         timer)
    (overlay-put ov 'category 'cider-eval-pending)
    (overlay-put ov 'cider-temporary t)
    (setq timer
          (run-at-time
           cider-spinner-delay (/ 1.0 10)
           (lambda ()
             (if (not (overlay-buffer ov))
                 (cancel-timer timer)
               (overlay-put
                ov 'after-string
                (propertize (concat " " cider-eval-result-prefix
                                    (aref frames (% index (length frames))))
                            'face 'cider-result-overlay-face))
               (setq index (1+ index))))))
    (overlay-put ov 'cider-pending-timer timer)
    (with-current-buffer buffer
      (push ov cider--eval-pending-overlays))
    ov))