X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-bcklg.el;h=d9934e5876cffb953761872e1033bc4ea8812232;hb=9954729d205c97242f0787c79dc23e7b051a6201;hp=33019e2dee5ae7836bf51756b4cab4a0979e5b0d;hpb=8f22dc3866405e2211e7d6201491100371c3cd9a;p=gnus diff --git a/lisp/gnus-bcklg.el b/lisp/gnus-bcklg.el index 33019e2de..d9934e587 100644 --- a/lisp/gnus-bcklg.el +++ b/lisp/gnus-bcklg.el @@ -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 +;; Author: Lars Magne Ingebrigtsen ;; 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) @@ -65,18 +67,19 @@ gnus-backlog-hashtb)) b) (if (memq ident gnus-backlog-articles) - () ; It's already kept. + () ; It's already kept. ;; Remove the oldest article, if necessary. (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. @@ -87,7 +90,7 @@ (set-buffer (gnus-backlog-buffer)) (goto-char (point-min)) (if (zerop (buffer-size)) - () ; The buffer is empty. + () ; The buffer is empty. (let ((ident (get-text-property (point) 'gnus-backlog)) buffer-read-only) ;; Remove the ident from the list of articles. @@ -119,7 +122,8 @@ (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)