Function: dired-rsync--update-modeline

dired-rsync--update-modeline is a natively compiled function defined in dired-rsync.el.

Signature

(dired-rsync--update-modeline &optional ERR IND)

Documentation

Update the modeline, optionally with ERR or IND.

ERR is set this indicates a problem, otherwise IND is an alternative indication (such as a percentage completion). If neither is set we simply display the current number of jobs.

Source Code

;; Defined in /nix/store/i42d1fmg6q3dci37c05j415vhqjrzi15-emacs-packages-deps/share/emacs/site-lisp/elpa/dired-rsync-20261005.758/dired-rsync.el
;; Update status with count/speed
(defun dired-rsync--update-modeline (&optional err ind)
  "Update the modeline, optionally with `ERR' or `IND'.

`ERR' is set this indicates a problem, otherwise `IND' is an
alternative indication (such as a percentage completion).  If
neither is set we simply display the current number of jobs."
  (force-mode-line-update)
  (let ((job-count (length (dired-rsync--get-active-buffers))))
    (setq dired-rsync-modeline-status
          (cond
           ;; error has occurred
           (err (propertize
                 (format " R:%d %s!!" job-count err)
                 'font-lock-face '(:foreground "red")))
           ;; we still have jobs but no error
           ((> job-count 1)
            (format " R:%d" job-count))
           ((> job-count 0)
            (format " R:%s" (or ind job-count)))
           ;; Any stale?
           ((dired-rsync--get-proc-buffers)
            (propertize " R:hung :-("
                        'font-lock-face '(:foreground "red")))
           ;; nothing going on
           (t "")))))