;ELC   
;;; compiled by amu@tux.mit.edu on Sun Nov 15 14:43:37 1998
;;; from file /afs/sipb.mit.edu/contrib/emacs/packages/gnus-5.6.44/lisp/nndoc.el
;;; emacs version 19.34.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 "`nndoc.el' was compiled for Emacs 19.29 or later"))


(byte-code "!!!!!\"ɉF\nB\nD\fB\fɇ" [require nnheader message nnmail nnoo gnus-util nndoc mapcar #[(p) "C" [p] 1] nil nnoo-definition-alist "*internal-non-initialized-backend*" nnoo-state-alist] 4)
#@209 *Type of the file.
One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
`rfc934', `rfc822-forward', `mime-digest', `mime-parts', `standard-digest',
`slack-digest', `clari-briefs' or `guess'.
(defvar nndoc-article-type (quote guess) (#$ . -719))
(nnoo-define (quote nndoc-article-type) nil)
#@47 *Whether the nndoc group is `mail' or `post'.
(defvar nndoc-post-type (quote mail) (#$ . -1032))
(nnoo-define (quote nndoc-post-type) nil)
#@114 Hook run after opening a document.
The default function removes all trailing carriage returns
from the document.
(defvar nndoc-open-document-hook (quote nnheader-ms-strip-cr) (#$ . 1178))
(byte-code "\"!9 \"QB\"QBBBBBBBBBBBBBBBB!H B\"!\\ B\"!p B\"! B\"!  B\"! !B\"! \"B\"! #B\"! $B\"! %B\"!&B\"!$'B\"!8(B\"!L)B\"!`*B\"!t+B\"!,B\"!.B\"" [nnoo-define nndoc-open-document-hook nil boundp nndoc-type-alist (mmdf (article-begin . "^\n") (body-end . "^\n")) (news (article-begin . "^Path:")) (rnews (article-begin . "^#! *rnews +\\([0-9]+\\) *\n") (body-end-function . nndoc-rnews-body-end)) (mbox (article-begin-function . nndoc-mbox-article-begin) (body-end-function . nndoc-mbox-body-end)) (babyl (article-begin . "\f *\n") (body-end . "") (body-begin-function . nndoc-babyl-body-begin) (head-begin-function . nndoc-babyl-head-begin)) (forward (article-begin . "^-+ Start of forwarded message -+\n+") (body-end . "^-+ End of forwarded message -+$") (prepare-body-function . nndoc-unquote-dashes)) (rfc934 (article-begin . "^--.*\n+") (body-end . "^--.*$") (prepare-body-function . nndoc-unquote-dashes)) (clari-briefs (article-begin . "^ \\*") (body-end . "^	------*[ 	]^*\n^ \\*") (body-begin . "^	") (head-end . "^	") (generate-head-function . nndoc-generate-clari-briefs-head) (article-transform-function . nndoc-transform-clari-briefs)) (mime-digest (article-begin . "") (head-end . "^ ?$") (body-end . "") (file-end . "") (subtype digest guess)) (mime-parts (generate-head-function . nndoc-generate-mime-parts-head) (article-transform-function . nndoc-transform-mime-parts)) standard-digest first-article "^" make-string 70 45 "\n *\n+" article-begin "^\n" 30 ((prepare-body-function . nndoc-unquote-dashes) (body-end-function . nndoc-digest-body-end) (head-end . "^ *$") (body-begin . "^ *\n") (file-end . "^End of .*digest.*[0-9].*\n\\*\\*\\|^End of.*Digest *$") (subtype digest guess)) ((slack-digest (article-begin . "^------------------------------*[\n 	]+") (head-end . "^ ?$") (body-end-function . nndoc-digest-body-end) (body-begin . "^ ?$") (file-end . "^End of") (prepare-body-function . nndoc-unquote-dashes) (subtype digest guess)) (lanl-gov-announce (article-begin . "^\\\\\\\\\n") (head-begin . "^Paper.*:") (head-end . "\\(^\\\\\\\\.*\n\\|-----------------\\)") (body-begin . "") (body-end . "-------------------------------------------------") (file-end . "^Title: Recent Seminal") (generate-head-function . nndoc-generate-lanl-gov-head) (article-transform-function . nndoc-transform-lanl-gov-announce) (subtype preprints guess)) (rfc822-forward (article-begin . "^\n") (body-end-function . nndoc-rfc822-forward-body-end-function)) (guess (guess . t) (subtype nil)) (digest (guess . t) (subtype nil)) (preprints (guess . t) (subtype nil))) current-load-list nndoc-file-begin nndoc-first-article nndoc-article-begin nndoc-head-begin nndoc-head-end nndoc-file-end nndoc-body-begin nndoc-body-end-function nndoc-body-begin-function nndoc-head-begin-function nndoc-body-end nndoc-dissection-alist nndoc-prepare-body-function nndoc-generate-head-function nndoc-article-transform-function nndoc-article-begin-function nndoc-status-string "" nndoc-group-alist] 17)
#@28 Current nndoc news buffer.
(defvar nndoc-current-buffer nil (#$ . 4682))
(byte-code "\"! B\"! B\"!1 B\"" [nnoo-define nndoc-current-buffer nil boundp nndoc-address current-load-list nndoc-mime-header nndoc-mime-subject] 3)
#@16 nndoc version.
(defconst nndoc-version "nndoc 1.0" (#$ . 4955))
(nnoo-define-basics-1 (quote nndoc))
(defalias 'nndoc-retrieve-headers #[(articles &optional newsgroup server fetch-old) "	\n\"{ q ŉ@; ɂz v A@\nA \"cM !Y @A@#db`SfUg c8\"cc  +" [nndoc-possibly-change-buffer newsgroup server nntp-server-buffer erase-buffer nil entry article articles headers nndoc-dissection-alist format "221 %d Article retrieved.\n" nndoc-generate-head-function insert-buffer-substring nndoc-current-buffer 10 "\n" "Lines: %d\n" 4 ".\n" nnheader-fold-continuation-lines] 4])
(nnoo-register-function (quote nndoc-retrieve-headers))
(defalias 'nndoc-request-article #[(article &optional newsgroup server buffer) "	\n\" \fA	q 	^ ;?^ \f	@	A@#c`\f	8	8#bS  ] !," [nndoc-possibly-change-buffer newsgroup server buffer nntp-server-buffer article nndoc-dissection-alist nil beg entry erase-buffer insert-buffer-substring nndoc-current-buffer "\n" 2 3 nndoc-prepare-body-function nndoc-article-transform-function t] 6])
(nnoo-register-function (quote nndoc-request-article))
#@20 Select news GROUP.
(defalias 'nndoc-request-group #[(group &optional server dont-check) "\f\" #> 	! #˂> \fGU7 !#> 		%)" [nil number nndoc-possibly-change-buffer group server nnheader-report nndoc "No such file or buffer: %s" nndoc-address dont-check "Selected group %s" t nndoc-dissection-alist 0 nndoc-close-group "No articles in group %s" nnheader-insert "211 %d %d %d %s\n" 1] 6 (#$ . 6141)])
(nnoo-register-function (quote nndoc-request-group))
(defalias 'nndoc-request-type #[(group &optional article) " \n\f \n" [article unknown nndoc-post-type] 1])
(nnoo-register-function (quote nndoc-request-type))
(defalias 'nndoc-close-group #[(group &optional server) "	\n\" ! !	\"\"\n\"\f͇" [nndoc-possibly-change-buffer group server nndoc-current-buffer buffer-name kill-buffer delq assoc nndoc-group-alist nil nnoo-close-server nndoc nndoc-dissection-alist t] 4])
(nnoo-register-function (quote nndoc-close-group))
(defalias 'nndoc-request-list #[(&optional server) "" [nil] 1])
(nnoo-register-function (quote nndoc-request-list))
(defalias 'nndoc-request-newgroups #[(date &optional server) "" [nil] 1])
(nnoo-register-function (quote nndoc-request-newgroups))
(defalias 'nndoc-request-list-newsgroups #[(&optional server) "" [nil] 1])
(nnoo-register-function (quote nndoc-request-list-newsgroups))
(defalias 'nndoc-possibly-change-buffer #[(group source) "\n \n! \n\"A=y 	\" 	y !0 !D ;y !y !y Q!BB\nqp! ;o !t !!)\n  \nq =    )\n  \n)" [nil buf nndoc-current-buffer buffer-name assoc group nndoc-group-alist bufferp nndoc-address file-exists-p file-directory-p get-buffer-create " *nndoc " "*" nndoc-dissection-alist buffer-disable-undo erase-buffer nnheader-insert-file-contents insert-buffer-substring run-hooks nndoc-open-document-hook nndoc-set-delims nndoc-article-type mime-parts nndoc-dissect-mime-parts nndoc-dissect-buffer nndoc-close-server] 5])
#@74 Set the nndoc delimiter variables according to the type of the document.
(defalias 'nndoc-set-delims #[nil "	 	A@L )A' ! > @@\"!A@AL' )" [(nndoc-file-begin nndoc-first-article nndoc-article-begin-function nndoc-head-begin nndoc-head-end nndoc-file-end nndoc-article-begin nndoc-body-begin nndoc-body-end-function nndoc-body-end nndoc-prepare-body-function nndoc-article-transform-function nndoc-generate-head-function nndoc-body-begin-function nndoc-head-begin-function) vars nil defs guess nndoc-article-type nndoc-type-alist nndoc-guess-type intern format "nndoc-%s"] 4 (#$ . 8181)])
(defalias 'nndoc-guess-type #[(subtype) "A A@A \nA  > eb\n@\"!  \nB\fB\f M \fM !V \n@] \f\"@A@," [nndoc-type-alist nil entry result results alist subtype (guess) intern format "nndoc-%s-type-p" error "Document is not of any recognized type" sort car-less-than-car] 5])
(defalias 'nndoc-mbox-type-p #[nil "	! " [looking-at message-unix-mail-delimiter t] 2])
(defalias 'nndoc-mbox-article-begin #[nil "\nP# Ŕb" [re-search-forward "^" message-unix-mail-delimiter nil t 0] 4])
(defalias 'nndoc-mbox-body-end #[nil "`P#T `T #T 	#T !!T #T `\n\\dU?T \ndWT \nbT !)Z \nb+" [nil end len beg re-search-backward "^" message-unix-mail-delimiter t search-forward "\n\n" "^Content-Length:[ 	]*\\([0-9]+\\) *$" string-to-int match-string 1 looking-at] 4])
(defalias 'nndoc-mmdf-type-p #[nil "! " [looking-at "$" t] 2])
(defalias 'nndoc-news-type-p #[nil "! " [looking-at "^Path:.*\n" t] 2])
(defalias 'nndoc-rnews-type-p #[nil "! " [looking-at "#! *rnews" t] 2])
(defalias 'nndoc-rnews-body-end #[nil "	# y `!!\\b" [re-search-backward nndoc-article-begin nil t 1 string-to-int match-string] 4])
(defalias 'nndoc-babyl-type-p #[nil "#	 Ç" [re-search-forward "\f *\n" nil t] 4])
(defalias 'nndoc-babyl-body-begin #[nil "#!1 #) d#?0 bycy)" [re-search-forward "^\n" nil t looking-at "\\*\\*\\* EOOH \\*\\*\\*" nndoc-article-begin next -1 "\n"] 4])
(defalias 'nndoc-babyl-head-begin #[nil "# ! yÇ" [re-search-forward "^[0-9].*\n" nil t looking-at "\\*\\*\\* EOOH \\*\\*\\*" 1] 4])
(defalias 'nndoc-forward-type-p #[nil "#& #?& $?& $?& Ç" [re-search-forward "^-+ Start of forwarded message -+\n+" nil t "^Subject:.*digest" re-search-backward "^From:" 2] 5])
(defalias 'nndoc-rfc934-type-p #[nil "#& #?& $?& $?& Ç" [re-search-forward "^-+ Start of forwarded.*\n+" nil t "^Subject:.*digest" re-search-backward "^From:" 2] 5])
(defalias 'nndoc-rfc822-forward-type-p #[nil " # )" [message-narrow-to-head re-search-forward "^Content-Type: *message/rfc822" nil t] 4])
(defalias 'nndoc-rfc822-forward-body-end-function #[nil "db" [] 1])
(defalias 'nndoc-mime-parts-type-p #[nil "#eb\f P\f# *" [t search-forward "\n\n" nil limit case-fold-search re-search-forward "^Content-Type:[ 	]*multipart/[a-z]+;\\(.*;\\)*" "[ 	\n]*[ 	]boundary=\"?[^\"\n]*[^\" 	\n]"] 5])
(defalias 'nndoc-transform-mime-parts #[(article) "U?+ eb!`eb#)# c*eb\"" [article 1 search-forward "\n\n" nil limit case-fold-search re-search-forward "^MIME-Version:" t "Mime-Version: 1.0\n" nndoc-generate-mime-parts-head] 4])
(defalias 'nndoc-generate-mime-parts-head #[(article &optional body-present) " 	 \nA  \f8Q\f8\f8\fc7 б\fC \fбN б," [body-present 1 article nndoc-dissection-alist entry nndoc-mime-subject "<" 5 ">" 6 7 references message-id subject nndoc-mime-header "Subject: " "\n" "Message-ID: " "References: "] 4])
(defalias 'nndoc-clari-briefs-type-p #[nil "#)\f ć" [nil case-fold-search re-search-forward "^	[^a-z]+ ([^a-z]+) --" t] 4])
(defalias 'nndoc-transform-clari-briefs #[(article) "eb! ĉ#!" [looking-at " *\\*\\(.*\\)\n" replace-match "" t nndoc-generate-clari-briefs-head article] 4])
(defalias 'nndoc-generate-clari-briefs-head #[(article) "	Aq@8}eb!0 !\f\"0 \fΉO#)@ !*H \fO ٱ+" [article nndoc-dissection-alist nil from subject entry nndoc-current-buffer 3 looking-at " *\\*\\(.*\\)$" match-string 1 string-match "[ 	]+$" 0 case-fold-search re-search-forward "^	\\([^a-z]+\\(,[^(]+\\)? ([^a-z]+)\\) --" t "From: " "clari@clari.net (" "unknown" ")" "\nSubject: " "(no subject)" "\n"] 7])
(defalias 'nndoc-mime-digest-type-p #[nil "P#= ɔ= !\fQBBBB\fQB," [t nil entry b-delimiter boundary-id case-fold-search re-search-forward "^Content-Type: *multipart/digest;[ 	\n]*[ 	]" "boundary=\"?\\([^\"\n]*[^\" 	\n]\\)" 1 match-string "\n--" "[\n 	]+" mime-digest nndoc-type-alist head-end "^ ?$" body-begin "^ ?\n" article-begin body-end-function nndoc-digest-body-end file-end "--[ 	]*$"] 10])
(defalias 'nndoc-standard-digest-type-p #[nil "\"Q# \"Q# Ǉ" [re-search-forward "^" make-string 70 45 "\n\n" nil t 30] 5])
(defalias 'nndoc-digest-body-end #[nil "	# Ĕb" [re-search-forward nndoc-article-begin nil t 0] 4])
(defalias 'nndoc-slack-digest-type-p #[nil "" [0] 1])
(defalias 'nndoc-lanl-gov-announce-type-p #[nil "#)\f ć" [nil case-fold-search re-search-forward "^\\\\\\\\\nPaper: [a-z-]+/[0-9]+" t] 4])
(defalias 'nndoc-transform-lanl-gov-announce #[(article) "db# #" [re-search-backward "^\\\\\\\\ +(\\([^ ]*\\) , *\\([^ ]*\\))" nil t replace-match "\n\nGet it at \\1 (\\2)"] 4])
(defalias 'nndoc-generate-lanl-gov-head #[(article) "	AÉq@A@}eb!P !Q#9 !#P !P!R*\fg \f\"g щ\f$U \fm s ޱ," [article nndoc-dissection-alist "no address given" nil from subject e-mail entry nndoc-current-buffer looking-at "^Paper.*: \\([a-z-]+/[0-9]+\\)" " (" match-string 1 ")" re-search-forward "^From: \\([^ ]+\\)" t "^Title: \\([^\f]*\\)\nAuthors?: \\(.*\\)" 2 " <" ">" string-match "([^)]*)" replace-match "" "From: " "unknown" "\nSubject: " "(no subject)" "\n"] 6])
(defalias 'nndoc-request-accept-article #[(group &optional server last) "" [nil] 1])
(nnoo-register-function (quote nndoc-request-accept-article))
(defalias 'nndoc-search #[(regexp) "	#y" [re-search-forward regexp nil t 0] 4])
#@70 Go through the document and partition it into heads/bodies/articles.
(defalias 'nndoc-dissect-buffer #[nil "	\nqeb$ !5 5 !7   I  S S !mc i !i db$ `s !`    !`    !   db # y`T\f\f\"	B	$ ." [0 t nil body-end body-begin head-end head-begin first i nndoc-dissection-alist nndoc-current-buffer nndoc-file-begin nndoc-search nndoc-first-article nndoc-article-begin nndoc-head-begin-function nndoc-head-begin nndoc-file-end looking-at nndoc-head-end "^$" nndoc-body-begin-function nndoc-body-begin "^\n" nndoc-body-end-function nndoc-body-end re-search-backward count-lines] 8 (#$ . 14541)])
(defalias 'nndoc-article-begin #[nil "  Ï" [nndoc-article-begin-function G99243 (nndoc-search nndoc-article-begin) ((error))] 3])
#@43 Unquote quoted non-separators in digests.
(defalias 'nndoc-unquote-dashes #[nil "# É#  " [re-search-forward "^- -" nil t replace-match "-"] 4 (#$ . 15417)])
(byte-code "	B" [nndoc-mime-split-ordinal current-load-list] 2)
#@210 Go through a MIME composite article and partition it into sub-articles.
When a MIME entity contains sub-entities, dissection produces one article for
the header of this entity, and one article per sub-entity.
(defalias 'nndoc-dissect-mime-parts #[nil "\fq !!\n\fed{!\"6 Ɖ$\" ~ed\n%," [nil nndoc-dissection-alist 0 nndoc-mime-split-ordinal nndoc-current-buffer message-narrow-to-head t message-fetch-field "Message-ID" "References" references message-id case-fold-search nndoc-mime-header "Subject" nndoc-mime-subject string-match "^\\(Subject\\|Message-ID\\|References\\|Lines\\|MIME-Version\\|Content-Type\\|Content-Transfer-Encoding\\|\\):.*\n\\([ 	].*\n\\)*" replace-match "" nndoc-dissect-mime-parts-sub] 6 (#$ . 15661)])
#@346 Dissect an entity within a composite MIME message.
The article, which corresponds to a MIME entity, extends from BEGIN to END.
The string POSITION holds a dotted decimal representation of the article
position in the hierarchical structure, it is nil for the outer entity.
The generated article should use MESSAGE-ID and REFERENCES field values.
(defalias 'nndoc-dissect-mime-parts-sub #[(begin end position message-id references) "		\n\nb	#- `S`3 		\nb#N !!S ՘c \fc \fh q \fr Ԙ}  ژ  T\n		\"	B\nbP#-!Q&'(b(	#?&&?,`(	#	! !阄 &y`y	&	'T'\"Q % -.	" [begin end nil comment composite subtype type body-begin head-end body-end head-begin search-forward "\n\n" t re-search-forward "^Content-Type: *\\([^ 	\n/;]+\\)/\\([^ 	\n/;]+\\)" match-string 1 2 "text" "plain" "multipart" position "." "*" " " "basic" nndoc-mime-split-ordinal count-lines message-id references nndoc-dissection-alist "^Content-Type: *multipart/\\([a-z]+\\);\\(.*;\\)*" "[ 	\n]*[ 	]boundary=\"?\\([^\"\n]*[^\" 	\n]\\)" "\n--" 3 "\\(--\\)?[ 	]*\n" 0 eof-flag part-counter boundary "" -1 nndoc-dissect-mime-parts-sub format "%d" nnmail-message-id] 9 (#$ . 16437)])
#@266 Add document DEFINITION to the list of nndoc document definitions.
If POSITION is nil or `last', the definition will be added
as the last checked definition, if t or `first', add as the
first definition, and if any other symbol, add after that
symbol in the alist.
(defalias 'nndoc-add-type #[(definition &optional position) "	@\n\n\" = \n	C=% =+ 	\nB\n\n>; \"	AB)" [delq definition nndoc-type-alist position last t first list error "No such position: %s"] 4 (#$ . 17771)])
(provide (quote nndoc))
