From deb1022ba525669a43a8c6d257b6d19bfcbcc49f Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 5 Jun 2000 21:25:37 +0000 Subject: [PATCH] Rename the procedures that form the UI callback interface to make it clear what their role is. --- v7/src/imail/imail-imap.scm | 30 +++++++++++++++--------------- v7/src/imail/imail-top.scm | 12 ++++++------ v7/src/imail/todo.txt | 5 +---- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/v7/src/imail/imail-imap.scm b/v7/src/imail/imail-imap.scm index 2aca4495b..8f7e14041 100644 --- a/v7/src/imail/imail-imap.scm +++ b/v7/src/imail/imail-imap.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-imap.scm,v 1.111 2000/06/05 20:56:48 cph Exp $ +;;; $Id: imail-imap.scm,v 1.112 2000/06/05 21:25:34 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -341,7 +341,7 @@ (imap-connection-capabilities connection))) (error "Server doesn't support IMAP4rev1:" url)) (let ((response - (imail-call-with-pass-phrase url + (imail-ui:call-with-pass-phrase url (lambda (pass-phrase) (imap:command:login connection (imap-url-user-id url) @@ -353,7 +353,7 @@ (close-imap-connection connection))))))))) (if (imap:response:no? response) (begin - (imail-delete-stored-pass-phrase url) + (imail-ui:delete-stored-pass-phrase url) (error "Unable to log in:" (imap:response:response-text-string response)))))) #t))) @@ -505,7 +505,7 @@ (define (read-message-headers! folder start) (if (imap-folder-uidvalidity folder) - ((imail-message-wrapper "Reading message UIDs") + ((imail-ui:message-wrapper "Reading message UIDs") (lambda () (imap:command:fetch-range (imap-folder-connection folder) start #f '(UID)))))) @@ -616,7 +616,7 @@ (with-interrupt-mask interrupt-mask (lambda (interrupt-mask) interrupt-mask - ((imail-message-wrapper "Reading message UIDs") + ((imail-ui:message-wrapper "Reading message UIDs") (lambda () (imap:command:fetch-range (imap-folder-connection folder) 0 #f '(UID)))))) @@ -724,7 +724,7 @@ (let ((suffix (string-append " UID for message " (number->string (+ index 1))))) - ((imail-message-wrapper "Reading" suffix) + ((imail-ui:message-wrapper "Reading" suffix) (lambda () (imap:command:fetch connection index '(UID)) (if (not (initpred message)) @@ -752,9 +752,9 @@ (string-append " " noun " for message " (number->string (+ (message-index message) 1))))) - ((imail-message-wrapper "Reading" suffix) + ((imail-ui:message-wrapper "Reading" suffix) (lambda () - (imap:read-literal-progress-hook imail-progress-meter + (imap:read-literal-progress-hook imail-ui:progress-meter (lambda () (imap:command:uid-fetch connection uid keywords) (if (not (initpred message)) @@ -829,9 +829,9 @@ (if (equal? section '(TEXT)) "" " part") " for message " (number->string (+ (message-index message) 1))))) - ((imail-message-wrapper "Reading" suffix) + ((imail-ui:message-wrapper "Reading" suffix) (lambda () - (imap:read-literal-progress-hook imail-progress-meter + (imap:read-literal-progress-hook imail-ui:progress-meter (lambda () (imap:command:uid-fetch (imap-folder-connection (message-folder message)) @@ -1153,12 +1153,12 @@ (imap:command:no-response connection 'CAPABILITY)) (define (imap:command:login connection user-id pass-phrase) - ((imail-message-wrapper "Logging in as " user-id) + ((imail-ui:message-wrapper "Logging in as " user-id) (lambda () (imap:command:no-response connection 'LOGIN user-id pass-phrase)))) (define (imap:command:select connection mailbox) - ((imail-message-wrapper "Select mailbox " mailbox) + ((imail-ui:message-wrapper "Select mailbox " mailbox) (lambda () (imap:command:no-response connection 'SELECT mailbox)))) @@ -1187,7 +1187,7 @@ (imap:command:no-response connection 'UID 'STORE uid 'FLAGS flags)) (define (imap:command:expunge connection) - ((imail-message-wrapper "Expunging messages") + ((imail-ui:message-wrapper "Expunging messages") (lambda () (imap:command:no-response connection 'EXPUNGE)))) @@ -1429,7 +1429,7 @@ (error "Server shut down connection:" text))) (if (or (imap:response:no? response) (imap:response:bad? response)) - (imail-present-user-alert + (imail-ui:present-user-alert (lambda (port) (write-string "Notice from IMAP server:" port) (newline port) @@ -1485,7 +1485,7 @@ (define (process-response-text connection command code text) command (cond ((imap:response-code:alert? code) - (imail-present-user-alert + (imail-ui:present-user-alert (lambda (port) (write-string "Alert from IMAP server:" port) (newline port) diff --git a/v7/src/imail/imail-top.scm b/v7/src/imail/imail-top.scm index 3b61ce9e9..ef0e3786b 100644 --- a/v7/src/imail/imail-top.scm +++ b/v7/src/imail/imail-top.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-top.scm,v 1.132 2000/06/05 21:09:30 cph Exp $ +;;; $Id: imail-top.scm,v 1.133 2000/06/05 21:25:36 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -276,13 +276,13 @@ regardless of the folder type." ((string-ci=? protocol "umail") (make-umail-url "~/inbox.mail")) (else (error:bad-range-argument protocol))))) -(define (imail-present-user-alert procedure) +(define (imail-ui:present-user-alert procedure) (call-with-output-to-temporary-buffer " *IMAP alert*" '(READ-ONLY SHRINK-WINDOW FLUSH-ON-SPACE) procedure)) -(define (imail-message-wrapper . arguments) +(define (imail-ui:message-wrapper . arguments) (let ((prefix (string-append (message-args->string arguments) "..."))) (lambda (thunk) (fluid-let ((*imail-message-wrapper-prefix* prefix)) @@ -291,7 +291,7 @@ regardless of the folder type." (message prefix "done") v))))) -(define (imail-progress-meter current total) +(define (imail-ui:progress-meter current total) (if (and *imail-message-wrapper-prefix* (< 0 current total)) (message *imail-message-wrapper-prefix* (string-pad-left @@ -312,7 +312,7 @@ regardless of the folder type." (and folder (imail-folder->buffer folder #f))))) -(define (imail-call-with-pass-phrase url receiver) +(define (imail-ui:call-with-pass-phrase url receiver) (let ((key (url-pass-phrase-key url)) (retention-time (ref-variable imail-pass-phrase-retention-time #f))) (let ((entry (hash-table/get memoized-pass-phrases key #f))) @@ -336,7 +336,7 @@ regardless of the folder type." entry))) (receiver pass-phrase))))))) -(define (imail-delete-stored-pass-phrase url) +(define (imail-ui:delete-stored-pass-phrase url) (hash-table/remove! memoized-pass-phrases (url-pass-phrase-key url))) (define (set-up-pass-phrase-timer! entry key retention-time) diff --git a/v7/src/imail/todo.txt b/v7/src/imail/todo.txt index ad872e235..fff9a89f2 100644 --- a/v7/src/imail/todo.txt +++ b/v7/src/imail/todo.txt @@ -1,5 +1,5 @@ IMAIL To-Do List -$Id: todo.txt,v 1.62 2000/06/05 20:04:42 cph Exp $ +$Id: todo.txt,v 1.63 2000/06/05 21:25:37 cph Exp $ Bug fixes --------- @@ -63,9 +63,6 @@ Design changes * Move pathname-completion code into the runtime system. -* Rename the procedures that form the UI callback interface to make it - clear what their role is. - * Repackage the code so that each file now in the core is in a separate package. -- 2.25.1