#| -*-Scheme-*-
-$Id: edwin.pkg,v 1.228 1998/12/29 04:08:17 cph Exp $
+$Id: edwin.pkg,v 1.229 1998/12/29 04:09:50 cph Exp $
Copyright (c) 1989-98 Massachusetts Institute of Technology
edwin-variable$news-automatically-collapse-threads
edwin-variable$news-common-mode-hook
edwin-variable$news-group-author-columns
+ edwin-variable$news-group-cache-policy
edwin-variable$news-group-ignore-hidden-subjects
edwin-variable$news-group-ignored-subject-retention
edwin-variable$news-group-keep-ignored-headers
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
;;; -*-Scheme-*-
;;;
-;;; $Id: snr.scm,v 1.46 1998/12/29 02:35:22 cph Exp $
+;;; $Id: snr.scm,v 1.47 1998/12/29 04:08:26 cph Exp $
;;;
;;; Copyright (c) 1995-98 Massachusetts Institute of Technology
;;;
Otherwise (the default), ignored headers aren't kept."
#f
boolean?)
-
+\f
(define-variable news-group-show-seen-headers
"Switch controlling whether already-seen headers are shown.
If true, group buffers show all headers.
server, and no additional context is available."
#t
boolean?)
+
+(define-variable news-group-cache-policy
+ "Controls how cacheing is used.
+The value of this variable is a list.
+The first element of the list describes the groups that are cached:
+ SUBSCRIBED only subscribed groups are cached
+ ALL all groups are cached
+ [list of group names] only named groups are cached
+The second element of the list is a list containing zero or more of
+the following symbols:
+ HEADERS headers are cached
+ BODIES bodies are cached
+The default value of this variable is (SUBSCRIBED (HEADERS BODIES))."
+ '(SUBSCRIBED (HEADERS BODIES))
+ (lambda (object)
+ (and (pair? object)
+ (or (eq? 'SUBSCRIBED (car object))
+ (eq? 'ALL (car object))
+ (list-of-strings? (car object)))
+ (pair? (cdr object))
+ (and (list? (cadr object))
+ (for-all? (cadr object)
+ (lambda (element)
+ (or (eq? 'HEADERS element)
+ (eq? 'BODIES element)))))
+ (null? (cddr object)))))
\f
(define-command rnews
"Start a News reader.
(let ((group-names
(lambda () (nntp-connection:active-groups connection #f)))
(string->group
- (lambda (string) (find-active-news-group connection string))))
+ (lambda (string)
+ (let ((group (find-active-news-group connection string)))
+ (if group (news-group:apply-cache-policy group))
+ group))))
(string->group
(let ((convert
(lambda (vector) (map news-group:name (vector->list vector)))))
(set-news-group:ranges-marked! group (canonicalize-ranges ranges-marked))
(set-news-group:ranges-browsed! group (canonicalize-ranges ranges-browsed))
(news-group:clip-ranges! group)
+ (news-group:apply-cache-policy group)
group))
+
+(define (news-group:apply-cache-policy group)
+ (set-news-group:use-gdbm!
+ group
+ (let ((nggp (ref-variable news-group-cache-policy)))
+ (if (cond ((eq? 'ALL (car nggp)) #t)
+ ((eq? 'SUBSCRIBED (car nggp)) (news-group:subscribed? group))
+ (else (member (news-group:name group) (car nggp))))
+ (cadr nggp)
+ '()))))
\f
(define (news-group:get-threads group argument buffer)
(let ((headers (news-group:get-headers group argument buffer))