;;; 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>
(when (> (buffer-size) 0)
(let ((coding-system-for-write gnus-cache-coding-system))
(gnus-write-buffer 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))
(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."
(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."
(interactive)
(let ((gnus-verbose (max 6 gnus-verbose)))
(if gnus-newsgroup-cached
- (progn
- (gnus-summary-limit gnus-newsgroup-cached)
- (gnus-summary-position-point))
- (gnus-message 3 "No cached articles for this group"))))
+ (progn
+ (gnus-summary-limit gnus-newsgroup-cached)
+ (gnus-summary-position-point))
+ (gnus-message 3 "No cached articles for this group"))))
;;; Internal functions.
(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)
(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)
(string-match gnus-cacheable-groups group))
(or (not gnus-uncacheable-groups)
(not (string-match gnus-uncacheable-groups group)))))))
-
(provide 'gnus-cache)