Function: progress-reporter-update
progress-reporter-update is a byte-compiled function defined in
subr.el.gz.
Signature
(progress-reporter-update REPORTER &optional VALUE SUFFIX)
Documentation
Report progress of an operation in the echo area.
REPORTER should be the result of a call to make-progress-reporter.
If REPORTER is a numerical progress reporter---i.e. if it was
made using non-nil MIN-VALUE and MAX-VALUE arguments to
make-progress-reporter---then VALUE should be a number between
MIN-VALUE and MAX-VALUE.
Optional argument SUFFIX is a string to be displayed after REPORTER's main message and progress text. If REPORTER is a non-numerical reporter, then VALUE should be nil, or a string to use instead of SUFFIX.
This function is relatively inexpensive. If the change since last update is too small or insufficient time has passed, it does nothing.
Probably introduced at or before Emacs version 22.1.
Aliases
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
;;;; Progress reporters.
;; Progress reporter has the following structure:
;;
;; (NEXT-UPDATE-VALUE . [NEXT-UPDATE-TIME
;; MIN-VALUE
;; MAX-VALUE
;; MESSAGE
;; MIN-CHANGE
;; MIN-TIME
;; MESSAGE-SUFFIX])
;;
;; This weirdness is for optimization reasons: we want
;; `progress-reporter-update' to be as fast as possible, so
;; `(car reporter)' is better than `(aref reporter 0)'.
;;
;; NEXT-UPDATE-TIME is a float. While `float-time' loses a couple
;; digits of precision, it doesn't really matter here. On the other
;; hand, it greatly simplifies the code.
(defsubst progress-reporter-update (reporter &optional value suffix)
"Report progress of an operation in the echo area.
REPORTER should be the result of a call to `make-progress-reporter'.
If REPORTER is a numerical progress reporter---i.e. if it was
made using non-nil MIN-VALUE and MAX-VALUE arguments to
`make-progress-reporter'---then VALUE should be a number between
MIN-VALUE and MAX-VALUE.
Optional argument SUFFIX is a string to be displayed after
REPORTER's main message and progress text. If REPORTER is a
non-numerical reporter, then VALUE should be nil, or a string to
use instead of SUFFIX.
This function is relatively inexpensive. If the change since
last update is too small or insufficient time has passed, it does
nothing."
(when (or (not (numberp value)) ; For pulsing reporter
(>= value (car reporter))) ; For numerical reporter
(progress-reporter-do-update reporter value suffix)))