=== modified file 'lisp/bindings.el' --- lisp/bindings.el 2011-01-25 04:08:28 +0000 +++ lisp/bindings.el 2011-02-17 20:37:34 +0000 @@ -254,9 +254,13 @@ "Mode-line flag to show if default-directory for current buffer is remote.") ;;;###autoload (put 'mode-line-remote 'risky-local-variable t) - (make-variable-buffer-local 'mode-line-remote) +(defvar mode-line-progress-reporter nil + "Mode-line control for spinning progress-reporter.") +;;;###autoload +(put 'mode-line-progress-reporter 'risky-local-variable t) + ;; Actual initialization is below. (defvar mode-line-position nil "Mode-line control for displaying the position in the buffer. @@ -326,6 +330,7 @@ 'mode-line-client 'mode-line-modified 'mode-line-remote + 'mode-line-progress-reporter 'mode-line-frame-identification 'mode-line-buffer-identification (propertize " " 'help-echo help-echo) === modified file 'lisp/subr.el' --- lisp/subr.el 2011-02-01 21:37:12 +0000 +++ lisp/subr.el 2011-02-17 21:31:24 +0000 @@ -3486,7 +3486,7 @@ (>= value (car reporter))) ; For numerical reporter (progress-reporter-do-update reporter value))) -(defun make-progress-reporter (message &optional min-value max-value +(defun make-progress-reporter (&optional message min-value max-value current-value min-change min-time) "Return progress reporter object for use with `progress-reporter-update'. @@ -3553,6 +3553,7 @@ (min-value (aref parameters 1)) (max-value (aref parameters 2)) (text (aref parameters 3)) + (min-time (aref parameters 5)) (current-time (float-time)) (enough-time-passed ;; See if enough time has passed since the last update. @@ -3591,10 +3592,20 @@ (let ((index (mod (1+ (car reporter)) 4)) (message-log-max nil)) (setcar reporter index) - (message "%s %s" - text - (aref progress-reporter--pulse-characters - index))))))) + (if text + ;; Write into the minibuffer + (message "%s %s" + text + (aref progress-reporter--pulse-characters + index)) + ;; Update modeline + (let ((mode-line-progress-reporter + (list (propertize + (aref progress-reporter--pulse-characters index) + 'mouse-face 'mode-line-highlight))) + mode-line-remote) + (force-mode-line-update) + (sit-for min-time t)))))))) (defun progress-reporter-done (reporter) "Print reporter's message followed by word \"done\" in echo area."