(elmo-progress-start): Avoid updating `elmo-progress-counter' when a query
authorokazaki <okazaki>
Tue, 7 Nov 2006 12:23:23 +0000 (12:23 +0000)
committerokazaki <okazaki>
Tue, 7 Nov 2006 12:23:23 +0000 (12:23 +0000)
callback returns nil.  Return a progress counter instead of t whenever
a start callback was called.

elmo/elmo-util.el

index 981930f..9f4910b 100644 (file)
@@ -1193,12 +1193,10 @@ If optional DELETE-FUNCTION is speficied, it is used as delete procedure."
             (null elmo-progress-counter))
     (let ((counter (cons label (vector 0 total action))))
       (elmo-progress-call-callback counter 'start)
-      (setq elmo-progress-counter
-           (if (elmo-progress-call-callback counter 'query)
-               (progn
-                 (elmo-progress-call-callback counter)
-                 counter)
-             t)))))
+      (when (elmo-progress-call-callback counter 'query)
+       (elmo-progress-call-callback counter)
+       (setq elmo-progress-counter counter))
+      counter)))
 
 (defun elmo-progress-done (counter)
   (when counter