;ELC ;;; compiled by jimb@geech.gnu.ai.mit.edu on Mon Jul 5 23:42:31 1993 ;;; from file /gd/gnu/emacs/19.0/lisp/nnspool.el ;;; emacs version 19.15.16. ;;; 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"))) (error "This file was compiled for Emacs 19")) (require (quote nntp)) (defvar nnspool-inews-program news-inews-program "\ *Program to post news.") (defvar nnspool-inews-switches (quote ("-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.") (defconst nnspool-version "NNSPOOL 1.12" "\ Version numbers of this version of NNSPOOL.") (defvar nnspool-current-directory nil "\ Current news group directory.") (defalias 'nnspool-retrieve-headers #[(sequence) "q\nG \n   \n\n@  !P!X!X !eb#e`}eb#oۉ#^ebceb#``){eb#``){\n\neb#``){  eb#``){eb#``){!eb#``){eb#*#6``){8 X X \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 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 message "NNSPOOL: Receiving headers... %d%%" 100 "NNSPOOL: Receiving headers... done"] 12 "\ 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."]) (defalias 'nnspool-open-server #[(host &optional service) "!!+\n!+ + \"K ;\"KEK\" *" [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."]) (defalias 'nnspool-close-server #[nil " " [nnspool-close-server-internal] 1 "\ Close news server."]) (byte-code "KM" [nnspool-request-quit nnspool-close-server] 2) (defalias '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) (defalias '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)."]) (defalias '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)."]) (defalias '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)."]) (defalias 'nnspool-request-stat #[(id) "‡" ["NNSPOOL: STAT is not implemented." nntp-status-string nil] 1 "\ Select article by message ID (or number)."]) (defalias '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."]) (defalias 'nnspool-request-list #[nil " !)" [nnspool-find-file nnspool-active-file] 2 "\ List active newsgoups."]) (defalias 'nnspool-request-list-newsgroups #[nil " !)" [nnspool-find-file nnspool-newsgroups-file] 2 "\ List newsgroups (defined in NNTP2)."]) (defalias 'nnspool-request-list-distributions #[nil " !)" [nnspool-find-file nnspool-distributions-file] 2 "\ List distributions (defined in NNTP2)."]) (defalias '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."]) (defalias 'nnspool-request-next #[nil "‡" ["NNSPOOL: NEXT is not implemented." nntp-status-string nil] 1 "\ Advance current article pointer."]) (defalias '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."]) (defalias '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-flush-undo erase-buffer kill-all-local-variables t case-fold-search nil nntp-server-process nntp-server-name run-hooks nntp-server-hook] 4 "\ Open connection to news server on HOST by SERVICE (default is nntp)."]) (defalias 'nnspool-close-server-internal #[nil " ! !!  !ĉ" [get-file-buffer nnspool-history-file kill-buffer nntp-server-buffer nil nntp-server-process] 3 "\ Close connection to news server."]) (defalias 'nnspool-find-article-by-message-id #[(id) " !\nq! !q!)db\n!Q#HΔΕ{ϔϕ{#!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 "\ Return full pathname of an article identified by message-ID."]) (defalias '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."]) (defalias 'nnspool-article-pathname #[(group) " !\nQ" [file-name-as-directory nnspool-spool-directory group "/"] 3 "\ Make pathname for GROUP."]) (defalias 'nnspool-replace-chars-in-string #[(string from to) "OG W% H U I T +" [string 0 nil idx len from to] 4 "\ Replace characters in STRING from FROM to TO."]) (provide (quote nnspool))