;ELC   
;;; compiled by amu@mit.edu on Sat Sep 13 16:19:06 1997
;;; from file /afs/sipb.mit.edu/contrib/emacs/packages/gnus-5.4.67/lisp/gnus-cache.el
;;; emacs version 19.30.1.
;;; bytecomp version FSF 2.10
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`gnus-cache.el' was compiled for Emacs 19.29 or later"))


(byte-code "!!!!	%	&	&	&	&	&!c  !B!!r \"!B!! #!B!! $!B!\"\"" [require gnus gnus-int gnus-range gnus-start custom-declare-group gnus-cache nil "Cache interface." :group custom-declare-variable gnus-cache-directory (nnheader-concat gnus-directory "cache/") "*The directory where cached articles will be stored." :type directory gnus-cache-active-file (concat (file-name-as-directory gnus-cache-directory) "active") "*The cache active file." file gnus-cache-enter-articles (quote (ticked dormant)) "Classes of articles to enter into the cache." (set (const ticked) (const dormant) (const unread) (const read)) gnus-cache-remove-articles (quote (read)) "Classes of articles to remove from the cache." (set (const ticked) (const dormant) (const unread) (const read)) gnus-uncacheable-groups "*Groups that match this regexp will not be cached.\n\nIf you want to avoid caching your nnml groups, you could set this\nvariable to \"^nnml\"." (choice (const :tag "off" nil) regexp) boundp gnus-cache-removable-articles current-load-list gnus-cache-buffer gnus-cache-active-hashtb gnus-cache-active-altered autoload nnml-generate-nov-databases-1 "nnml" nnvirtual-find-group-art "nnvirtual"] 8)
#@23 Initialize the cache.
(defalias 'gnus-cache-open #[nil "	! \n \n=?  " [file-exists-p gnus-cache-directory gnus-use-cache passive gnus-cache-read-active] 2 (#$ . 1796)])
(byte-code "" [G77617 (byte-code "\"" [gnus-add-shutdown gnus-cache-close gnus] 3) ((error))] 3)
#@22 Shut down the cache.
(defalias 'gnus-cache-close #[nil "  " [gnus-cache-write-active gnus-cache-save-buffers nil gnus-cache-active-hashtb] 2 (#$ . 2087)])
(defalias 'gnus-cache-save-buffers #[nil "X A@\"\f!5 \fq V% !4 !/ !͏)\fJ \f;G ςH \f!)S !)ˉ*" [gnus-cache-buffer gnus-cache-file-name ".overview" overview-file buffer buffer-modified-p buffer-size 0 gnus-write-buffer file-exists-p delete-file nil (byte-code "\n!!" [delete-directory file-name-directory overview-file] 3) ((error)) buf get-buffer buffer-name kill-buffer] 5])
(defalias 'gnus-cache-possibly-enter-article #[(group article headers ticked dormant unread &optional force) " 	=?^^V^!^!S \n\n\": \nĕO< \n)\"@!AI)H͉]V] } \"?]$]\"!?]!!! ݂]q\") V[!!#Aqdby揃 y om yp!W	y	y	yyHHHHHH*H2H:HB&\nc3q\"5B5!)+" [force gnus-use-cache passive article 0 vectorp headers gnus-virtual-group-p group nnvirtual-find-group-art gname string-match "^[^:]+:" nil result copy-sequence dir file number gnus-uncacheable-groups gnus-cache-member-of-class gnus-cache-enter-articles ticked dormant unread file-exists-p gnus-cache-file-name gnus-make-directory file-name-directory t nntp-server-buffer gnus-request-article-this-buffer buffer-size gnus-write-buffer gnus-cache-change-buffer gnus-cache-buffer -1 (byte-code "o?\n p!	V" [read number] 2) ((error (byte-code "y`y`|" [0 1 t] 2))) read 1 format "%s	%s	%s	%s	%s	%s	%s	%s	%s	\n" 2 3 4 5 "" 6 7 8 gnus-summary-buffer gnus-cache-update-active gnus-newsgroup-cached gnus-summary-update-secondary-mark] 13])
#@42 Mark ARTICLE for later possible removal.
(defalias 'gnus-cache-enter-remove-article #[(article) "	 	B" [article gnus-cache-removable-articles] 2 (#$ . 3896)])
#@49 Possibly remove some of the removable articles.
(defalias 'gnus-cache-possibly-remove-articles #[nil "	!	  F 	\"( ˕O* )A@\" AC@ * *ĉ" [gnus-virtual-group-p gnus-newsgroup-name gnus-cache-possibly-remove-articles-1 gnus-cache-removable-articles nil ga arts nnvirtual-find-group-art gname string-match "^[^:]+:" 0] 4 (#$ . 4067)])
#@49 Possibly remove some of the removable articles.
(defalias 'gnus-cache-possibly-remove-articles-1 #[nil "=?E \n	!B A@> >\f>>= >$ + " [gnus-use-cache passive gnus-cache-removable-articles gnus-newsgroup-cached nil article cache-articles articles gnus-cache-change-buffer gnus-newsgroup-name gnus-cache-possibly-remove-article gnus-newsgroup-marked gnus-newsgroup-dormant gnus-newsgroup-unreads gnus-newsgroup-unselected gnus-cache-save-buffers] 6 (#$ . 4449)])
#@43 Retrieve ARTICLE in GROUP from the cache.
(defalias 'gnus-cache-request-article #[(article group) "	\n\"!   !*" [gnus-cache-file-name group article nil buffer-read-only file file-exists-p erase-buffer gnus-kill-all-overlays insert-file-contents t] 3 (#$ . 4960)])
#@71 Alter the ACTIVE info for GROUP to reflect the articles in the cache.
(defalias 'gnus-cache-possibly-alter-active #[(group active) "( \n\"J' @\f@W \f@A\fAV' \fA)" [gnus-cache-active-hashtb intern-soft group cache-active active] 4 (#$ . 5247)])
#@45 Retrieve the headers for ARTICLES in GROUP.
(defalias 'gnus-cache-retrieve-headers #[(articles group &optional fetch-old) "	! 	#) \"\"	\"@ > 	#) !Q  f q !Ղ =w 	\" 	\"\",)" [gnus-cache-articles-in-group group gnus-newsgroup-cached cached nil gnus-use-cache gnus-retrieve-headers articles fetch-old gnus-sorted-intersection gnus-sorted-complement gnus-cache-file-name ".overview" type cache-file uncached-articles gnus-cache-save-buffers file-exists-p nntp-server-buffer erase-buffer insert-file-contents nov gnus-cache-braid-nov gnus-cache-braid-heads] 6 (#$ . 5515)])
#@145 Enter the next N articles into the cache.
If not given a prefix, use the process marked articles instead.
Returns the list of articles entered.
(defalias 'gnus-cache-enter-article #[(&optional n) " \n!ÉA@I !8 	8É&> \fB> #!!\f ! \f+" [gnus-set-global-variables gnus-summary-work-articles n nil out article articles natnump gnus-cache-possibly-enter-article gnus-newsgroup-name 3 gnus-newsgroup-data t gnus-message 2 "Can't cache article %d" gnus-summary-remove-process-mark gnus-summary-update-secondary-mark gnus-summary-next-subject 1 gnus-summary-position-point] 8 (#$ . 6182) "P"])
#@146 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.
(defalias 'gnus-cache-remove-article #[(n) " \n!\f!ŉ? A@ŉ%2 B!! ! +" [gnus-set-global-variables gnus-cache-change-buffer gnus-newsgroup-name gnus-summary-work-articles n nil out article articles gnus-cache-possibly-remove-article t gnus-summary-remove-process-mark gnus-summary-update-secondary-mark gnus-summary-next-subject 1 gnus-summary-position-point] 6 (#$ . 6828) "P"])
#@53 Say whether ARTICLE is cached in the current group.
(defalias 'gnus-cached-article-p #[(article) "	>" [article gnus-newsgroup-cached] 2 (#$ . 7410)])
#@72 Insert all the articles cached for this group into the current buffer.
(defalias 'gnus-summary-insert-cached-articles #[nil "\n] ! A@\" *" [gnus-newsgroup-cached 6 gnus-verbose cached error "No cached articles for this group" gnus-summary-goto-subject t] 4 (#$ . 7568) nil])
(defalias 'gnus-cache-change-buffer #[(group) " 	@  ?9 	!qBp! 	\"		!4 	!)!)" [gnus-cache-buffer group gnus-cache-save-buffers get-buffer-create " *gnus-cache-overview*" buffer-disable-undo erase-buffer gnus-cache-file-name ".overview" file file-exists-p nnheader-insert-file-contents set-buffer-modified-p nil] 3])
(defalias 'gnus-cache-member-of-class #[(class ticked dormant unread) "\n 	>0 \n 	>0  	>0 ?0 ?0 \n?0 	>" [ticked class dormant unread read] 2])
(defalias 'gnus-cache-file-name #[(group article) "	!! ( #\"\" ˔I#)!!;5 9 !Q" [file-name-as-directory gnus-cache-directory nnheader-translate-file-chars gnus-use-long-file-name not-cache group nnheader-replace-chars-in-string 47 95 string-match ":" 0 46 article int-to-string] 7])
#@56 If ARTICLE is in the cache, remove it and re-enter it.
(defalias 'gnus-cache-update-article #[(group article) "	% 		8&)" [gnus-cache-possibly-remove-article article nil t gnus-use-cache gnus-cache-possibly-enter-article gnus-newsgroup-name 3 gnus-newsgroup-data] 8 (#$ . 8698)])
#@41 Possibly remove ARTICLE from the cache.
(defalias 'gnus-cache-possibly-remove-article #[(article ticked dormant unread &optional force) "	!0 \"! ˕O# )	\"\f@\fA)\f\"! M $ !Aqeb\f!P!q \f!Qd#{ y`y`|)	\"	!+" [gnus-newsgroup-name article nil file number group gnus-virtual-group-p nnvirtual-find-group-art gname string-match "^[^:]+:" 0 result gnus-cache-file-name file-exists-p force gnus-cache-member-of-class gnus-cache-remove-articles ticked dormant unread delete-file gnus-cache-buffer looking-at int-to-string "	" search-forward "\n" t 1 delq gnus-newsgroup-cached gnus-summary-update-secondary-mark] 6 (#$ . 9005)])
#@51 Return a sorted list of cached articles in GROUP.
(defalias 'gnus-cache-articles-in-group #[(group) "\n\"!!3 $\"\"2 \n@#\n!@\"*" [file-name-directory gnus-cache-file-name group 1 nil articles dir file-exists-p sort mapcar #[(name) "	!" [string-to-int name] 2] directory-files "^[0-9]+$" t < gnus-cache-update-active last] 9 (#$ . 9711)])
(defalias 'gnus-cache-braid-nov #[(group cached &optional file) "! qp! \n! \f\"!ebceb)qeb mM p!@WM y9 yq@!Q#p y``r )\f \f#cA9 !+" [get-buffer-create " *gnus-cache*" nil end beg cache-buf gnus-cache-save-buffers buffer-disable-undo erase-buffer insert-file-contents file gnus-cache-file-name group ".overview" "\n" nntp-server-buffer cached read 1 0 search-forward int-to-string "	" t insert-buffer-substring kill-buffer] 5])
(defalias 'gnus-cache-braid-heads #[(group cached) "!\nqp! )qeb~ m< !< ɔbp!@W< # y\nq @\"!ebc@p\"c#`d|uc)\n!A \n!)" [get-buffer-create " *gnus-cache*" cache-buf buffer-disable-undo erase-buffer nntp-server-buffer cached looking-at "2.. +\\([0-9]+\\) " 1 read search-forward "\n.\n" nil move 0 insert-file-contents gnus-cache-file-name group "220 " princ " Article retrieved.\n" "\n\n" -1 "." insert-buffer-substring kill-buffer] 5])
#@121 Go through all groups and put the articles into the cache.

