;;; -*-Scheme-*-
;;;
-;;; $Id: imail-core.scm,v 1.38 2000/05/03 20:28:38 cph Exp $
+;;; $Id: imail-core.scm,v 1.39 2000/05/04 17:40:01 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(define-generic close-folder (folder))
+;; -------------------------------------------------------------------
+;; Return a string that concisely identifies FOLDER, for use in the
+;; presentation layer.
+
+(define-generic folder-presentation-name (folder))
+
;; -------------------------------------------------------------------
;; Return #T if FOLDER represents a real folder, i.e. has a
;; corresponding file or server entry.
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-file.scm,v 1.16 2000/05/03 20:28:42 cph Exp $
+;;; $Id: imail-file.scm,v 1.17 2000/05/04 17:40:03 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(set-file-folder-messages! folder 'UNKNOWN)
(for-each detach-message messages)))))))
+(define-method folder-presentation-name ((folder <file-folder>))
+ (url-body (folder-url folder)))
+
(define-method %folder-valid? ((folder <file-folder>))
(file-exists? (file-folder-pathname folder)))
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-imap.scm,v 1.15 2000/05/04 17:30:29 cph Exp $
+;;; $Id: imail-imap.scm,v 1.16 2000/05/04 17:40:04 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(define-method close-folder ((folder <imap-folder>))
(close-imap-connection (imap-folder-connection folder)))
+(define-method folder-presentation-name ((folder <imap-folder>))
+ (imap-url-mailbox (folder-url folder)))
+
(define-method %folder-valid? ((folder <imap-folder>))
folder
#t)
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-top.scm,v 1.29 2000/05/04 17:29:36 cph Exp $
+;;; $Id: imail-top.scm,v 1.30 2000/05/04 17:39:53 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(folder (open-folder url)))
(select-buffer
(or (imail-folder->buffer folder #f)
- (let ((buffer (new-buffer (imail-url->buffer-name url))))
+ (let ((buffer (new-buffer (folder-presentation-name folder))))
(associate-imail-folder-with-buffer folder buffer)
(select-message folder (first-unseen-message folder) #t)
buffer))))))))
(or folder
(and (if (default-object? error?) #t error?)
(error:bad-range-argument buffer 'SELECTED-FOLDER))))))
-
-(define (imail-url->buffer-name url)
- (url-body url))
\f
(define-major-mode imail read-only "IMAIL"
"IMAIL mode is used by \\[imail] for editing IMAIL files.
#t))))))
(define (imail-kill-buffer buffer)
- (let ((folder (selected-folder #f buffer)))
- (if folder
- (close-folder folder))))
+ (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
()
(lambda ()
(save-folder (selected-folder))))
+
+(define (imail-close-buffer-folder buffer)
+ (let ((folder (selected-folder #f buffer)))
+ (if folder
+ (close-folder folder))))
\f
;;;; Navigation