URL-EXISTS?.
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-core.scm,v 1.81 2000/05/22 03:32:04 cph Exp $
+;;; $Id: imail-core.scm,v 1.82 2000/05/22 03:36:52 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(define-generic url-body-container-string (url))
+;; Return #T if URL represents an existing folder.
+(define-generic url-exists? (url))
+\f
;; Convert STRING to a URL. GET-DEFAULT-URL is a procedure of one
;; argument that returns a URL that is used to fill in defaults if
;; STRING is a specification for a partial URL. GET-DEFAULT-URL is
(let ((folder (hash-table/get memoized-folders url #f)))
(and folder
(let ((folder (weak-car folder)))
- (if (and folder (%folder-valid? folder))
+ (if (and folder (url-exists? url))
folder
(begin
(unmemoize-folder url)
(define-generic close-folder (folder))
-;; -------------------------------------------------------------------
-;; Return #T if FOLDER represents a real folder, i.e. has a
-;; corresponding file or server entry.
-
-(define (folder-valid? folder)
- (eq? folder (get-memoized-folder (folder-url folder))))
-
-(define-generic %folder-valid? (folder))
-
;; -------------------------------------------------------------------
;; Return the number of messages in FOLDER.
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-file.scm,v 1.32 2000/05/22 03:32:09 cph Exp $
+;;; $Id: imail-file.scm,v 1.33 2000/05/22 03:36:57 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(define-method url-body-container-string ((url <file-url>))
(directory-namestring (file-url-pathname url)))
+(define-method url-valid? ((url <file-url>))
+ (file-exists? (file-url-pathname url)))
+
(define (define-file-url-completers class filter)
(define-method %url-complete-string
((string <string>) (default-url class)
(set-file-folder-messages! folder 'UNKNOWN)
(for-each detach-message! messages)))))))
-(define-method %folder-valid? ((folder <file-folder>))
- (file-exists? (file-folder-pathname folder)))
-
(define-method folder-length ((folder <file-folder>))
(length (file-folder-messages folder)))
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-imap.scm,v 1.65 2000/05/22 03:32:12 cph Exp $
+;;; $Id: imail-imap.scm,v 1.66 2000/05/22 03:37:00 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(imap-url-port url)
""))
+(define-method url-exists? ((url <imap-url>))
+ url
+ #t)
+
(define (compatible-imap-urls? url1 url2)
;; Can URL1 and URL2 both be accessed from the same IMAP session?
;; E.g. can the IMAP COPY command work between them?
(define-method close-folder ((folder <imap-folder>))
(maybe-close-imap-connection (imap-folder-connection folder)))
-(define-method %folder-valid? ((folder <imap-folder>))
- folder
- #t)
-
(define-method folder-length ((folder <imap-folder>))
(guarantee-imap-folder-open folder)
(imap-folder-n-messages folder))