T-gnus 6.15.18 revision 00.
[elisp/gnus.git-] / lisp / gnus-cache.el
index 69dc0d7..e9733a2 100644 (file)
@@ -1,5 +1,5 @@
 ;;; gnus-cache.el --- cache interface for Gnus
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -183,7 +183,8 @@ it's not cached."
            (when (> (buffer-size) 0)
              (gnus-write-buffer-as-coding-system
               gnus-cache-write-file-coding-system file)
-             (setq headers (nnheader-parse-head t))
+             (nnheader-remove-body)
+             (setq headers (nnheader-parse-naked-head))
              (mail-header-set-number headers number)
              (gnus-cache-change-buffer group)
              (set-buffer (cdr gnus-cache-buffer))
@@ -342,7 +343,7 @@ Returns the list of articles entered."
     (gnus-summary-position-point)
     (nreverse out)))
 
-(defun gnus-cache-remove-article (n)
+(defun gnus-cache-remove-article (&optional n)
   "Remove the next N articles from the cache.
 If not given a prefix, use the process marked articles instead.
 Returns the list of articles removed."
@@ -367,15 +368,10 @@ Returns the list of articles removed."
 (defun gnus-summary-insert-cached-articles ()
   "Insert all the articles cached for this group into the current buffer."
   (interactive)
-  (let ((cached gnus-newsgroup-cached)
-       (gnus-verbose (max 6 gnus-verbose)))
-    (if (not cached)
+  (let ((gnus-verbose (max 6 gnus-verbose)))
+    (if (not gnus-newsgroup-cached)
        (gnus-message 3 "No cached articles for this group")
-      (save-excursion
-       (while cached
-         (gnus-summary-goto-subject (pop cached) t)))
-      (gnus-summary-limit (append gnus-newsgroup-cached gnus-newsgroup-limit))
-      (gnus-summary-position-point))))
+      (gnus-summary-goto-subjects gnus-newsgroup-cached))))
 
 (defun gnus-summary-limit-include-cached ()
   "Limit the summary buffer to articles that are cached."
@@ -471,8 +467,7 @@ Returns the list of articles removed."
        (when (or (looking-at (concat (int-to-string number) "\t"))
                  (search-forward (concat "\n" (int-to-string number) "\t")
                                  (point-max) t))
-         (delete-region (progn (beginning-of-line) (point))
-                        (progn (forward-line 1) (point)))))
+         (gnus-delete-line)))
       (unless (setq gnus-newsgroup-cached
                    (delq article gnus-newsgroup-cached))
        (gnus-sethash gnus-newsgroup-name nil gnus-cache-active-hashtb)
@@ -522,7 +517,7 @@ Returns the list of articles removed."
       (set-buffer cache-buf)
       (if (search-forward (concat "\n" (int-to-string (car cached)) "\t")
                          nil t)
-         (setq beg (progn (beginning-of-line) (point))
+         (setq beg (gnus-point-at-bol)
                end (progn (end-of-line) (point)))
        (setq beg nil))
       (set-buffer nntp-server-buffer)