diff --git a/lisp/subr.el b/lisp/subr.el index cad6319..e5325f4 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4711,7 +4711,7 @@ progress-reporter-update (progress-reporter-do-update reporter value))) (defun make-progress-reporter (message &optional min-value max-value - current-value min-change min-time) + current-value min-change min-time message2) "Return progress reporter object for use with `progress-reporter-update'. MESSAGE is shown in the echo area, with a status indicator @@ -4739,7 +4739,9 @@ make-progress-reporter echo area updates (default is 0.2 seconds.) If the function `float-time' is not present, time is not tracked at all. If the OS is not capable of measuring fractions of seconds, this -parameter is effectively rounded up." +parameter is effectively rounded up. +Optional MESSAGE2 is a text to follow the status indicator: i.e. +the current file being processed." (when (string-match "[[:alnum:]]\\'" message) (setq message (concat message "..."))) (unless min-time @@ -4754,18 +4756,22 @@ make-progress-reporter max-value message (if min-change (max (min min-change 50) 1) 1) - min-time)))) + min-time + message2)))) (progress-reporter-update reporter (or current-value min-value)) reporter)) -(defun progress-reporter-force-update (reporter &optional value new-message) +(defun progress-reporter-force-update (reporter &optional value new-message new-message2) "Report progress of an operation in the echo area unconditionally. The first two arguments are the same as in `progress-reporter-update'. -NEW-MESSAGE, if non-nil, sets a new message for the reporter." +NEW-MESSAGE, if non-nil, sets a new message for the reporter. +NEW-MESSAGE2, if non-nil, sets a new message after the status indicator." (let ((parameters (cdr reporter))) (when new-message (aset parameters 3 new-message)) + (when new-message2 + (aset parameters 6 new-message2)) (when (aref parameters 0) (aset parameters 0 (float-time))) (progress-reporter-do-update reporter value))) @@ -4779,6 +4785,7 @@ progress-reporter-do-update (min-value (aref parameters 1)) (max-value (aref parameters 2)) (text (aref parameters 3)) + (text2 (aref parameters 6)) (enough-time-passed ;; See if enough time has passed since the last update. (or (not update-time) @@ -4809,17 +4816,18 @@ progress-reporter-do-update ;; Only print message if enough time has passed (when enough-time-passed (if (> percentage 0) - (message "%s%d%%" text percentage) - (message "%s" text))))) + (message "%s%d%% %s" text percentage (or text2 "")) + (message "%s %s" text (or text2 "")))))) ;; Pulsing indicator (enough-time-passed (let ((index (mod (1+ (car reporter)) 4)) (message-log-max nil)) (setcar reporter index) - (message "%s %s" + (message "%s %s %s" text (aref progress-reporter--pulse-characters - index))))))) + index) + (or text2 ""))))))) (defun progress-reporter-done (reporter) "Print reporter's message followed by word \"done\" in echo area."