-(defvar progress-gauge-glyph
- (make-glyph
- (vector 'progress-gauge
- :pixel-height (- progress-glyph-height 8)
- :pixel-width 50
- :descriptor "Progress")))
-
-(defvar progress-text-glyph
- (make-glyph [string :data ""]))
-
-(defvar progress-layout-glyph
- (make-glyph
- (vector
- 'layout :orientation 'vertical :justify 'left
- :items (list
- progress-text-glyph
- (make-glyph
- (vector
- 'layout :pixel-height progress-glyph-height
- :orientation 'horizontal
- :items (list
- progress-gauge-glyph
- (vector
- 'button :pixel-height (- progress-glyph-height 8)
- :descriptor " Stop "
- :callback '(funcall progress-stop-callback)))))))))
-
-(defvar progress-abort-glyph
- (make-glyph
- (vector 'layout :orientation 'vertical :justify 'left
- :items (list progress-text-glyph
- (make-glyph
- (vector 'layout
- :pixel-height progress-glyph-height
- :orientation 'horizontal))))))
-
-(defvar progress-extent-text "")
-(defvar progress-extent nil)
-
-(defun progress-displayed-p (&optional return-string frame)
+(defvar progress-text-instantiator [string :data ""])
+(defvar progress-layout-glyph (make-glyph))
+(defvar progress-layout-instantiator nil)
+
+(defvar progress-gauge-instantiator
+ [progress-gauge
+ :value 0
+ :pixel-height (eval progress-glyph-height)
+ :pixel-width 250
+ :descriptor "Progress"])
+
+(defun set-progress-feedback-instantiator (&optional locale)
+ (cond
+ ((eq progress-feedback-style 'small)
+ (setq progress-glyph-height 16)
+ (setq progress-layout-instantiator
+ `[layout
+ :orientation horizontal
+ :margin-width 4
+ :items (,progress-gauge-instantiator
+ [button
+ :pixel-height (eval progress-glyph-height)
+ ;; 'quit is special and acts "asynchronously".
+ :descriptor "Stop" :callback 'quit]
+ ,progress-text-instantiator)])
+ (set-glyph-image progress-layout-glyph progress-layout-instantiator
+ locale))
+ (t
+ (setq progress-glyph-height 24)
+ (setq progress-layout-instantiator
+ `[layout
+ :orientation vertical :justify left
+ :margin-width 4
+ :items (,progress-text-instantiator
+ [layout
+ :orientation horizontal
+ :items (,progress-gauge-instantiator
+ [button
+ :pixel-height (eval progress-glyph-height)
+ :descriptor " Stop "
+ ;; 'quit is special and acts "asynchronously".
+ :callback 'quit])])])
+ (set-glyph-image progress-layout-glyph progress-layout-instantiator
+ locale))))
+
+(defvar progress-abort-glyph (make-glyph))
+
+(defun set-progress-abort-instantiator (&optional locale)
+ (set-glyph-image progress-abort-glyph
+ `[layout :orientation vertical :justify left
+ :items (,progress-text-instantiator
+ [layout
+ :margin-width 4
+ :pixel-height progress-glyph-height
+ :orientation horizontal])]
+ locale))
+
+(defvar progress-stack nil
+ "An alist of label/string pairs representing active progress gauges.
+The first element in the list is currently displayed in the gutter area.
+Do not modify this directly--use the `progress-feedback' or
+`display-progress-feedback'/`clear-progress-feedback' functions.")
+
+(defun progress-feedback-displayed-p (&optional return-string frame)