;;; gnus-cache.el --- cache interface for Gnus
;; Copyright (C) 1995,96,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.
(eval-when-compile
(require 'gnus-sum))
-(defgroup gnus-cache nil
- "Cache interface."
- :group 'gnus)
-
-(defcustom gnus-cache-directory
- (nnheader-concat gnus-directory "cache/")
- "*The directory where cached articles will be stored."
- :group 'gnus-cache
- :type 'directory)
-
(defcustom gnus-cache-active-file
(concat (file-name-as-directory gnus-cache-directory) "active")
"*The cache active file."
:type 'file)
(defcustom gnus-cache-enter-articles '(ticked dormant)
- "*Classes of articles to enter into the cache."
+ "Classes of articles to enter into the cache."
:group 'gnus-cache
:type '(set (const ticked) (const dormant) (const unread) (const read)))
(defcustom gnus-cache-remove-articles '(read)
- "*Classes of articles to remove from the cache."
+ "Classes of articles to remove from the cache."
:group 'gnus-cache
:type '(set (const ticked) (const dormant) (const unread) (const read)))
(let ((articles (gnus-summary-work-articles n))
article out)
(while (setq article (pop articles))
+ (gnus-summary-remove-process-mark article)
(if (natnump article)
(when (gnus-cache-possibly-enter-article
gnus-newsgroup-name article
nil nil nil t)
(push article out))
(gnus-message 2 "Can't cache article %d" article))
- (gnus-summary-remove-process-mark article)
(gnus-summary-update-secondary-mark article))
(gnus-summary-next-subject 1)
(gnus-summary-position-point)
article out)
(while articles
(setq article (pop articles))
+ (gnus-summary-remove-process-mark article)
(when (gnus-cache-possibly-remove-article article nil nil nil t)
(push article out))
- (gnus-summary-remove-process-mark article)
(gnus-summary-update-secondary-mark article))
(gnus-summary-next-subject 1)
(gnus-summary-position-point)
;; Translate the first colon into a slash.
(when (string-match ":" group)
(aset group (match-beginning 0) ?/))
- (nnheader-replace-chars-in-string group ?. ?/)))))
+ (nnheader-replace-chars-in-string group ?. ?/)))
+ t))
(if (stringp article) article (int-to-string article))))
(defun gnus-cache-update-article (group article)
(if top
""
(string-match
- (concat "^" (file-name-as-directory
- (expand-file-name gnus-cache-directory)))
+ (concat "^" (regexp-quote
+ (file-name-as-directory
+ (expand-file-name gnus-cache-directory))))
(directory-file-name directory))
(nnheader-replace-chars-in-string
(substring (directory-file-name directory) (match-end 0))