*** empty log message ***
[gnus] / lisp / gnus-bcklg.el
index 3024481..d9934e5 100644 (file)
@@ -1,7 +1,7 @@
 ;;; gnus-bcklg.el --- backlog functions for Gnus
-;; Copyright (C) 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1996,97,98 Free Software Foundation, Inc.
 
-;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
 
 ;; This file is part of GNU Emacs.
@@ -25,7 +25,9 @@
 
 ;;; Code:
 
-(require 'gnus-load)
+(eval-when-compile (require 'cl))
+
+(require 'gnus)
 
 ;;;
 ;;; Buffering of read articles.
@@ -48,7 +50,7 @@
 (defun gnus-backlog-setup ()
   "Initialize backlog variables."
   (unless gnus-backlog-hashtb
-    (setq gnus-backlog-hashtb (make-vector 1023 0))))
+    (setq gnus-backlog-hashtb (gnus-make-hashtable 1024))))
 
 (gnus-add-shutdown 'gnus-backlog-shutdown 'gnus)
 
       (and (numberp gnus-keep-backlog)
           (>= (length gnus-backlog-articles) gnus-keep-backlog)
           (gnus-backlog-remove-oldest-article))
-      (setq gnus-backlog-articles (cons ident gnus-backlog-articles))
+      (push ident gnus-backlog-articles)
       ;; Insert the new article.
       (save-excursion
        (set-buffer (gnus-backlog-buffer))
        (let (buffer-read-only)
          (goto-char (point-max))
-         (or (bolp) (insert "\n"))
+         (unless (bolp)
+           (insert "\n"))
          (setq b (point))
          (insert-buffer-substring buffer)
          ;; Tag the beginning of the article with the ident.
                     (1+ beg) 'gnus-backlog (current-buffer) (point-max)))
              (delete-region beg end)
              ;; Return success.
-             t)))))))
+             t))
+         (setq gnus-backlog-articles (delq ident gnus-backlog-articles)))))))
 
 (defun gnus-backlog-request-article (group number buffer)
   (when (numberp number)