1 ;;; gnus-cache.el --- cache interface for Gnus
2 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 ;; Free Software Foundation, Inc.
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
7 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
31 (eval-when-compile (require 'cl))
38 (if (not (fboundp 'gnus-agent-load-alist))
39 (defun gnus-agent-load-alist (group)))
42 (defcustom gnus-cache-active-file
43 (expand-file-name "active" gnus-cache-directory)
44 "*The cache active file."
48 (defcustom gnus-cache-enter-articles '(ticked dormant)
49 "Classes of articles to enter into the cache."
51 :type '(set (const ticked) (const dormant) (const unread) (const read)))
53 (defcustom gnus-cache-remove-articles '(read)
54 "Classes of articles to remove from the cache."
56 :type '(set (const ticked) (const dormant) (const unread) (const read)))
58 (defcustom gnus-cacheable-groups nil
59 "*Groups that match this regexp will be cached.
61 If you only want to cache your nntp groups, you could set this
62 variable to \"^nntp\".
64 If a group matches both gnus-cacheable-groups and gnus-uncacheable-groups
67 :type '(choice (const :tag "off" nil)
70 (defcustom gnus-uncacheable-groups nil
71 "*Groups that match this regexp will not be cached.
73 If you want to avoid caching your nnml groups, you could set this
74 variable to \"^nnml\".
76 If a group matches both gnus-cacheable-groups and gnus-uncacheable-groups
79 :type '(choice (const :tag "off" nil)
82 (defvar gnus-cache-overview-coding-system 'raw-text
83 "Coding system used on Gnus cache files.")
85 (defvar gnus-cache-coding-system 'raw-text
86 "Coding system used on Gnus cache files.")
90 ;;; Internal variables.
92 (defvar gnus-cache-removable-articles nil)
93 (defvar gnus-cache-buffer nil)
94 (defvar gnus-cache-active-hashtb nil)
95 (defvar gnus-cache-active-altered nil)
96 (defvar gnus-cache-write-file-coding-system 'raw-text)
99 (autoload 'nnml-generate-nov-databases-1 "nnml")
100 (autoload 'nnvirtual-find-group-art "nnvirtual"))
104 ;;; Functions called from Gnus.
106 (defun gnus-cache-open ()
107 "Initialize the cache."
108 (when (or (file-exists-p gnus-cache-directory)
110 (not (eq gnus-use-cache 'passive))))
111 (gnus-cache-read-active)))
113 ;; Complexities of byte-compiling make this kludge necessary. Eeek.
115 (gnus-add-shutdown 'gnus-cache-close 'gnus))
117 (defun gnus-cache-close ()
118 "Shut down the cache."
119 (gnus-cache-write-active)
120 (gnus-cache-save-buffers)
121 (setq gnus-cache-active-hashtb nil))
123 (defun gnus-cache-save-buffers ()
124 ;; save the overview buffer if it exists and has been modified
125 ;; delete empty cache subdirectories
126 (when gnus-cache-buffer
127 (let ((buffer (cdr gnus-cache-buffer))
128 (overview-file (gnus-cache-file-name
129 (car gnus-cache-buffer) ".overview")))
130 ;; write the overview only if it was modified
131 (when (buffer-modified-p buffer)
134 (if (> (buffer-size) 0)
135 ;; Non-empty overview, write it to a file.
136 (gnus-write-buffer-as-coding-system
137 gnus-cache-overview-coding-system overview-file)
138 ;; Empty overview file, remove it
139 (when (file-exists-p overview-file)
140 (delete-file overview-file))
141 ;; If possible, remove group's cache subdirectory.
143 ;; FIXME: we can detect the error type and warn the user
144 ;; of any inconsistencies (articles w/o nov entries?).
145 ;; for now, just be conservative...delete only if safe -- sj
146 (delete-directory (file-name-directory overview-file))
148 ;; Kill the buffer -- it's either unmodified or saved.
149 (gnus-kill-buffer buffer)
150 (setq gnus-cache-buffer nil))))
152 (defun gnus-cache-possibly-enter-article
153 (group article headers ticked dormant unread &optional force)
154 (when (and (or force (not (eq gnus-use-cache 'passive)))
156 (> article 0) ; This might be a dummy article.
158 (let ((number article) file)
159 ;; If this is a virtual group, we find the real group.
160 (when (gnus-virtual-group-p group)
161 (let ((result (nnvirtual-find-group-art
162 (gnus-group-real-name group) article)))
163 (setq group (car result)
164 number (cdr result))))
166 (> number 0) ; Reffed article.
168 (and (gnus-cache-fully-p group)
169 (gnus-cache-member-of-class
170 gnus-cache-enter-articles ticked dormant unread)))
171 (not (file-exists-p (setq file (gnus-cache-file-name
173 ;; Possibly create the cache directory.
174 (gnus-make-directory (file-name-directory file))
175 ;; Save the article in the cache.
176 (if (file-exists-p file)
177 t ; The article already is saved.
179 (set-buffer nntp-server-buffer)
181 (let ((gnus-use-cache nil)
182 (gnus-article-decode-hook nil))
183 (gnus-request-article-this-buffer number group))
184 (when (> (buffer-size) 0)
185 (gnus-write-buffer-as-coding-system
186 gnus-cache-write-file-coding-system file)
187 (nnheader-remove-body)
188 (setq headers (nnheader-parse-naked-head))
189 (mail-header-set-number headers number)
190 (gnus-cache-change-buffer group)
191 (set-buffer (cdr gnus-cache-buffer))
192 (goto-char (point-max))
194 (while (condition-case ()
196 (> (read (current-buffer)) number))
198 ;; The line was malformed, so we just remove it!!
206 (when (< (read (current-buffer)) number)
211 (nnheader-insert-nov headers)
212 ;; Update the active info.
213 (set-buffer gnus-summary-buffer)
214 (gnus-cache-possibly-update-active group (cons number number))
215 (setq gnus-newsgroup-cached
216 (gnus-add-to-sorted-list gnus-newsgroup-cached article))
217 (gnus-summary-update-secondary-mark article))
220 (defun gnus-cache-enter-remove-article (article)
221 "Mark ARTICLE for later possible removal."
223 (push article gnus-cache-removable-articles)))
225 (defun gnus-cache-possibly-remove-articles ()
226 "Possibly remove some of the removable articles."
227 (if (not (gnus-virtual-group-p gnus-newsgroup-name))
228 (gnus-cache-possibly-remove-articles-1)
229 (let ((arts gnus-cache-removable-articles)
232 (when (setq ga (nnvirtual-find-group-art
233 (gnus-group-real-name gnus-newsgroup-name) (pop arts)))
234 (let ((gnus-cache-removable-articles (list (cdr ga)))
235 (gnus-newsgroup-name (car ga)))
236 (gnus-cache-possibly-remove-articles-1)))))
237 (setq gnus-cache-removable-articles nil)))
239 (defun gnus-cache-possibly-remove-articles-1 ()
240 "Possibly remove some of the removable articles."
241 (when (gnus-cache-fully-p gnus-newsgroup-name)
242 (let ((articles gnus-cache-removable-articles)
243 (cache-articles gnus-newsgroup-cached)
245 (gnus-cache-change-buffer gnus-newsgroup-name)
247 (when (memq (setq article (pop articles)) cache-articles)
248 ;; The article was in the cache, so we see whether we are
249 ;; supposed to remove it from the cache.
250 (gnus-cache-possibly-remove-article
251 article (memq article gnus-newsgroup-marked)
252 (memq article gnus-newsgroup-dormant)
253 (or (memq article gnus-newsgroup-unreads)
254 (memq article gnus-newsgroup-unselected))))))
255 ;; The overview file might have been modified, save it
256 ;; safe because we're only called at group exit anyway.
257 (gnus-cache-save-buffers)))
259 (defun gnus-cache-request-article (article group)
260 "Retrieve ARTICLE in GROUP from the cache."
261 (let ((file (gnus-cache-file-name group article))
262 (buffer-read-only nil))
263 (when (file-exists-p file)
265 (gnus-kill-all-overlays)
266 (let ((nnheader-file-coding-system gnus-cache-coding-system))
267 (nnheader-insert-file-contents file))
270 (defun gnus-cache-possibly-alter-active (group active)
271 "Alter the ACTIVE info for GROUP to reflect the articles in the cache."
272 (when gnus-cache-active-hashtb
273 (let ((cache-active (gnus-gethash group gnus-cache-active-hashtb)))
275 (when (< (car cache-active) (car active))
276 (setcar active (car cache-active)))
277 (when (> (cdr cache-active) (cdr active))
278 (setcdr active (cdr cache-active)))))))
280 (defun gnus-cache-retrieve-headers (articles group &optional fetch-old)
281 "Retrieve the headers for ARTICLES in GROUP."
283 (setq gnus-newsgroup-cached (gnus-cache-articles-in-group group))))
285 ;; No cached articles here, so we just retrieve them
287 (let ((gnus-use-cache nil))
288 (gnus-retrieve-headers articles group fetch-old))
289 (let ((uncached-articles (gnus-sorted-difference articles cached))
290 (cache-file (gnus-cache-file-name group ".overview"))
292 ;; We first retrieve all the headers that we don't have in
294 (let ((gnus-use-cache nil))
295 (when uncached-articles
296 (setq type (and articles
297 (gnus-retrieve-headers
298 uncached-articles group fetch-old)))))
299 (gnus-cache-save-buffers)
300 ;; Then we insert the cached headers.
303 ((not (file-exists-p cache-file))
304 ;; There are no cached headers.
307 ;; There were no uncached headers (or retrieval was
308 ;; unsuccessful), so we use the cached headers exclusively.
309 (set-buffer nntp-server-buffer)
311 (let ((nnheader-file-coding-system
312 gnus-cache-overview-coding-system))
313 (nnheader-insert-file-contents cache-file))
316 ;; We have both cached and uncached NOV headers, so we
318 (gnus-cache-braid-nov group cached)
322 (gnus-cache-braid-heads group (gnus-sorted-intersection
326 (defun gnus-cache-enter-article (&optional n)
327 "Enter the next N articles into the cache.
328 If not given a prefix, use the process marked articles instead.
329 Returns the list of articles entered."
331 (let ((articles (gnus-summary-work-articles n))
333 (while (setq article (pop articles))
334 (gnus-summary-remove-process-mark article)
335 (if (natnump article)
336 (when (gnus-cache-possibly-enter-article
337 gnus-newsgroup-name article
338 (gnus-summary-article-header article)
340 (setq gnus-newsgroup-undownloaded (delq article gnus-newsgroup-undownloaded))
342 (gnus-message 2 "Can't cache article %d" article))
343 (gnus-summary-update-download-mark article)
344 (gnus-summary-update-secondary-mark article))
345 (gnus-summary-next-subject 1)
346 (gnus-summary-position-point)
349 (defun gnus-cache-remove-article (&optional n)
350 "Remove the next N articles from the cache.
351 If not given a prefix, use the process marked articles instead.
352 Returns the list of articles removed."
354 (gnus-cache-change-buffer gnus-newsgroup-name)
355 (let ((articles (gnus-summary-work-articles n))
358 (setq article (pop articles))
359 (gnus-summary-remove-process-mark article)
360 (when (gnus-cache-possibly-remove-article article nil nil nil t)
361 (when gnus-newsgroup-agentized
362 (let ((alist (gnus-agent-load-alist gnus-newsgroup-name)))
363 (unless (cdr (assoc article alist))
364 (setq gnus-newsgroup-undownloaded
365 (gnus-add-to-sorted-list
366 gnus-newsgroup-undownloaded article)))))
368 (gnus-summary-update-download-mark article)
369 (gnus-summary-update-secondary-mark article))
370 (gnus-summary-next-subject 1)
371 (gnus-summary-position-point)
374 (defun gnus-cached-article-p (article)
375 "Say whether ARTICLE is cached in the current group."
376 (memq article gnus-newsgroup-cached))
378 (defun gnus-summary-insert-cached-articles ()
379 "Insert all the articles cached for this group into the current buffer."
381 (let ((gnus-verbose (max 6 gnus-verbose)))
382 (if (not gnus-newsgroup-cached)
383 (gnus-message 3 "No cached articles for this group")
384 (gnus-summary-goto-subjects gnus-newsgroup-cached))))
386 (defun gnus-summary-limit-include-cached ()
387 "Limit the summary buffer to articles that are cached."
389 (let ((gnus-verbose (max 6 gnus-verbose)))
390 (if gnus-newsgroup-cached
392 (gnus-summary-limit gnus-newsgroup-cached)
393 (gnus-summary-position-point))
394 (gnus-message 3 "No cached articles for this group"))))
396 ;;; Internal functions.
398 (defun gnus-cache-change-buffer (group)
399 (and gnus-cache-buffer
400 ;; See if the current group's overview cache has been loaded.
401 (or (string= group (car gnus-cache-buffer))
402 ;; Another overview cache is current, save it.
403 (gnus-cache-save-buffers)))
404 ;; if gnus-cache buffer is nil, create it
405 (unless gnus-cache-buffer
406 ;; Create cache buffer
408 (setq gnus-cache-buffer
410 (set-buffer (gnus-get-buffer-create
411 " *gnus-cache-overview*"))))
412 ;; Insert the contents of this group's cache overview.
414 (let ((file (gnus-cache-file-name group ".overview")))
415 (when (file-exists-p file)
416 (nnheader-insert-file-contents file)))
417 ;; We have a fresh (empty/just loaded) buffer,
418 ;; mark it as unmodified to save a redundant write later.
419 (set-buffer-modified-p nil))))
421 ;; Return whether an article is a member of a class.
422 (defun gnus-cache-member-of-class (class ticked dormant unread)
423 (or (and ticked (memq 'ticked class))
424 (and dormant (memq 'dormant class))
425 (and unread (memq 'unread class))
426 (and (not unread) (not ticked) (not dormant) (memq 'read class))))
428 (defun gnus-cache-file-name (group article)
430 (if (stringp article) article (int-to-string article))
431 (file-name-as-directory
433 (nnheader-translate-file-chars
434 (if (gnus-use-long-file-name 'not-cache)
436 (let ((group (nnheader-replace-duplicate-chars-in-string
437 (nnheader-replace-chars-in-string group ?/ ?_)
439 ;; Translate the first colon into a slash.
440 (when (string-match ":" group)
441 (setq group (concat (substring group 0 (match-beginning 0))
442 "/" (substring group (match-end 0)))))
443 (nnheader-replace-chars-in-string group ?. ?/)))
445 gnus-cache-directory))))
447 (defun gnus-cache-update-article (group article)
448 "If ARTICLE is in the cache, remove it and re-enter it."
449 (gnus-cache-change-buffer group)
450 (when (gnus-cache-possibly-remove-article article nil nil nil t)
451 (let ((gnus-use-cache nil))
452 (gnus-cache-possibly-enter-article
453 gnus-newsgroup-name article (gnus-summary-article-header article)
456 (defun gnus-cache-possibly-remove-article (article ticked dormant unread
458 "Possibly remove ARTICLE from the cache."
459 (let ((group gnus-newsgroup-name)
462 ;; If this is a virtual group, we find the real group.
463 (when (gnus-virtual-group-p group)
464 (let ((result (nnvirtual-find-group-art
465 (gnus-group-real-name group) article)))
466 (setq group (car result)
467 number (cdr result))))
468 (setq file (gnus-cache-file-name group number))
469 (when (and (file-exists-p file)
471 (gnus-cache-member-of-class
472 gnus-cache-remove-articles ticked dormant unread)))
475 (set-buffer (cdr gnus-cache-buffer))
476 (goto-char (point-min))
477 (when (or (looking-at (concat (int-to-string number) "\t"))
478 (search-forward (concat "\n" (int-to-string number) "\t")
481 (unless (setq gnus-newsgroup-cached
482 (delq article gnus-newsgroup-cached))
483 (gnus-sethash gnus-newsgroup-name nil gnus-cache-active-hashtb)
484 (setq gnus-cache-active-altered t))
485 (gnus-summary-update-secondary-mark article)
488 (defun gnus-cache-articles-in-group (group)
489 "Return a sorted list of cached articles in GROUP."
490 (let ((dir (file-name-directory (gnus-cache-file-name group 1)))
492 (when (file-exists-p dir)
494 (sort (mapcar (lambda (name) (string-to-int name))
495 (directory-files dir nil "^[0-9]+$" t))
497 ;; Update the cache active file, just to synch more.
500 (gnus-cache-update-active group (car articles) t)
501 (gnus-cache-update-active group (car (last articles))))
502 (when (gnus-gethash group gnus-cache-active-hashtb)
503 (gnus-sethash group nil gnus-cache-active-hashtb)
504 (setq gnus-cache-active-altered t)))
507 (defun gnus-cache-braid-nov (group cached &optional file)
508 (let ((cache-buf (gnus-get-buffer-create " *gnus-cache*"))
510 (gnus-cache-save-buffers)
512 (set-buffer cache-buf)
514 (let ((nnheader-file-coding-system gnus-cache-overview-coding-system))
515 (nnheader-insert-file-contents
516 (or file (gnus-cache-file-name group ".overview"))))
517 (goto-char (point-min))
519 (goto-char (point-min)))
520 (set-buffer nntp-server-buffer)
521 (goto-char (point-min))
523 (while (and (not (eobp))
524 (< (read (current-buffer)) (car cached)))
527 (set-buffer cache-buf)
528 (if (search-forward (concat "\n" (int-to-string (car cached)) "\t")
530 (setq beg (point-at-bol)
531 end (progn (end-of-line) (point)))
533 (set-buffer nntp-server-buffer)
535 (insert-buffer-substring cache-buf beg end)
537 (setq cached (cdr cached)))
538 (kill-buffer cache-buf)))
540 (defun gnus-cache-braid-heads (group cached)
541 (let ((cache-buf (gnus-get-buffer-create " *gnus-cache*")))
543 (set-buffer cache-buf)
545 (set-buffer nntp-server-buffer)
546 (goto-char (point-min))
548 (while (and (not (eobp))
549 (looking-at "2.. +\\([0-9]+\\) ")
550 (< (progn (goto-char (match-beginning 1))
551 (read (current-buffer)))
553 (search-forward "\n.\n" nil 'move))
556 (set-buffer cache-buf)
558 (let ((nnheader-file-coding-system gnus-cache-coding-system))
559 (nnheader-insert-file-contents
560 (gnus-cache-file-name group (car cached))))
561 (goto-char (point-min))
563 (princ (car cached) (current-buffer))
564 (insert " Article retrieved.\n")
565 (search-forward "\n\n" nil 'move)
566 (delete-region (point) (point-max))
569 (insert-buffer-substring cache-buf)
570 (setq cached (cdr cached)))
571 (kill-buffer cache-buf)))
574 (defun gnus-jog-cache ()
575 "Go through all groups and put the articles into the cache.
578 $ emacs -batch -l ~/.emacs -l gnus -f gnus-jog-cache"
580 (let ((gnus-mark-article-hook nil)
582 (nnmail-spool-file nil)
584 (gnus-use-dribble-file nil)
585 (gnus-novice-user nil)
586 (gnus-large-newsgroup nil))
589 ;; Go through all groups...
590 (gnus-group-mark-buffer)
591 (gnus-group-iterate nil
593 (let (gnus-auto-select-next)
594 (gnus-summary-read-group group nil t)
595 ;; ... and enter the articles into the cache.
596 (when (eq major-mode 'gnus-summary-mode)
597 (gnus-uu-mark-buffer)
598 (gnus-cache-enter-article)
599 (kill-buffer (current-buffer))))))))
601 (defun gnus-cache-read-active (&optional force)
602 "Read the cache active file."
603 (gnus-make-directory gnus-cache-directory)
604 (if (or (not (file-exists-p gnus-cache-active-file))
605 (zerop (nth 7 (file-attributes gnus-cache-active-file)))
607 ;; There is no active file, so we generate one.
608 (gnus-cache-generate-active)
609 ;; We simply read the active file.
611 (gnus-set-work-buffer)
612 (nnheader-insert-file-contents gnus-cache-active-file)
613 (gnus-active-to-gnus-format
614 nil (setq gnus-cache-active-hashtb
616 (count-lines (point-min) (point-max)))))
617 (setq gnus-cache-active-altered nil))))
619 (defun gnus-cache-write-active (&optional force)
620 "Write the active hashtb to the active file."
622 (and gnus-cache-active-hashtb
623 gnus-cache-active-altered))
624 (gnus-write-active-file gnus-cache-active-file gnus-cache-active-hashtb t)
625 ;; Mark the active hashtb as unaltered.
626 (setq gnus-cache-active-altered nil)))
628 (defun gnus-cache-possibly-update-active (group active)
629 "Update active info bounds of GROUP with ACTIVE if necessary.
630 The update is performed if ACTIVE contains a higher or lower bound
632 (let ((lower t) (higher t))
633 (if gnus-cache-active-hashtb
634 (let ((cache-active (gnus-gethash group gnus-cache-active-hashtb)))
636 (unless (< (car active) (car cache-active))
638 (unless (> (cdr active) (cdr cache-active))
640 (gnus-cache-read-active))
642 (gnus-cache-update-active group (car active) t))
644 (gnus-cache-update-active group (cdr active)))))
646 (defun gnus-cache-update-active (group number &optional low)
647 "Update the upper bound of the active info of GROUP to NUMBER.
648 If LOW, update the lower bound instead."
649 (let ((active (gnus-gethash group gnus-cache-active-hashtb)))
651 ;; We just create a new active entry for this group.
652 (gnus-sethash group (cons number number) gnus-cache-active-hashtb)
653 ;; Update the lower or upper bound.
655 (setcar active number)
656 (setcdr active number)))
657 ;; Mark the active hashtb as altered.
658 (setq gnus-cache-active-altered t)))
661 (defun gnus-cache-generate-active (&optional directory)
662 "Generate the cache active file."
664 (let* ((top (null directory))
665 (directory (expand-file-name (or directory gnus-cache-directory)))
666 (files (directory-files directory 'full))
671 (concat "^" (regexp-quote
672 (file-name-as-directory
673 (expand-file-name gnus-cache-directory))))
674 (directory-file-name directory))
675 (nnheader-replace-chars-in-string
676 (substring (directory-file-name directory) (match-end 0))
680 (gnus-message 5 "Generating the cache active file...")
681 (setq gnus-cache-active-hashtb (gnus-make-hashtable 123)))
682 (when (string-match "^\\(nn[^_]+\\)_" group)
683 (setq group (replace-match "\\1:" t nil group)))
684 ;; Separate articles from all other files and directories.
686 (if (string-match "^[0-9]+$" (file-name-nondirectory (car files)))
687 (push (string-to-int (file-name-nondirectory (pop files))) nums)
688 (push (pop files) alphs)))
689 ;; If we have nums, then this is probably a valid group.
690 (when (setq nums (sort nums '<))
691 (gnus-sethash group (cons (car nums) (gnus-last-element nums))
692 gnus-cache-active-hashtb))
693 ;; Go through all the other files.
695 (when (and (file-directory-p (car alphs))
696 (not (string-match "^\\."
697 (file-name-nondirectory (car alphs)))))
698 ;; We descend directories.
699 (gnus-cache-generate-active (car alphs)))
700 (setq alphs (cdr alphs)))
701 ;; Write the new active file.
703 (gnus-cache-write-active t)
704 (gnus-message 5 "Generating the cache active file...done"))))
707 (defun gnus-cache-generate-nov-databases (dir)
708 "Generate NOV files recursively starting in DIR."
709 (interactive (list gnus-cache-directory))
711 (let ((nnml-generate-active-function 'identity))
712 (nnml-generate-nov-databases-1 dir))
715 (defun gnus-cache-move-cache (dir)
716 "Move the cache tree to somewhere else."
717 (interactive "FMove the cache tree to: ")
718 (rename-file gnus-cache-directory dir))
720 (defun gnus-cache-fully-p (&optional group)
721 "Returns non-nil if the cache should be fully used.
722 If GROUP is non-nil, also cater to `gnus-cacheable-groups' and
723 `gnus-uncacheable-groups'."
725 (not (eq gnus-use-cache 'passive))
728 (and (or (not gnus-cacheable-groups)
729 (string-match gnus-cacheable-groups group))
730 (or (not gnus-uncacheable-groups)
731 (not (string-match gnus-uncacheable-groups group)))))))
733 (provide 'gnus-cache)
735 ;;; gnus-cache.el ends here