;;; -*-Scheme-*-
;;;
-;;; $Id: imail-imap.scm,v 1.53 2000/05/18 03:43:01 cph Exp $
+;;; $Id: imail-imap.scm,v 1.54 2000/05/18 19:53:26 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(number->string (+ (message-index message) 1)))))
((imail-message-wrapper "Reading" suffix)
(lambda ()
- (imap:command:uid-fetch connection uid keywords)
- (if (not (initpred message))
- (error (string-append "Unable to obtain" suffix)))))))))
+ (imap:read-literal-progress-hook imail-progress-meter
+ (lambda ()
+ (imap:command:uid-fetch connection uid keywords)
+ (if (not (initpred message))
+ (error (string-append "Unable to obtain" suffix)))))))))))
(let ((reflector
(lambda (generic-procedure slot-name guarantee)
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-top.scm,v 1.63 2000/05/18 17:14:18 cph Exp $
+;;; $Id: imail-top.scm,v 1.64 2000/05/18 19:53:27 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
procedure))
(define (imail-message-wrapper . arguments)
- (apply message-wrapper #f arguments))
+ (let ((prefix (string-append (message-args->string arguments) "...")))
+ (lambda (thunk)
+ (fluid-let ((*imail-message-wrapper-prefix* prefix))
+ (message prefix)
+ (let ((v (thunk)))
+ (message prefix "done")
+ v)))))
+
+(define (imail-progress-meter current total)
+ (if (and *imail-message-wrapper-prefix* (<= 0 current total))
+ (message *imail-message-wrapper-prefix*
+ (string-pad-left
+ (number->string (round->exact (* (/ current total) 100)))
+ 3)
+ "% (of "
+ (number->string total)
+ ")")))
+
+(define *imail-message-wrapper-prefix* #f)
\f
(define-major-mode imail read-only "IMAIL"
"IMAIL mode is used by \\[imail] for editing IMAIL files.
;;; -*-Scheme-*-
;;;
-;;; $Id: imail.pkg,v 1.34 2000/05/17 20:53:27 cph Exp $
+;;; $Id: imail.pkg,v 1.35 2000/05/18 19:53:25 cph Exp $
;;;
;;; Copyright (c) 2000 Massachusetts Institute of Technology
;;;
(files "imap-response")
(parent (edwin imail))
(export (edwin imail)
+ imap:read-literal-progress-hook
imap:read-server-response
imap:response-code:alert?
imap:response-code:permanentflags
;;; -*-Scheme-*-
;;;
-;;; $Id: imap-response.scm,v 1.18 2000/05/18 19:29:10 cph Exp $
+;;; $Id: imap-response.scm,v 1.19 2000/05/18 19:53:28 cph Exp $
;;;
;;; Copyright (c) 2000 Massachusetts Institute of Technology
;;;
port)))
(if (fix:= m 0)
(error "Premature EOF:" port))
- (let ((start (fix:+ start m)))
- (if *read-literal-progress-hook*
- (*read-literal-progress-hook* start n))
- (loop start)))))
+ (let ((start* (fix:+ start m)))
+ (if (and *read-literal-progress-hook*
+ (not (and (fix:= start 0)
+ (fix:>= start* n))))
+ (*read-literal-progress-hook* start* n))
+ (loop start*)))))
(if trace-imap-server-responses?
(write-string s (notification-output-port)))
(translate-network-line-endings-to-scheme! s)
IMAIL To-Do List
-$Id: todo.txt,v 1.20 2000/05/18 18:57:45 cph Exp $
+$Id: todo.txt,v 1.21 2000/05/18 19:53:30 cph Exp $
Bug fixes
---------
New features
------------
-* Add progress feedback when reading very long message bodies.
-
* Add commands to create, delete, and rename folders.
* Implement URL completion.