;;; -*-Scheme-*-
;;;
-;;; $Id: imail-core.scm,v 1.39 2000/05/04 17:40:01 cph Exp $
+;;; $Id: imail-core.scm,v 1.40 2000/05/04 18:52:52 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(define flags-member? (member-procedure string-ci=?))
(define flags-add (add-member-procedure string-ci=?))
+(define flags-delete (delete-member-procedure list-deletor string-ci=?))
(define flags-delete! (delete-member-procedure list-deletor! string-ci=?))
(define (message-flag? object)
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-top.scm,v 1.31 2000/05/04 18:47:18 cph Exp $
+;;; $Id: imail-top.scm,v 1.32 2000/05/04 18:52:30 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
;;; * Try to leverage IMAP MIME parser by building compatible
;;; interface for file-based folders.
;;;
-;;; * Hook in code to automatically re-open IMAP connections.
-;;;
-;;; * Mark messages as "seen", etc.
-;;;
;;; * Build generic message cache? Need to figure out when cached
;;; info can be deleted.
(define (imail-kill-buffer buffer)
(imail-close-buffer-folder buffer))
-(define-command imail-quit
- "Quit out of IMAIL."
- ()
- (lambda ()
- ((ref-command imail-save-folder))
- (imail-close-buffer-folder (selected-buffer))
- ((ref-command bury-buffer))))
-
-(define-command imail-save-folder
- "Save the currently selected IMAIL folder."
- ()
- (lambda ()
- (save-folder (selected-folder))))
-
(define (imail-close-buffer-folder buffer)
(let ((folder (selected-folder #f buffer)))
(if folder
(let ((message (selected-message #f buffer)))
(and message
(let ((folder (message-folder message))
- (index (message-index message))
- (flags (message-flags message)))
+ (index (message-index message)))
(if (and folder index)
- (let ((line
- (string-append
- " "
- (number->string (+ 1 index))
- "/"
- (number->string (folder-length folder)))))
- (if (pair? flags)
- (string-append line ","
- (decorated-string-append "" "," "" flags))
- line))
+ (string-append " "
+ (number->string (+ 1 index))
+ "/"
+ (number->string (folder-length folder))
+ (decorated-string-append
+ "," "" ""
+ (flags-delete "seen" (message-flags message))))
" 0/0")))))
(define (maybe-reformat-headers message buffer)
\f
;;;; Miscellany
+(define-command imail-quit
+ "Quit out of IMAIL."
+ ()
+ (lambda ()
+ ((ref-command imail-save-folder))
+ (imail-close-buffer-folder (selected-buffer))
+ ((ref-command bury-buffer))))
+
+(define-command imail-save-folder
+ "Save the currently selected IMAIL folder."
+ ()
+ (lambda ()
+ (save-folder (selected-folder))))
+
(define-command imail-toggle-header
"Show full message headers if pruned headers currently shown, or vice versa."
()