;;; -*-Scheme-*-
;;;
-;;; $Id: nntp.scm,v 1.13 1996/12/19 04:48:35 cph Exp $
+;;; $Id: nntp.scm,v 1.14 1997/03/31 20:54:59 cph Exp $
;;;
-;;; Copyright (c) 1995-96 Massachusetts Institute of Technology
+;;; Copyright (c) 1995-97 Massachusetts Institute of Technology
;;;
;;; This material was developed by the Scheme project at the
;;; Massachusetts Institute of Technology, Department of
(for-each (lambda (key) (gdbm-delete gdbf key)) keys)
(loop (gdbm-nextkey gdbf key)
(if (predicate key) (cons key keys) keys)))))
+
+(define (news-group:close-database group)
+ (let ((header-gdbf (news-group:header-gdbf group #f)))
+ (if header-gdbf
+ (begin
+ (gdbm-close header-gdbf)
+ (set-news-group:%header-gdbf! group #f))))
+ (let ((body-gdbf (news-group:body-gdbf group #f)))
+ (if body-gdbf
+ (begin
+ (gdbm-close body-gdbf)
+ (set-news-group:%body-gdbf! group #f)))))
\f
;;;; Read Headers
;;; -*-Scheme-*-
;;;
-;;; $Id: snr.scm,v 1.29 1997/03/30 06:26:45 cph Exp $
+;;; $Id: snr.scm,v 1.30 1997/03/31 20:55:06 cph Exp $
;;;
;;; Copyright (c) 1995-97 Massachusetts Institute of Technology
;;;
(define (unsubscribe-news-group buffer group)
(news-group:purge-pre-read-headers group 'ALL)
+ (news-group:close-database group)
(set-news-group:subscribed?! group #f)
(update-news-groups-buffers buffer group))
\f
=> (lambda (header)
(or (news-group-buffer:header-mark buffer header)
(news-group-buffer:thread-start-mark
- buffer
- (news-header:thread header))
+ buffer (news-header:thread header))
ls)))
(else ls))))))))
(lambda (thread)
(insert-news-thread-lines thread mark)))
(mark-temporary! mark))
- (update-news-groups-buffers buffer group)))
+ (update-news-groups-buffers buffer group)
+ (news-group:close-database group)))
(define (news-group-buffer:collapse-thread buffer thread)
(if (news-thread:expanded? thread)
(set-news-thread:expanded?! thread expanded?)
(insert-news-thread-lines thread ls)
(mark-temporary! ls)
- (update-subsequent-news-header-lines ls)))))
+ (update-subsequent-news-header-lines ls)
+ (news-group:close-database (news-group-buffer:group buffer))))))
(define (delete-news-thread-lines buffer thread)
(let ((region (news-thread-lines-region buffer thread)))
(news-group-buffer:move-to-header buffer
(if (and next (> n 0))
next
- header)))))))
+ header))))
+ (news-group:close-database (news-group-buffer:group (current-buffer))))))
(define (mark/unmark-news-header-line buffer header name)
(let ((thread (news-header:thread header)))
" of "
(number->string n-articles)))
(news-header:read-marked-body header buffer)))
+ (cond ((news-group-buffer? buffer)
+ (news-group:close-database (news-group-buffer:group buffer)))
+ ((news-server-buffer? buffer)
+ (for-each-vector-element (news-server-buffer:groups buffer)
+ news-group:close-database)))
(message (number->string n-articles) " articles read"))))
(define-command news-delete-thread
(news-group-buffer:move-to-thread buffer
(if (and next (> n 0))
next
- thread)))))))
+ thread))))
+ (news-group:close-database (news-group-buffer:group (current-buffer))))))
(define (news-group-buffer:move-to-thread buffer thread)
(news-group-buffer:move-to-header
(set-buffer-read-only! buffer)
(news-header:article-deleted! header group-buffer)
(update-buffer-news-header-status group-buffer header)
+ (news-group:close-database (news-group-buffer:group group-buffer))
buffer)
(begin
(kill-buffer buffer)
(news-header:article-deleted! header group-buffer)
(update-buffer-news-header-status group-buffer header)
+ (news-group:close-database (news-group-buffer:group group-buffer))
#f))))
(define (news-article-buffer-name header)
(lambda ()
(update-buffer-news-header-status
group-buffer
- (news-article-buffer:header buffer)))))))
+ (news-article-buffer:header buffer))
+ (news-group:close-database
+ (news-group-buffer:group group-buffer)))))))
\f
(define (insert-news-header header buffer truncate?)
(let ((hend (mark-left-inserting-copy (buffer-start buffer))))
()
(lambda ()
(news-article-thread-action-command news-group-buffer:next-thread
- news-group-buffer:ignore-thread)))
+ news-group-buffer:ignore-thread)
+ (news-group:close-database (news-group-buffer:group (current-buffer)))))
(define (news-article-header-motion-command select-next)
(news-article-header-action-command select-next #f))
#f
(ref-variable news-split-threads-on-subject-changes buffer)
(ref-variable news-join-threads-with-same-subject buffer))))
+ (news-group:close-database group)
(message msg "done")
(list->vector
(if (or (command-argument-multiplier-only? argument)
(if (not (ref-variable news-group-show-seen-headers buffer))
;; Read in the headers -- this finds the headers to be ignored
;; and marks them as such.
- (news-group:get-headers group #f buffer)))
+ (news-group:get-headers group #f buffer))
+ (news-group:close-database group))
\f
(define (article-number-seen! group number)
(set-news-group:ranges-deleted!
buffer))
(news-header:ignore? header)))))
news-header:article-deleted?))
+ (news-group:close-database group)
(message msg "done")))
(define (news-group:number-of-articles group)