From: Chris Hanson Date: Fri, 4 Feb 2000 04:53:12 +0000 (+0000) Subject: Rename COUNT-MESSAGES -> FOLDER-LENGTH. X-Git-Tag: 20090517-FFI~4265 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c7c0d70c50eece9ef24b33be8212b459533d2c61;p=mit-scheme.git Rename COUNT-MESSAGES -> FOLDER-LENGTH. --- diff --git a/v7/src/imail/imail-core.scm b/v7/src/imail/imail-core.scm index 8ec2fc36b..a5398b3a3 100644 --- a/v7/src/imail/imail-core.scm +++ b/v7/src/imail/imail-core.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-core.scm,v 1.19 2000/01/21 20:21:47 cph Exp $ +;;; $Id: imail-core.scm,v 1.20 2000/02/04 04:53:12 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -238,13 +238,13 @@ (define-generic %folder-valid? (folder)) ;; Return the number of messages in FOLDER. -(define-generic count-messages (folder)) +(define-generic folder-length (folder)) ;; Get the INDEX'th message in FOLDER and return it. Signal an ;; error for invalid INDEX. (define (get-message folder index) (guarantee-index index 'GET-MESSAGE) - (if (not (< index (count-messages folder))) + (if (not (< index (folder-length folder))) (error:bad-range-argument index 'GET-MESSAGE)) (%get-message folder index)) @@ -255,7 +255,7 @@ ;; Unspecified result. (define (insert-message folder index message) (guarantee-index index 'INSERT-MESSAGE) - (if (not (<= index (count-messages folder))) + (if (not (<= index (folder-length folder))) (error:bad-range-argument index 'INSERT-MESSAGE)) (guarantee-message message 'INSERT-MESSAGE) (%insert-message folder index message)) @@ -403,11 +403,11 @@ (else next))))))) (define (first-message folder) - (and (> (count-messages folder) 0) + (and (> (folder-length folder) 0) (get-message folder 0))) (define (last-message folder) - (let ((n (count-messages folder))) + (let ((n (folder-length folder))) (and (> n 0) (get-message folder (- n 1))))) @@ -431,7 +431,7 @@ (lambda (message) message #t) predicate)) (folder (message-folder message))) - (let ((n (count-messages folder))) + (let ((n (folder-length folder))) (let loop ((index (message-index message))) (let ((index (+ index 1))) (and (< index n) @@ -461,7 +461,7 @@ (flags-delete! flag (message-flags message))) (define (folder-flags folder) - (let ((n (count-messages folder))) + (let ((n (folder-length folder))) (do ((index 0 (+ index 1)) (flags '() (append (message-flags (get-message folder index)) flags))) ((= index n) diff --git a/v7/src/imail/imail-file.scm b/v7/src/imail/imail-file.scm index 2b8febde7..a351cfdf5 100644 --- a/v7/src/imail/imail-file.scm +++ b/v7/src/imail/imail-file.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-file.scm,v 1.5 2000/01/21 20:22:06 cph Exp $ +;;; $Id: imail-file.scm,v 1.6 2000/02/04 04:53:08 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -68,7 +68,7 @@ (define-method %folder-valid? ((folder )) (file-exists? (file-url-pathname (folder-url folder)))) -(define-method count-messages ((folder )) +(define-method folder-length ((folder )) (length (file-folder-messages folder))) (define-method %get-message ((folder ) index) @@ -139,7 +139,7 @@ (define-method search-folder ((folder ) criteria) (cond ((string? criteria) - (let ((n (count-messages folder))) + (let ((n (folder-length folder))) (let loop ((index 0) (winners '())) (if (< index n) (loop (+ index 1) diff --git a/v7/src/imail/imail-rmail.scm b/v7/src/imail/imail-rmail.scm index 9a907c316..d355ebdff 100644 --- a/v7/src/imail/imail-rmail.scm +++ b/v7/src/imail/imail-rmail.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-rmail.scm,v 1.10 2000/01/20 17:45:29 cph Exp $ +;;; $Id: imail-rmail.scm,v 1.11 2000/02/04 04:53:04 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -261,11 +261,11 @@ (let ((pathnames (rmail-folder-inbox-list folder))) (if (null? pathnames) #f - (let ((initial-count (count-messages folder))) + (let ((initial-count (folder-length folder))) (let ((inbox-folders (map (lambda (pathname) (let ((inbox (read-rmail-inbox folder pathname #t))) - (let ((n (count-messages inbox))) + (let ((n (folder-length inbox))) (do ((index 0 (+ index 1))) ((= index n)) (append-message folder @@ -277,7 +277,7 @@ (if folder (delete-folder folder))) inbox-folders)) - (- (count-messages folder) initial-count))))) + (- (folder-length folder) initial-count))))) (define (rmail-folder-inbox-list folder) (let ((url (folder-url folder)) diff --git a/v7/src/imail/imail-top.scm b/v7/src/imail/imail-top.scm index c0dc66447..b64c1690e 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.11 2000/01/21 20:25:41 cph Exp $ +;;; $Id: imail-top.scm,v 1.12 2000/02/04 04:52:55 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -149,7 +149,7 @@ May be called with an IMAIL folder URL as argument; ((= 0 n-new) (message "(No new mail has arrived.)")) (else - (select-message folder (- (count-messages folder) n-new)) + (select-message folder (- (folder-length folder) n-new)) (event-distributor/invoke! (ref-variable imail-new-mail-hook)) (message n-new " new message" @@ -276,7 +276,7 @@ DEL Scroll to previous screen of this message. (select-message folder (cond ((eq? folder (message-folder message)) message) - ((and (<= 0 index) (< index (count-messages folder))) index) + ((and (<= 0 index) (< index (folder-length folder))) index) (else (first-unseen-message folder))))))) (define-command imail-quit @@ -300,7 +300,7 @@ Currently meaningless for file-based folders." "p" (lambda (index) (let ((folder (selected-folder))) - (if (not (<= 1 index (count-messages folder))) + (if (not (<= 1 index (folder-length folder))) (editor-error "Message index out of bounds:" index)) (select-message folder (- index 1))))) @@ -407,7 +407,7 @@ With prefix argument N moves backward N messages with these flags." selector) ((and (exact-integer? selector) (<= 0 selector) - (< selector (count-messages folder))) + (< selector (folder-length folder))) (get-message folder selector)) (else (error:wrong-type-argument selector "message selector" @@ -464,7 +464,7 @@ With prefix argument N moves backward N messages with these flags." " " (number->string (+ 1 index)) "/" - (number->string (count-messages folder))))) + (number->string (folder-length folder))))) (if (pair? flags) (string-append line "," (separated-append flags ",")) line)) @@ -592,7 +592,7 @@ Completion is performed over known flags when reading." (let ((folder (selected-folder)) (message (selected-message)) (folder* (open-folder url-string))) - (let ((n (count-messages folder*))) + (let ((n (folder-length folder*))) (do ((index 0 (+ index 1))) ((= index n)) (append-message folder (get-message folder* index))))