*** empty log message ***
[gnus] / lisp / gnus-cache.el
1 ;;; gnus-cache.el --- cache interface for Gnus
2 ;; Copyright (C) 1995,96 Free Software Foundation, Inc.
3
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
5 ;; Keywords: news
6
7 ;; This file is part of GNU Emacs.
8
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; any later version.
13
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ;; GNU General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
23
24 ;;; Commentary:
25
26 ;;; Code:
27
28 (require 'gnus-load)
29 (require 'gnus-int)
30 (require 'gnus-range)
31 (require 'gnus-sum)
32 (require 'gnus-start)
33 (require 'gnus)
34
35 (defvar gnus-cache-directory
36   (nnheader-concat gnus-directory "cache/")
37   "*The directory where cached articles will be stored.")
38
39 (defvar gnus-cache-active-file 
40   (concat (file-name-as-directory gnus-cache-directory) "active")
41   "*The cache active file.")
42
43 (defvar gnus-cache-enter-articles '(ticked dormant)
44   "*Classes of articles to enter into the cache.")
45
46 (defvar gnus-cache-remove-articles '(read)
47   "*Classes of articles to remove from the cache.")
48
49 (defvar gnus-uncacheable-groups nil
50   "*Groups that match this regexp will not be cached.
51
52 If you want to avoid caching your nnml groups, you could set this
53 variable to \"^nnml\".")
54
55 \f
56
57 ;;; Internal variables.
58
59 (defvar gnus-cache-removable-articles nil)
60 (defvar gnus-cache-buffer nil)
61 (defvar gnus-cache-active-hashtb nil)
62 (defvar gnus-cache-active-altered nil)
63
64 (eval-and-compile
65   (autoload 'nnml-generate-nov-databases-1 "nnml")
66   (autoload 'nnvirtual-find-group-art "nnvirtual"))
67
68 \f
69
70 ;;; Functions called from Gnus.
71
72 (defun gnus-cache-open ()
73   "Initialize the cache."
74   (when (or (file-exists-p gnus-cache-directory)
75             (and gnus-use-cache
76                  (not (eq gnus-use-cache 'passive))))
77     (gnus-cache-read-active)))
78
79 (condition-case ()
80     (gnus-add-shutdown 'gnus-cache-close 'gnus)
81   ;; Complexities of byte-compiling makes this kludge necessary.  Eeek.
82   (error nil))
83
84 (defun gnus-cache-close ()
85   "Shut down the cache."
86   (gnus-cache-write-active)
87   (gnus-cache-save-buffers)
88   (setq gnus-cache-active-hashtb nil))
89
90 (defun gnus-cache-save-buffers ()
91   ;; save the overview buffer if it exists and has been modified
92   ;; delete empty cache subdirectories
93   (if (null gnus-cache-buffer)
94       ()
95     (let ((buffer (cdr gnus-cache-buffer))
96           (overview-file (gnus-cache-file-name
97                           (car gnus-cache-buffer) ".overview")))
98       ;; write the overview only if it was modified
99       (if (buffer-modified-p buffer)
100           (save-excursion
101             (set-buffer buffer)
102             (if (> (buffer-size) 0)
103                 ;; non-empty overview, write it out
104                 (progn
105                   (make-directory (file-name-directory overview-file) t)
106                   (write-region (point-min) (point-max)
107                                 overview-file nil 'quietly))
108               ;; empty overview file, remove it
109               (and (file-exists-p overview-file)
110                    (delete-file overview-file))
111               ;; if possible, remove group's cache subdirectory
112               (condition-case nil
113                   ;; FIXME: we can detect the error type and warn the user
114                   ;; of any inconsistencies (articles w/o nov entries?).
115                   ;; for now, just be conservative...delete only if safe -- sj
116                   (delete-directory (file-name-directory overview-file))
117                 (error nil)))))
118       ;; kill the buffer, it's either unmodified or saved
119       (gnus-kill-buffer buffer)
120       (setq gnus-cache-buffer nil))))
121
122 (defun gnus-cache-possibly-enter-article 
123   (group article headers ticked dormant unread &optional force)
124   (when (and (or force (not (eq gnus-use-cache 'passive)))
125              (numberp article)
126              (> article 0)
127              (vectorp headers)) ; This might be a dummy article.
128     ;; If this is a virtual group, we find the real group.
129     (when (gnus-virtual-group-p group)
130       (let ((result (nnvirtual-find-group-art 
131                      (gnus-group-real-name group) article)))
132         (setq group (car result)
133               headers (copy-sequence headers))
134         (mail-header-set-number headers (cdr result))))
135     (let ((number (mail-header-number headers))
136           file dir)
137       (when (and (> number 0)           ; Reffed article.
138                  (or (not gnus-uncacheable-groups)
139                      (not (string-match gnus-uncacheable-groups group)))
140                  (or force
141                      (gnus-cache-member-of-class
142                       gnus-cache-enter-articles ticked dormant unread))
143                  (not (file-exists-p (setq file (gnus-cache-file-name
144                                                  group number)))))
145         ;; Possibly create the cache directory.
146         (or (file-exists-p (setq dir (file-name-directory file)))
147             (make-directory dir t))
148         ;; Save the article in the cache.
149         (if (file-exists-p file)
150             t                           ; The article already is saved.
151           (save-excursion
152             (set-buffer nntp-server-buffer)
153             (let ((gnus-use-cache nil))
154               (gnus-request-article-this-buffer number group))
155             (when (> (buffer-size) 0)
156               (write-region (point-min) (point-max) file nil 'quiet)
157               (gnus-cache-change-buffer group)
158               (set-buffer (cdr gnus-cache-buffer))
159               (goto-char (point-max))
160               (forward-line -1)
161               (while (condition-case ()
162                          (and (not (bobp))
163                               (> (read (current-buffer)) number))
164                        (error
165                         ;; The line was malformed, so we just remove it!!
166                         (gnus-delete-line)
167                         t))
168                 (forward-line -1))
169               (if (bobp) 
170                   (if (not (eobp))
171                       (progn
172                         (beginning-of-line)
173                         (if (< (read (current-buffer)) number)
174                             (forward-line 1)))
175                     (beginning-of-line))
176                 (forward-line 1))
177               (beginning-of-line)
178               ;; [number subject from date id references chars lines xref]
179               (insert (format "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t\n"
180                               (mail-header-number headers)
181                               (mail-header-subject headers)
182                               (mail-header-from headers)
183                               (mail-header-date headers)
184                               (mail-header-id headers)
185                               (or (mail-header-references headers) "")
186                               (or (mail-header-chars headers) "")
187                               (or (mail-header-lines headers) "")
188                               (or (mail-header-xref headers) "")))
189               ;; Update the active info.
190               (set-buffer gnus-summary-buffer)
191               (gnus-cache-update-active group number)
192               (push article gnus-newsgroup-cached)
193               (gnus-summary-update-secondary-mark article))
194             t))))))
195
196 (defun gnus-cache-enter-remove-article (article)
197   "Mark ARTICLE for later possible removal."
198   (when article
199     (push article gnus-cache-removable-articles)))
200
201 (defun gnus-cache-possibly-remove-articles ()
202   "Possibly remove some of the removable articles."
203   (if (not (gnus-virtual-group-p gnus-newsgroup-name))
204       (gnus-cache-possibly-remove-articles-1)
205     (let ((arts gnus-cache-removable-articles)
206           ga)
207       (while arts
208         (when (setq ga (nnvirtual-find-group-art
209                         (gnus-group-real-name gnus-newsgroup-name) (pop arts)))
210           (let ((gnus-cache-removable-articles (list (cdr ga)))
211                 (gnus-newsgroup-name (car ga)))
212             (gnus-cache-possibly-remove-articles-1)))))
213     (setq gnus-cache-removable-articles nil)))
214
215 (defun gnus-cache-possibly-remove-articles-1 ()
216   "Possibly remove some of the removable articles."
217   (unless (eq gnus-use-cache 'passive)
218     (let ((articles gnus-cache-removable-articles)
219           (cache-articles gnus-newsgroup-cached)
220           article)
221       (gnus-cache-change-buffer gnus-newsgroup-name)
222       (while articles
223         (if (memq (setq article (pop articles)) cache-articles)
224             ;; The article was in the cache, so we see whether we are
225             ;; supposed to remove it from the cache.
226             (gnus-cache-possibly-remove-article
227              article (memq article gnus-newsgroup-marked)
228              (memq article gnus-newsgroup-dormant)
229              (or (memq article gnus-newsgroup-unreads)
230                  (memq article gnus-newsgroup-unselected))))))
231     ;; The overview file might have been modified, save it
232     ;; safe because we're only called at group exit anyway.
233     (gnus-cache-save-buffers)))
234
235 (defun gnus-cache-request-article (article group)
236   "Retrieve ARTICLE in GROUP from the cache."
237   (let ((file (gnus-cache-file-name group article))
238         (buffer-read-only nil))
239     (when (file-exists-p file)
240       (erase-buffer)
241       (gnus-kill-all-overlays)
242       (insert-file-contents file)
243       t)))
244
245 (defun gnus-cache-possibly-alter-active (group active)
246   "Alter the ACTIVE info for GROUP to reflect the articles in the cache."
247   (when gnus-cache-active-hashtb
248     (let ((cache-active (gnus-gethash group gnus-cache-active-hashtb)))
249       (and cache-active 
250            (< (car cache-active) (car active))
251            (setcar active (car cache-active)))
252       (and cache-active
253            (> (cdr cache-active) (cdr active))
254            (setcdr active (cdr cache-active))))))
255
256 (defun gnus-cache-retrieve-headers (articles group &optional fetch-old)
257   "Retrieve the headers for ARTICLES in GROUP."
258   (let ((cached 
259          (setq gnus-newsgroup-cached (gnus-cache-articles-in-group group))))
260     (if (not cached)
261         ;; No cached articles here, so we just retrieve them
262         ;; the normal way.
263         (let ((gnus-use-cache nil))
264           (gnus-retrieve-headers articles group fetch-old))
265       (let ((uncached-articles (gnus-sorted-intersection
266                                 (gnus-sorted-complement articles cached)
267                                 articles))
268             (cache-file (gnus-cache-file-name group ".overview"))
269             type)
270         ;; We first retrieve all the headers that we don't have in 
271         ;; the cache.
272         (let ((gnus-use-cache nil))
273           (when uncached-articles
274             (setq type (and articles 
275                             (gnus-retrieve-headers 
276                              uncached-articles group fetch-old)))))
277         (gnus-cache-save-buffers)
278         ;; Then we insert the cached headers.
279         (save-excursion
280           (cond
281            ((not (file-exists-p cache-file))
282             ;; There are no cached headers.
283             type)
284            ((null type)
285             ;; There were no uncached headers (or retrieval was 
286             ;; unsuccessful), so we use the cached headers exclusively.
287             (set-buffer nntp-server-buffer)
288             (erase-buffer)
289             (insert-file-contents cache-file)
290             'nov)
291            ((eq type 'nov)
292             ;; We have both cached and uncached NOV headers, so we
293             ;; braid them.
294             (gnus-cache-braid-nov group cached)
295             type)
296            (t
297             ;; We braid HEADs.
298             (gnus-cache-braid-heads group (gnus-sorted-intersection
299                                            cached articles))
300             type)))))))
301
302 (defun gnus-cache-enter-article (&optional n)
303   "Enter the next N articles into the cache.
304 If not given a prefix, use the process marked articles instead.
305 Returns the list of articles entered."
306   (interactive "P")
307   (gnus-set-global-variables)
308   (let ((articles (gnus-summary-work-articles n))
309         article out)
310     (while articles
311       (setq article (pop articles))
312       (when (gnus-cache-possibly-enter-article 
313              gnus-newsgroup-name article (gnus-summary-article-header article)
314              nil nil nil t)
315         (push article out))
316       (gnus-summary-remove-process-mark article)
317       (gnus-summary-update-secondary-mark article))
318     (gnus-summary-next-subject 1)
319     (gnus-summary-position-point)
320     (nreverse out)))
321
322 (defun gnus-cache-remove-article (n)
323   "Remove the next N articles from the cache.
324 If not given a prefix, use the process marked articles instead.
325 Returns the list of articles removed."
326   (interactive "P")
327   (gnus-set-global-variables)
328   (gnus-cache-change-buffer gnus-newsgroup-name)
329   (let ((articles (gnus-summary-work-articles n))
330         article out)
331     (while articles
332       (setq article (pop articles))
333       (when (gnus-cache-possibly-remove-article article nil nil nil t)
334         (push article out))
335       (gnus-summary-remove-process-mark article)
336       (gnus-summary-update-secondary-mark article))
337     (gnus-summary-next-subject 1)
338     (gnus-summary-position-point)
339     (nreverse out)))
340
341 (defun gnus-cached-article-p (article)
342   "Say whether ARTICLE is cached in the current group."
343   (memq article gnus-newsgroup-cached))
344
345 ;;; Internal functions.
346
347 (defun gnus-cache-change-buffer (group)
348   (and gnus-cache-buffer
349        ;; See if the current group's overview cache has been loaded.
350        (or (string= group (car gnus-cache-buffer))
351            ;; Another overview cache is current, save it.
352            (gnus-cache-save-buffers)))
353   ;; if gnus-cache buffer is nil, create it
354   (or gnus-cache-buffer
355       ;; Create cache buffer
356       (save-excursion
357         (setq gnus-cache-buffer
358               (cons group
359                     (set-buffer (get-buffer-create " *gnus-cache-overview*"))))
360         (buffer-disable-undo (current-buffer))
361         ;; Insert the contents of this group's cache overview.
362         (erase-buffer)
363         (let ((file (gnus-cache-file-name group ".overview")))
364           (and (file-exists-p file)
365                (insert-file-contents file)))
366         ;; We have a fresh (empty/just loaded) buffer, 
367         ;; mark it as unmodified to save a redundant write later.
368         (set-buffer-modified-p nil))))
369
370 ;; Return whether an article is a member of a class.
371 (defun gnus-cache-member-of-class (class ticked dormant unread)
372   (or (and ticked (memq 'ticked class))
373       (and dormant (memq 'dormant class))
374       (and unread (memq 'unread class))
375       (and (not unread) (not ticked) (not dormant) (memq 'read class))))
376
377 (defun gnus-cache-file-name (group article)
378   (concat (file-name-as-directory gnus-cache-directory)
379           (file-name-as-directory
380            (if (gnus-use-long-file-name 'not-cache)
381                group 
382              (let ((group (nnheader-replace-chars-in-string group ?/ ?_)))
383                ;; Translate the first colon into a slash.
384                (when (string-match ":" group)
385                  (aset group (match-beginning 0) ?/))
386                (nnheader-replace-chars-in-string group ?. ?/))))
387           (if (stringp article) article (int-to-string article))))
388
389 (defun gnus-cache-update-article (group article)
390   "If ARTICLE is in the cache, remove it and re-enter it."
391   (when (gnus-cache-possibly-remove-article article nil nil nil t)
392     (let ((gnus-use-cache nil))
393       (gnus-cache-possibly-enter-article 
394        gnus-newsgroup-name article (gnus-summary-article-header article)
395        nil nil nil t))))
396
397 (defun gnus-cache-possibly-remove-article (article ticked dormant unread 
398                                                    &optional force)
399   "Possibly remove ARTICLE from the cache."
400   (let ((group gnus-newsgroup-name)
401         (number article)
402         file)
403     ;; If this is a virtual group, we find the real group.
404     (when (gnus-virtual-group-p group)
405       (let ((result (nnvirtual-find-group-art 
406                      (gnus-group-real-name group) article)))
407         (setq group (car result)
408               number (cdr result))))
409     (setq file (gnus-cache-file-name group number))
410     (when (and (file-exists-p file)
411                (or force
412                    (gnus-cache-member-of-class
413                     gnus-cache-remove-articles ticked dormant unread)))
414       (save-excursion
415         (delete-file file)
416         (set-buffer (cdr gnus-cache-buffer))
417         (goto-char (point-min))
418         (if (or (looking-at (concat (int-to-string number) "\t"))
419                 (search-forward (concat "\n" (int-to-string number) "\t")
420                                 (point-max) t))
421             (delete-region (progn (beginning-of-line) (point))
422                            (progn (forward-line 1) (point)))))
423       (setq gnus-newsgroup-cached
424             (delq article gnus-newsgroup-cached))
425       (gnus-summary-update-secondary-mark article)
426       t)))
427
428 (defun gnus-cache-articles-in-group (group)
429   "Return a sorted list of cached articles in GROUP."
430   (let ((dir (file-name-directory (gnus-cache-file-name group 1)))
431         articles)
432     (when (file-exists-p dir)
433       (sort (mapcar (lambda (name) (string-to-int name)) 
434                     (directory-files dir nil "^[0-9]+$" t))
435             '<))))
436
437 (defun gnus-cache-braid-nov (group cached)
438   (let ((cache-buf (get-buffer-create " *gnus-cache*"))
439         beg end)
440     (gnus-cache-save-buffers)
441     (save-excursion
442       (set-buffer cache-buf)
443       (buffer-disable-undo (current-buffer))
444       (erase-buffer)
445       (insert-file-contents (gnus-cache-file-name group ".overview"))
446       (goto-char (point-min))
447       (insert "\n")
448       (goto-char (point-min)))
449     (set-buffer nntp-server-buffer)
450     (goto-char (point-min))
451     (while cached
452       (while (and (not (eobp))
453                   (< (read (current-buffer)) (car cached)))
454         (forward-line 1))
455       (beginning-of-line)
456       (save-excursion
457         (set-buffer cache-buf)
458         (if (search-forward (concat "\n" (int-to-string (car cached)) "\t")
459                             nil t)
460             (setq beg (progn (beginning-of-line) (point))
461                   end (progn (end-of-line) (point)))
462           (setq beg nil)))
463       (if beg (progn (insert-buffer-substring cache-buf beg end)
464                      (insert "\n")))
465       (setq cached (cdr cached)))
466     (kill-buffer cache-buf)))
467
468 (defun gnus-cache-braid-heads (group cached)
469   (let ((cache-buf (get-buffer-create " *gnus-cache*")))
470     (save-excursion
471       (set-buffer cache-buf)
472       (buffer-disable-undo (current-buffer))
473       (erase-buffer))
474     (set-buffer nntp-server-buffer)
475     (goto-char (point-min))
476     (while cached
477       (while (and (not (eobp))
478                   (looking-at "2.. +\\([0-9]+\\) ")
479                   (< (progn (goto-char (match-beginning 1))
480                             (read (current-buffer)))
481                      (car cached)))
482         (search-forward "\n.\n" nil 'move))
483       (beginning-of-line)
484       (save-excursion
485         (set-buffer cache-buf)
486         (erase-buffer)
487         (insert-file-contents (gnus-cache-file-name group (car cached)))
488         (goto-char (point-min))
489         (insert "220 ")
490         (princ (car cached) (current-buffer))
491         (insert " Article retrieved.\n")
492         (search-forward "\n\n" nil 'move)
493         (delete-region (point) (point-max))
494         (forward-char -1)
495         (insert "."))
496       (insert-buffer-substring cache-buf)
497       (setq cached (cdr cached)))
498     (kill-buffer cache-buf)))
499
500 ;;;###autoload
501 (defun gnus-jog-cache ()
502   "Go through all groups and put the articles into the cache."
503   (interactive)
504   (let ((gnus-mark-article-hook nil)
505         (gnus-expert-user t)
506         (nnmail-spool-file nil)
507         (gnus-use-dribble-file nil)
508         (gnus-novice-user nil)
509         (gnus-large-newsgroup nil))
510     ;; Start Gnus.
511     (gnus)
512     ;; Go through all groups...
513     (gnus-group-mark-buffer)
514     (gnus-group-universal-argument 
515      nil nil 
516      (lambda ()
517        (gnus-summary-read-group nil nil t)
518        ;; ... and enter the articles into the cache.
519        (when (eq major-mode 'gnus-summary-mode)
520          (gnus-uu-mark-buffer)
521          (gnus-cache-enter-article)
522          (kill-buffer (current-buffer)))))))
523
524 (defun gnus-cache-read-active (&optional force)
525   "Read the cache active file."
526   (unless (file-exists-p gnus-cache-directory)
527     (make-directory gnus-cache-directory t))
528   (if (not (and (file-exists-p gnus-cache-active-file)
529                 (or force (not gnus-cache-active-hashtb))))
530       ;; There is no active file, so we generate one.
531       (gnus-cache-generate-active)
532     ;; We simply read the active file.
533     (save-excursion
534       (gnus-set-work-buffer)
535       (insert-file-contents gnus-cache-active-file)
536       (gnus-active-to-gnus-format
537        nil (setq gnus-cache-active-hashtb 
538                  (gnus-make-hashtable 
539                   (count-lines (point-min) (point-max)))))
540       (setq gnus-cache-active-altered nil))))
541        
542 (defun gnus-cache-write-active (&optional force)
543   "Write the active hashtb to the active file."
544   (when (or force
545             (and gnus-cache-active-hashtb
546                  gnus-cache-active-altered))
547     (save-excursion
548       (gnus-set-work-buffer)
549       (mapatoms
550        (lambda (sym)
551          (when (and sym (boundp sym))
552            (insert (format "%s %d %d y\n"
553                            (symbol-name sym) (cdr (symbol-value sym))
554                            (car (symbol-value sym))))))
555        gnus-cache-active-hashtb)
556       (make-directory (file-name-directory gnus-cache-active-file) t)
557       (write-region 
558        (point-min) (point-max) gnus-cache-active-file nil 'silent))
559     ;; Mark the active hashtb as unaltered.
560     (setq gnus-cache-active-altered nil)))
561
562 (defun gnus-cache-update-active (group number &optional low)
563   "Update the upper bound of the active info of GROUP to NUMBER.
564 If LOW, update the lower bound instead."
565   (let ((active (gnus-gethash group gnus-cache-active-hashtb)))
566     (if (null active)
567         ;; We just create a new active entry for this group.
568         (gnus-sethash group (cons number number) gnus-cache-active-hashtb)
569       ;; Update the lower or upper bound.
570       (if low
571           (setcar active number)
572         (setcdr active number))
573       ;; Mark the active hashtb as altered.
574       (setq gnus-cache-active-altered t))))
575
576 ;;;###autoload
577 (defun gnus-cache-generate-active (&optional directory)
578   "Generate the cache active file."
579   (interactive)
580   (let* ((top (null directory))
581          (directory (expand-file-name (or directory gnus-cache-directory)))
582          (files (directory-files directory 'full))
583          (group 
584           (if top
585               ""
586             (string-match 
587              (concat "^" (file-name-as-directory
588                           (expand-file-name gnus-cache-directory)))
589              (directory-file-name directory))
590             (nnheader-replace-chars-in-string 
591              (substring (directory-file-name directory) (match-end 0))
592              ?/ ?.)))
593          nums alphs)
594     (when top
595       (gnus-message 5 "Generating the cache active file...")
596       (setq gnus-cache-active-hashtb (gnus-make-hashtable 123)))
597     ;; Separate articles from all other files and directories.
598     (while files
599       (if (string-match "^[0-9]+$" (file-name-nondirectory (car files)))
600           (push (string-to-int (file-name-nondirectory (pop files))) nums)
601         (push (pop files) alphs)))
602     ;; If we have nums, then this is probably a valid group.
603     (when (setq nums (sort nums '<))
604       (gnus-sethash group (cons (car nums) (gnus-last-element nums))
605                     gnus-cache-active-hashtb))
606     ;; Go through all the other files.
607     (while alphs
608       (when (and (file-directory-p (car alphs))
609                  (not (string-match "^\\.\\.?$"
610                                     (file-name-nondirectory (car alphs)))))
611         ;; We descend directories.
612         (gnus-cache-generate-active (car alphs)))
613       (setq alphs (cdr alphs)))
614     ;; Write the new active file.
615     (when top
616       (gnus-cache-write-active t)
617       (gnus-message 5 "Generating the cache active file...done"))))
618
619 ;;;###autoload
620 (defun gnus-cache-generate-nov-databases (dir)
621   "Generate NOV files recursively starting in DIR."
622   (interactive (list gnus-cache-directory))
623   (gnus-cache-close)
624   (let ((nnml-generate-active-function 'identity))
625     (nnml-generate-nov-databases-1 dir)))
626
627 (provide 'gnus-cache)
628               
629 ;;; gnus-cache.el ends here