Usage:
$ emacs -batch -l ~/.emacs -l gnus -f gnus-jog-cache
(defalias 'gnus-jog-cache #[nil "  \"." [nil t gnus-large-newsgroup gnus-novice-user gnus-use-dribble-file nnmail-spool-file gnus-expert-user gnus-mark-article-hook gnus gnus-group-mark-buffer gnus-group-iterate #[(group) "#=   p!)" [nil gnus-auto-select-next gnus-summary-read-group group t major-mode gnus-summary-mode gnus-uu-mark-buffer gnus-cache-enter-article kill-buffer] 4]] 6 (#$ . 11109) nil])
#@29 Read the cache active file.
(defalias 'gnus-cache-read-active #[(&optional force) "	!! \f   !ed\"!\f\"ɉ)" [gnus-make-directory gnus-cache-directory file-exists-p gnus-cache-active-file force gnus-cache-generate-active gnus-set-work-buffer insert-file-contents gnus-active-to-gnus-format nil gnus-make-hashtable count-lines gnus-cache-active-hashtb gnus-cache-active-altered] 6 (#$ . 11679)])
#@45 Write the active hashtb to the active file.
(defalias 'gnus-cache-write-active #[(&optional force) "\f 	V \nV !!q\n\f͎	\"\f\fQ \f=6 \nqQ \nq\f!!I \f!\"ed\f%.ˉ" [force gnus-cache-active-hashtb gnus-cache-active-altered gnus-cache-active-file temp-file fundamental-mode default-major-mode get-buffer-create generate-new-buffer-name " *nnheader temp*" temp-buffer nil temp-results ((byte-code "	!\n 	!" [buffer-name temp-buffer kill-buffer] 2)) mapatoms #[(sym) " ! !JAJ@$c" [sym boundp format "%s %d %d y\n" symbol-name] 5] t file-directory-p file-name-directory make-directory write-region nomesg] 6 (#$ . 12104)])
#@103 Update the upper bound of the active info of GROUP to NUMBER.
If LOW, update the lower bound instead.
(defalias 'gnus-cache-update-active #[(group number &optional low) "	\n\"J 	\n\"BL& \" & ǉ)" [intern-soft group gnus-cache-active-hashtb active intern number low t gnus-cache-active-altered] 4 (#$ . 12788)])
#@33 Generate the cache active file.
(defalias 'gnus-cache-generate-active #[(&optional directory) "?	 !\"	 ǂ1 !!P!\"!͕O#	G \"!y @!\"j A@!!BG A@BG \" \"@!BL @! @!\" @!A 	 !\"." [directory top expand-file-name gnus-cache-directory directory-files full files "" string-match "^" file-name-as-directory directory-file-name nnheader-replace-chars-in-string 0 nil 47 46 group nums alphs gnus-message 5 "Generating the cache active file..." gnus-make-hashtable 123 gnus-cache-active-hashtb "^[0-9]+$" file-name-nondirectory string-to-int sort < intern gnus-last-element file-directory-p "^\\.\\.?$" gnus-cache-generate-active gnus-cache-write-active t "Generating the cache active file...done"] 6 (#$ . 13130) nil])
#@49 Generate NOV files recursively starting in DIR.
(defalias 'gnus-cache-generate-nov-databases #[(dir) " \f!)" [gnus-cache-close identity nnml-generate-active-function nnml-generate-nov-databases-1 dir] 2 (#$ . 13976) (list gnus-cache-directory)])
#@40 Move the cache tree to somewhere else.
(defalias 'gnus-cache-move-cache #[(dir) "	\n\"" [rename-file gnus-cache-directory dir] 3 (#$ . 14234) "FMove the cache tree to: "])
(provide (quote gnus-cache))
