Implement variable news-group-cache-policy to control disk cacheing of
authorChris Hanson <org/chris-hanson/cph>
Tue, 29 Dec 1998 04:08:17 +0000 (04:08 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 29 Dec 1998 04:08:17 +0000 (04:08 +0000)
news-group information.

v7/src/edwin/edwin.pkg
v7/src/edwin/nntp.scm

index 212dd45eb038edf6475894e97074fcd6d67cad1d..72fd00d788dc21b2edc42e98d1d55de184e52364 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: edwin.pkg,v 1.227 1998/12/29 02:35:29 cph Exp $
+$Id: edwin.pkg,v 1.228 1998/12/29 04:08:17 cph Exp $
 
 Copyright (c) 1989-98 Massachusetts Institute of Technology
 
@@ -1747,6 +1747,7 @@ MIT in each case. |#
          edwin-variable$news-group-keep-seen-headers
          edwin-variable$news-group-mode-hook
          edwin-variable$news-group-show-author-name
+         edwin-variable$news-group-show-cache-policy
          edwin-variable$news-group-show-context-headers
          edwin-variable$news-group-show-seen-headers
          edwin-variable$news-hide-groups
@@ -1804,6 +1805,7 @@ MIT in each case. |#
          news-group:server
          news-group:server-info
          news-group:update-server-info!
+         news-group:use-gdbm?
          news-group?
          news-header:<
          news-header:field-value
@@ -1844,6 +1846,7 @@ MIT in each case. |#
          organize-headers-into-threads
          set-news-group:reader-hook!
          set-news-group:server-info!
+         set-news-group:use-gdbm!
          set-news-header:reader-hook!
          set-news-thread:reader-hook!
          set-nntp-connection:reader-hook!
index e5746e1e56c0e725b7a49334df64ab40e1b2711f..70a0c85f68815441ec7ea6944aec3a72bca8e650 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: nntp.scm,v 1.19 1998/06/21 09:05:17 cph Exp $
+;;;    $Id: nntp.scm,v 1.20 1998/12/29 04:07:48 cph Exp $
 ;;;
 ;;;    Copyright (c) 1995-98 Massachusetts Institute of Technology
 ;;;
   (%estimated-n-articles #f)
   (%first-article #f)
   (%last-article #f)
-  (reader-hook #f))
+  (reader-hook #f)
+  (%use-gdbm? 'UNDECIDED))
 
 (define (make-news-group connection name)
   (or (find-news-group connection name)
 
 (define (news-group:last-article group)
   (and (news-group:active? group) (news-group:%last-article group)))
-
+\f
 (define (news-group:update-server-info! group)
   (set-news-group:server-info!
    group
       (vector (news-group:%estimated-n-articles group)
              (news-group:%first-article group)
              (news-group:%last-article group))))
+
+(define (news-group:use-gdbm? group type)
+  (and (gdbm-available?)
+       (memq type (news-group:%use-gdbm? group))))
+
+(define (set-news-group:use-gdbm! group types)
+  (set-news-group:%use-gdbm?! group types))
 \f
 ;;;; Header Cache
 
     (lambda (headers numbers)
       (cond ((null? numbers)
             headers)
-           ((gdbm-available?)
+           ((news-group:use-gdbm? group 'HEADERS)
             (news-group:headers-gdbm group numbers headers ignore?))
            (else
             (news-group:headers-no-gdbm group numbers headers ignore?))))))
     (if gdbf
        (if (eq? 'UNAVAILABLE gdbf) #f gdbf)
        (let ((gdbf
-              (and (gdbm-available?)
+              (and (news-group:use-gdbm? group 'HEADERS)
                    (let ((pathname
                           (news-group:header-gdbf-pathname group)))
                      (guarantee-init-file-directory pathname)
     (if gdbf
        (if (eq? 'UNAVAILABLE gdbf) #f gdbf)
        (let ((gdbf
-              (and (gdbm-available?)
+              (and (news-group:use-gdbm? group 'BODIES)
                    (let ((pathname
                           (news-group:body-gdbf-pathname group)))
                      (guarantee-init-file-directory pathname)
        (nntp-body-command (news-group:connection group)
                           (news-header:message-id header)
                           port))))
-
+\f
 (define (news-header:pre-read-body header)
   (let ((group (news-header:group header)))
     (let ((gdbf (news-group:body-gdbf group #t)))
             datum)))))
 \f
 (define (news-group:purge-pre-read-headers group predicate)
-  (if (gdbm-available?)
+  (if (news-group:use-gdbm? group 'HEADERS)
       (if (eq? predicate 'ALL)
          (begin
            (set-news-group:%header-gdbf! group #f)