;ELC ;;; compiled by jwz@thalidomide on Mon Feb 7 02:58:57 1994 ;;; from file /th/jwz/emacs19/lisp/gnus/nnspool.el ;;; emacs version 19.10 Lucid (beta2). ;;; bytecomp version 2.22; 22-dec-93. ;;; 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"))) (error "This file was compiled for Emacs 19.")) (require 'nntp) (defvar nnspool-inews-program news-inews-program "\ *Program to post news.") (defvar nnspool-inews-switches '("-h") "\ *Switches for nnspool-request-post to pass to `inews' for posting news.") (defvar nnspool-spool-directory news-path "\ *Local news spool directory.") (defvar nnspool-active-file "/usr/lib/news/active" "\ *Local news active file.") (defvar nnspool-newsgroups-file "/usr/lib/news/newsgroups" "\ *Local news newsgroups file.") (defvar nnspool-distributions-file "/usr/lib/news/distributions" "\ *Local news distributions file.") (defvar nnspool-history-file "/usr/lib/news/history" "\ *Local news history file.") (defvar nnspool-retrieve-headers-method nil "\ *Function to retrieve headers from articles in an nnspool directory. The function accepts a list of articles to retrieve the headers from where the articles are located in the directory nnspool-current-directory. Three functions nnspool-retrieve-headers-from-overview-file, nnspool-retrieve-headers-from-article-files and nnspool-retrieve-headers-using-gnushdrs are provided now. For the latter nnspool-retrieve-headers-gnushdrs-program specifies the name of the program to execute (which see). If the value is nil, automatically choose between the overview file and article files.") (defvar nnspool-retrieve-headers-gnushdrs-program "gnushdrs" "\ *The name of a program used to retrieve headers from articles when nnspool-retrieve-headers-method is set to nnspool-retrieve-headers-using-gnushdrs. The program takes a directory as it first argument and the files to retrieve articles from as the rest of its arguments. It must produce on its standard output an emacs lisp expression in the same format as the value of nnspool-retrieve-headers (which see).") (defconst nnspool-version "NNSPOOL 1.12" "\ Version numbers of this version of NNSPOOL.") (defvar nnspool-current-directory nil "\ Current news group directory.") (defvar nnspool-article-header-read-size 1024 "\ Number of bytes to read when processing headers from NNSPOOL.") (fset 'nnspool-retrieve-headers-by-id #[(message-id) "!" [error "Unimplemented function, sorry."] 2 "\ UNIMPLEMENTED. Should return same things nnspool-retrieve-headers does."]) (fset 'nnspool-retrieve-headers #[(sequence) " ! P! ! !" [nnspool-retrieve-headers-method sequence file-exists-p nnspool-current-directory ".overview" nnspool-retrieve-headers-from-overview-file nnspool-retrieve-headers-from-article-files] 3 "\ Return list of article headers specified by SEQUENCE of article id. The format of list is `([NUMBER SUBJECT FROM XREF LINES DATE MESSAGE-ID REFERENCES] ...)'. If there is no References: field, In-Reply-To: field is used instead. Reader macros for the vector are defined as `nntp-header-FIELD'. Writer macros for the vector are defined as `nntp-set-header-FIELD'. Newsgroup must be selected before calling this."]) (fset 'nnspool-retrieve-headers-from-overview-file #[(sequence) "q \n  P!eb@ A \"#!ؔؕ{\nٕٔ{ڔڕ{۔ە{ ܔܕ{ޔޕ{!ߔߕU?ߔ\\ߕ{ ᘫ \n  & Bu!,ؔؕ{! ,,@ W,Ao, . " [nntp-server-buffer nil 0 headers references date lines xref from message-id subject article next erase-buffer insert-file-contents nnspool-current-directory ".overview" sequence re-search-forward format "^%d " t looking-at "\\([^ \n]*\\) \\([^ \n]*\\) \\([^ \n]*\\) \\([^ \n]*\\) \\([^ \n]*\\) \\([^ \n]*\\) \\([^ \n]*\\) ?\\([^ \n]*\\)" 1 2 3 4 5 string-to-int 7 8 6 "" vector "^\\([0-9]+\\) "] 11 "\ A method for nnspool-retrieve-headers that uses .overview files."]) (fset 'nnspool-retrieve-headers-using-gnushdrs #[(sequence) " GV q   \"&\n!eb ! \n!+" [nntp-large-newsgroup sequence msg nntp-server-buffer erase-buffer nil process-connection-type apply call-process nnspool-retrieve-headers-gnushdrs-program t nnspool-current-directory mapcar int-to-string message "NNSPOOL: parsing headers..." read "NNSPOOL: parsing headers...done."] 10 "\ A method for nnspool-retrieve-headers that uses the program gnushdrs."]) (fset 'nnspool-retrieve-headers-from-article-files #[(sequence) "q\nG \n   \nv\n@  !P!I!I $eb#e`}eb#܉#qebceb#``){eb#``){\n\neb#``){  eb#``){eb#``){!eb#``){eb##``){   \n  & B \nA T ,',V' U' _\"',,V! . " [nntp-server-buffer nil sequence 0 references date lines xref from message-id subject article headers count number file nnspool-current-directory prin1-to-string file-exists-p file-directory-p erase-buffer insert-file-contents nnspool-article-header-read-size search-forward "\n\n" move re-search-forward "\\( ?\n[ ]+\\)+" t replace-match " " "\n" "\nFrom: " "(Unknown User)" "\nSubject: " "(None)" "\nMessage-ID: " "\nDate: " "\nLines: " string-to-int "\nXref: " "\nReferences: " "\nIn-Reply-To: " vector nntp-large-newsgroup 20 gnus-lazy-message "NNSPOOL: Receiving headers... %d%%" 100 message "NNSPOOL: Receiving headers... done"] 12 "\ A method for nnspool-retrieve-headers that only uses Emacs Lisp."]) (fset 'nnspool-open-server #[(host &optional service) "!!\n!  \" \"\" *" [host getenv "NNTPSERVER" nil status "" nntp-status-string file-directory-p nnspool-spool-directory file-exists-p nnspool-active-file system-name nnspool-open-server-internal service format "%s has no news spool. Goodbye." "NNTP server is not specified." "NNSPOOL: cannot talk to %s."] 3 "\ Open news server on HOST. If HOST is nil, use value of environment variable `NNTPSERVER'. If optional argument SERVICE is non-nil, open by the service name."]) (fset 'nnspool-close-server #[nil " " [nnspool-close-server-internal] 1 "\ Close news server."]) (byte-code "KM" [nnspool-request-quit nnspool-close-server] 2) (fset 'nnspool-server-opened #[nil "!" [nntp-server-buffer get-buffer] 2 "\ Return server process status, T or NIL. If the stream is opened, return T, otherwise return NIL."]) (defun nnspool-status-message nil "\ Return server status response as string." nntp-status-string) (fset 'nnspool-request-article #[(id) ";!\n!P; ! !? !))" [id nnspool-find-article-by-message-id nnspool-current-directory prin1-to-string file file-exists-p file-directory-p nnspool-find-file] 4 "\ Select article by message ID (or number)."]) (fset 'nnspool-request-body #[(id) " !\nqeb#e`|)Ƈ" [nnspool-request-article id nntp-server-buffer search-forward "\n\n" nil t] 4 "\ Select article body by message ID (or number)."]) (fset 'nnspool-request-head #[(id) " !\nqeb#`Sd|)Ƈ" [nnspool-request-article id nntp-server-buffer search-forward "\n\n" nil t] 4 "\ Select article head by message ID (or number)."]) (fset 'nnspool-request-stat #[(id) "‡" ["NNSPOOL: STAT is not implemented." nntp-status-string nil] 1 "\ Select article by message ID (or number)."]) (fset 'nnspool-request-group #[(group) "\n#! ! )" [nnspool-article-pathname nnspool-replace-chars-in-string group 46 47 pathname file-directory-p nnspool-current-directory] 5 "\ Select news GROUP."]) (fset 'nnspool-request-list #[nil " !)" [nnspool-find-file nnspool-active-file] 2 "\ List active newsgoups."]) (fset 'nnspool-request-list-newsgroups #[nil " !)" [nnspool-find-file nnspool-newsgroups-file] 2 "\ List newsgroups (defined in NNTP2)."]) (fset 'nnspool-request-list-distributions #[nil " !)" [nnspool-find-file nnspool-distributions-file] 2 "\ List distributions (defined in NNTP2)."]) (fset 'nnspool-request-last #[nil "‡" ["NNSPOOL: LAST is not implemented." nntp-status-string nil] 1 "\ Set current article pointer to the previous article in the current news group."]) (fset 'nnspool-request-next #[nil "‡" ["NNSPOOL: NEXT is not implemented." nntp-status-string nil] 1 "\ Advance current article pointer."]) (fset 'nnspool-request-post #[nil " ed# qed & U \"ed%  )" [copy-to-buffer nntp-server-buffer apply call-process-region nnspool-inews-program delete t nil nnspool-inews-switches buffer-size 0 string-match "spooled" buffer-string subst-char-in-region 10 92 noundo nntp-status-string erase-buffer] 9 "\ Post a new news in current buffer."]) (fset 'nnspool-open-server-internal #[(host &optional service) " \"!qp!  ! !)ʇ" [host system-name error "NNSPOOL: cannot talk to %s." get-buffer-create " *nntpd*" nntp-server-buffer buffer-disable-undo erase-buffer kill-all-local-variables t case-fold-search boundp nntp-server-process nil nntp-server-name run-hooks nntp-server-hook] 4 "\ Open connection to news server on HOST by SERVICE (default is nntp)."]) (fset 'nnspool-close-server-internal #[nil " ! !! !!ĉ" [get-file-buffer nnspool-history-file kill-buffer nntp-server-buffer nil boundp nntp-server-process] 3 "\ Close connection to news server."]) (fset 'nnspool-find-article-by-message-id #[(id) " P! ! !" [file-exists-p nnspool-current-directory ".overview" nnspool-find-article-by-message-id-from-overview-file id nnspool-find-article-by-message-id-from-history-file] 3 "\ Return full pathname of an article identified by message-ID."]) (byte-code "MM" [nnspool-find-article-by-message-id-from-overview-file #[(id) "q P!eb!Q# ̔̕{P!)" [nntp-server-buffer erase-buffer insert-file-contents nnspool-current-directory ".overview" re-search-forward "^\\([^ \n]*\\) [^ \n]* [^ \n]* [^ \n]* " regexp-quote id " " nil t 1 nnspool-find-article-by-message-id-from-history-file] 4] nnspool-find-article-by-message-id-from-history-file #[(id) " !\nq! !q!)db\n!Q#ΔΕ{ϔϕ{#!P*)" [get-file-buffer nnspool-history-file buffer message "Reading history file..." find-file-noselect "Reading history file... done" re-search-backward "^" regexp-quote id "[ ].*[ ]\\([^ /]+\\)/\\([0-9]+\\)[ ]*$" nil t 1 2 number group nnspool-article-pathname nnspool-replace-chars-in-string 46 47] 6]] 2) (fset 'nnspool-find-file #[(file) "q ď" [nntp-server-buffer erase-buffer nil (byte-code " !‡" [insert-file-contents file t] 2) ((file-error))] 3 "\ Insert FILE in server buffer safely."]) (fset 'nnspool-article-pathname #[(group) " !\nQ" [file-name-as-directory nnspool-spool-directory group "/"] 3 "\ Make pathname for GROUP."]) (fset 'nnspool-replace-chars-in-string #[(string from to) "OG W H U I Ti+" [string 0 nil idx len from to] 4 "\ Replace characters in STRING from FROM to TO."]) (provide 'nnspool)