All other related modules are changed.
+2000-05-12 Masahiro MURATA <muse@ba2.so-net.ne.jp>
+
+ * elmo-vars.el (elmo-display-progress-threshold): New variable.
+ All other related modules are changed.
+
2000-05-11 Yuuichi Teranishi <teranisi@gohome.org>
* elmo-msgdb.el (elmo-msgdb-sort-by-date): Fixed a problem
mark-alist
(elmo-msgdb-overview-entity-get-number entity)
gmark))))
- (setq i (1+ i))
- (setq percent (/ (* i 100) num))
- (elmo-display-progress
- 'elmo-archive-msgdb-create-as-numlist-subr1 "Creating msgdb..."
- percent)
+ (when (> num elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (setq percent (/ (* i 100) num))
+ (elmo-display-progress
+ 'elmo-archive-msgdb-create-as-numlist-subr1 "Creating msgdb..."
+ percent))
(setq numlist (cdr numlist)))
(kill-buffer tmp-buf)
(message "Creating msgdb...done.")
; (setq mark-alist (append mark-alist (nth 2 result))))
(t ;; unknown format
(error "unknown format!")))
- (setq i (+ n i))
- (setq percent (/ (* i 100) num))
- (elmo-display-progress
- 'elmo-archive-msgdb-create-as-numlist-subr2 "Creating msgdb..."
- percent))
+ (when (> num elmo-display-progress-threshold)
+ (setq i (+ n i))
+ (setq percent (/ (* i 100) num))
+ (elmo-display-progress
+ 'elmo-archive-msgdb-create-as-numlist-subr2 "Creating msgdb..."
+ percent)))
(kill-buffer buf)
(list overview number-alist mark-alist)) )
condition
(nth 3 spec))
(setq ret-val (cons (car msgs) ret-val)))
- (setq i (1+ i))
- (elmo-display-progress
- 'elmo-archive-search "Searching..."
- (/ (* i 100) num))
+ (when (> num elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (elmo-display-progress
+ 'elmo-archive-search "Searching..."
+ (/ (* i 100) num)))
(setq msgs (cdr msgs)))
(nreverse ret-val)))
(lambda (x y)
(< (cdr x)
(cdr y))))))))
- (setq i (+ i 1))
- (elmo-display-progress
- 'elmo-cache-get-sorted-cache-file-list "Collecting cache info..."
- (/ (* i 100) num))
+ (when (> num elmo-display-progress-threshold)
+ (setq i (+ i 1))
+ (elmo-display-progress
+ 'elmo-cache-get-sorted-cache-file-list "Collecting cache info..."
+ (/ (* i 100) num)))
(setq dirs (cdr dirs)))
+ (message "Collecting cache info...done.")
ret-val))
(defun elmo-cache-expire-by-age (&optional days)
(car (car nalist))))
(elmo-file-field-condition-match cache-file condition))
(setq ret-val (append ret-val (list (caar nalist)))))
- (setq i (1+ i))
- (setq percent (/ (* i 100) num))
- (elmo-display-progress
- 'elmo-cache-search-all "Searching..."
- percent)
+ (when (> num elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (setq percent (/ (* i 100) num))
+ (elmo-display-progress
+ 'elmo-cache-search-all "Searching..."
+ percent))
(setq nalist (cdr nalist)))
ret-val))
mark-alist
num
gmark))))
- (setq i (1+ i))
- (setq percent (/ (* i 100) len))
- (elmo-display-progress
- 'elmo-cache-msgdb-create-as-numlist "Creating msgdb..."
- percent)
+ (when (> len elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (setq percent (/ (* i 100) len))
+ (elmo-display-progress
+ 'elmo-cache-msgdb-create-as-numlist "Creating msgdb..."
+ percent))
(setq numlist (cdr numlist)))
(message "Creating msgdb...done.")
(list overview number-alist mark-alist))))
(elmo-cache-get-folder-directory spec))
condition)
(setq ret-val (cons (car msgs) ret-val)))
- (setq i (1+ i))
- (elmo-display-progress
- 'elmo-cache-search "Searching..."
- (/ (* i 100) num))
+ (when (> num elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (elmo-display-progress
+ 'elmo-cache-search "Searching..."
+ (/ (* i 100) num)))
(setq msgs (cdr msgs)))
(nreverse ret-val)))
(setq mark-alist
(elmo-msgdb-mark-append
mark-alist (car numlist) gmark)))))
- (setq i (1+ i))
- (setq percent (/ (* i 100) num))
- (elmo-display-progress
- 'elmo-dop-msgdb-create-as-numlist "Creating msgdb..."
- percent)
+ (when (> num elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (setq percent (/ (* i 100) num))
+ (elmo-display-progress
+ 'elmo-dop-msgdb-create-as-numlist "Creating msgdb..."
+ percent))
(setq numlist (cdr numlist)))
(list overview number-alist mark-alist))
(error "Unplugged"))
(setq count (+ count (car (car set-list))))
(setq ov-str (elmo-imap4-read-contents (process-buffer process)
process))
- (elmo-display-progress
- 'elmo-imap4-msgdb-create "Getting overview..."
- (/ (* count 100) length))
+ (when (> length elmo-display-progress-threshold)
+ (elmo-display-progress
+ 'elmo-imap4-msgdb-create "Getting overview..."
+ (/ (* count 100) length)))
(setq set-list (cdr set-list)))
;; process last one.
(with-current-buffer (process-buffer process)
entity))
already-mark
new-mark))))))
- (setq i (1+ i))
- (setq percent (/ (* i 100) num))
- (elmo-display-progress
- 'elmo-internal-msgdb-create "Creating msgdb..."
- percent)
+ (when (> num elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (setq percent (/ (* i 100) num))
+ (elmo-display-progress
+ 'elmo-internal-msgdb-create "Creating msgdb..."
+ percent))
(setq numlist (cdr numlist)))
(message "Creating msgdb...done.")
(list overview number-alist mark-alist loc-alist))))
mark-alist
num
gmark))))
- (setq i (1+ i))
- (setq percent (/ (* i 100) len))
- (elmo-display-progress
- 'elmo-localdir-msgdb-create-as-numlist "Creating msgdb..."
- percent)
+ (when (> len elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (setq percent (/ (* i 100) len))
+ (elmo-display-progress
+ 'elmo-localdir-msgdb-create-as-numlist "Creating msgdb..."
+ percent))
(setq numlist (cdr numlist)))
(message "Creating msgdb...done.")
(list overview number-alist mark-alist))))
(if (elmo-localdir-field-condition-match spec (car msgs)
condition)
(setq ret-val (cons (car msgs) ret-val)))
- (setq i (1+ i))
- (elmo-display-progress
- 'elmo-localdir-search "Searching..."
- (/ (* i 100) num))
+ (when (> num elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (elmo-display-progress
+ 'elmo-localdir-search "Searching..."
+ (/ (* i 100) num)))
(setq msgs (cdr msgs)))
(nreverse ret-val)))
(mapcar 'car onum-alist)))
(setq total (length flist))
(while flist
- (elmo-display-progress
- 'elmo-localdir-pack-number "Packing..."
- (/ (* i 100) total))
+ (setq i (1+ i))
+ (when (> total elmo-display-progress-threshold)
+ (elmo-display-progress
+ 'elmo-localdir-pack-number "Packing..."
+ (/ (* i 100) total)))
(setq onum (car flist))
(when (not (eq onum i)) ;; why \=() is wrong..
(elmo-bind-directory
(elmo-msgdb-mark-append
new-mark-alist
i mark)))
- (setq i (1+ i))
(setq flist (cdr flist)))
(message "Packing...done.")
(list (elmo-msgdb-get-overview msgdb)
(elmo-msgdb-overview-entity-get-id
entity))
new-mark)))))
- (setq i (1+ i))
- (setq percent (/ (* i 100) num))
- (elmo-display-progress
- 'elmo-maildir-msgdb-create "Creating msgdb..."
- percent)
+ (when (> num elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (setq percent (/ (* i 100) num))
+ (elmo-display-progress
+ 'elmo-maildir-msgdb-create "Creating msgdb..."
+ percent))
(setq numlist (cdr numlist)))
(message "Creating msgdb...done.")
(elmo-msgdb-sort-by-date
(setq ret-val (delete top-ng ret-val)))
(if (not (assoc top-ng ret-val))
(setq ret-val (nconc ret-val (list (list top-ng))))))
- (setq i (1+ i))
- (and (zerop (% i 10))
- (elmo-display-progress
- 'elmo-nntp-list-folders "Parsing active..."
- (/ (* i 100) len)))
+ (when (> len elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (if (or (zerop (% i 10)) (= i len))
+ (elmo-display-progress
+ 'elmo-nntp-list-folders "Parsing active..."
+ (/ (* i 100) len))))
(forward-line 1)
))
(while (re-search-forward "\\([^ ]+\\) .*\n" nil t)
(setq ret-val (nconc ret-val
(list (elmo-match-buffer 1))))
- (setq i (1+ i))
- (and (zerop (% i 10))
- (elmo-display-progress
- 'elmo-nntp-list-folders "Parsing active..."
- (/ (* i 100) len))))))
+ (when (> len elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (if (or (zerop (% i 10)) (= i len))
+ (elmo-display-progress
+ 'elmo-nntp-list-folders "Parsing active..."
+ (/ (* i 100) len))))))
+ (when (> len elmo-display-progress-threshold)
+ (elmo-display-progress
+ 'elmo-nntp-list-folders "Parsing active..." 100)))
(kill-buffer tmp-buffer)
- (elmo-display-progress
- 'elmo-nntp-list-folders "Parsing active..."
- 100)
(unless (string= server elmo-default-nntp-server)
(setq append-serv (concat "@" server)))
(unless (eq port elmo-default-nntp-port)
(if (null (setq ov-str (elmo-nntp-read-contents buffer process)))
(error "Fetching overview failed")))
(setq cur (+ elmo-nntp-overview-fetch-chop-length cur 1))
+ (when (> length elmo-display-progress-threshold)
+ (elmo-display-progress
+ 'elmo-nntp-msgdb-create "Getting overview..."
+ (/ (* (+ (- (min cur end-num)
+ beg-num) 1) 100) length))))
+ (when (> length elmo-display-progress-threshold)
(elmo-display-progress
- 'elmo-nntp-msgdb-create "Getting overview..."
- (/ (* (+ (- (min cur
- end-num)
- beg-num) 1) 100) length))))
+ 'elmo-nntp-msgdb-create "Getting overview..." 100)))
(if (not use-xover)
(setq ret-val (elmo-nntp-msgdb-create-by-header
folder buffer process numlist
important-mark
seen-list
filter))))))
- (elmo-display-progress
- 'elmo-nntp-msgdb-create "Getting overview..." 100)
;; If there are canceled messages, overviews are not obtained
;; to max-number(inn 2.3?).
(when (and (elmo-nntp-max-number-precedes-list-active-p)
(< received count))
(accept-process-output process 1)
(discard-input)
- (and (zerop (% received 10))
- (elmo-display-progress
- 'elmo-nntp-groups-read-response "Getting folders info..."
- (/ (* received 100) count)))
- )
- (elmo-display-progress
- 'elmo-nntp-groups-read-response "Getting folders info..."
- 100)
+ (when (> count elmo-display-progress-threshold)
+ (if (or (zerop (% received 10)) (= received count))
+ (elmo-display-progress
+ 'elmo-nntp-groups-read-response "Getting folders info..."
+ (/ (* received 100) count)))))
+ (when (> count elmo-display-progress-threshold)
+ (elmo-display-progress
+ 'elmo-nntp-groups-read-response "Getting folders info..." 100))
;; Wait for the reply from the final command.
(goto-char (point-max))
(re-search-backward "^[0-9]" nil t)
(setq last-point (point))
(setq received (1+ received)))
(< received count))
- (and (zerop (% received 20))
- (elmo-display-progress
- 'elmo-nntp-retrieve-headers "Getting headers..."
- (/ (* received 100) number)))
+ (when (> number elmo-display-progress-threshold)
+ (if (or (zerop (% received 20)) (= received number))
+ (elmo-display-progress
+ 'elmo-nntp-retrieve-headers "Getting headers..."
+ (/ (* received 100) number))))
(accept-process-output process 1)
(discard-input)
)))
- (elmo-display-progress
- 'elmo-nntp-retrieve-headers "Getting headers..." 100)
+ (when (> number elmo-display-progress-threshold)
+ (elmo-display-progress
+ 'elmo-nntp-retrieve-headers "Getting headers..." 100))
(message "Getting headers...done")
;; Remove all "\r"'s.
(goto-char (point-min))
nil
already-mark)
(if seen
- seen-mark
+ (if elmo-nntp-use-cache
+ seen-mark)
new-mark))))
(setq mark-alist
(elmo-msgdb-mark-append
mark-alist
num gmark)))
))))
- (setq i (1+ i))
- (and (zerop (% i 20))
- (elmo-display-progress
- 'elmo-nntp-msgdb-create-message "Creating msgdb..."
- (/ (* i 100) len))))
- (elmo-display-progress
- 'elmo-nntp-msgdb-create-message "Creating msgdb..." 100)
+ (when (> len elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (if (or (zerop (% i 20)) (= i len))
+ (elmo-display-progress
+ 'elmo-nntp-msgdb-create-message "Creating msgdb..."
+ (/ (* i 100) len)))))
+ (when (> len elmo-display-progress-threshold)
+ (elmo-display-progress
+ 'elmo-nntp-msgdb-create-message "Creating msgdb..." 100))
(list overview number-alist mark-alist))))
(defun elmo-nntp-use-cache-p (spec number)
(setq last-point (point))
(setq received (1+ received)))
(< received count))
- (and (zerop (% received 20))
- (elmo-display-progress
- 'elmo-pop3-retrieve-headers "Getting headers..."
- (/ (* received 100) number)))
+ (when (> number elmo-display-progress-threshold)
+ (if (or (zerop (% received 5)) (= received number))
+ (elmo-display-progress
+ 'elmo-pop3-retrieve-headers "Getting headers..."
+ (/ (* received 100) number))))
(accept-process-output process 1)
;(accept-process-output process)
(discard-input)
)))
- (elmo-display-progress
- 'elmo-pop3-retrieve-headers "Getting headers..." 100)
;; Remove all "\r"'s.
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
(elmo-msgdb-overview-entity-get-number entity)
gmark)))
)))
- (setq i (1+ i))
- (and (zerop (% i 20))
- (elmo-display-progress
- 'elmo-pop3-msgdb-create-message "Creating msgdb..."
- (/ (* i 100) num)))
- )
- (elmo-display-progress
- 'elmo-pop3-msgdb-create-message "Creating msgdb..." 100)
+ (when (> num elmo-display-progress-threshold)
+ (setq i (1+ i))
+ (if (or (zerop (% i 5)) (= i num))
+ (elmo-display-progress
+ 'elmo-pop3-msgdb-create-message "Creating msgdb..."
+ (/ (* i 100) num)))))
(list overview number-alist mark-alist))))
(defun elmo-pop3-read-body (buffer process outbuf)
(defvar elmo-use-decoded-cache t
"Use cache of decode mime charset string.")
+(defvar elmo-display-progress-threshold 20
+ "*Displaying progress gauge
+if number of messages are more than this value.")
+
(provide 'elmo-vars)
;;; elmo-vars.el ends here
;; delete src cache if it is partial.
(elmo-cache-delete-partial message-id src-folder (car messages))
(setq ret-val (append ret-val (list (car messages))))
- (setq i (+ i 1))
- (setq percent (/ (* i 100) all-msg-num))
- (if no-delete
+ (when (> all-msg-num elmo-display-progress-threshold)
+ (setq i (+ i 1))
+ (setq percent (/ (* i 100) all-msg-num))
+ (if no-delete
+ (elmo-display-progress
+ 'elmo-move-msgs "Copying messages..."
+ percent)
(elmo-display-progress
- 'elmo-move-msgs "Copying messages..."
- percent)
- (elmo-display-progress
- 'elmo-move-msgs "Moving messages..."
- percent))
+ 'elmo-move-msgs "Moving messages..."
+ percent)))
(setq messages (cdr messages)))
;; Save seen-list.
(unless (eq dst-folder 'null)