is a closer match to the capabilities of IMAP.
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-core.scm,v 1.57 2000/05/15 19:11:42 cph Exp $
+;;; $Id: imail-core.scm,v 1.58 2000/05/15 19:17:09 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(define-generic %delete-folder (url))
;; -------------------------------------------------------------------
-;; Move the folder named URL to NEW-URL. Signal an error if the
+;; Rename the folder named URL to NEW-URL. Signal an error if the
;; folder doesn't exist, if NEW-URL already refers to a folder, or if
-;; the move can't be performed for some reason. This operation can
-;; also be used to convert between protocols, e.g. to move a folder
-;; from a server to a file.
+;; the rename can't be performed for some reason. This operation does
+;; NOT do format conversion, or move a folder from one place to
+;; another. It only allows changing the name of an existing folder.
-(define (move-folder url new-url)
+(define (rename-folder url new-url)
(let ((url (->url url))
(new-url (->url new-url)))
- (%move-folder url new-url)
(let ((folder (get-memoized-folder url)))
(if folder
(close-folder folder)))
- (unmemoize-folder url)))
-
-(define-generic %move-folder (url new-url))
+ (unmemoize-folder url)
+ (%rename-folder url new-url)))
-(define-method %move-folder ((url <url>) (new-url <url>))
- (%new-folder new-url)
- (let ((folder (open-folder url)))
- (let ((n (folder-length folder)))
- (do ((i 0 (+ i 1)))
- ((= i n))
- (%append-message (get-message folder i) new-url))))
- (%delete-folder url))
+(define-generic %rename-folder (url new-url))
;; -------------------------------------------------------------------
;; Insert a copy of MESSAGE in FOLDER at the end of the existing
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-file.scm,v 1.23 2000/05/15 19:11:45 cph Exp $
+;;; $Id: imail-file.scm,v 1.24 2000/05/15 19:17:12 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(delete-file (file-url-pathname url)))
;;; The next method only works when operating on two URLs of the same
-;;; class. Otherwise, it's necessary to do format conversions; this
-;;; is handled at a higher level in the class heirarchy.
+;;; class, and is restricted to cases where RENAME-FILE works.
-(define-computed-method %move-folder ((uc1 <file-url>) (uc2 <file-url>))
+(define-computed-method %rename-folder ((uc1 <file-url>) (uc2 <file-url>))
(and (eq? uc1 uc2)
(lambda (url new-url)
- ;; **** Not really correct -- must handle cases where RENAME-FILE
- ;; fails, such as moving across file systems under unix.
(rename-file (file-url-pathname url) (file-url-pathname new-url)))))
(define-method available-folder-names ((url <file-url>))
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-imap.scm,v 1.35 2000/05/15 19:11:47 cph Exp $
+;;; $Id: imail-imap.scm,v 1.36 2000/05/15 19:17:14 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(define-method %delete-folder ((url <imap-url>))
???)
-(define-method %move-folder ((url <imap-url>) (new-url <imap-url>))
+(define-method %rename-folder ((url <imap-url>) (new-url <imap-url>))
???)
(define-method %append-message ((message <message>) (url <imap-url>))
IMAIL To-Do List
-$Id: todo.txt,v 1.10 2000/05/15 19:11:52 cph Exp $
+$Id: todo.txt,v 1.11 2000/05/15 19:17:19 cph Exp $
Bug fixes
---------
* Must be able to handle malformed headers in incoming mail.
Generating a low-level error in this situation is unacceptable.
-* RENAME-FOLDER incorrectly uses RENAME-FILE when moving a file
- folder, which will fail on cross-device renames.
-
* RMAIL file reader must recognize when the tail of the file contains
umail messages.