;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Mon Apr 17 19:47:42 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/nntp.el ;;; emacs version 19.28.90.26. ;;; 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 "`/gd/gnu/emacs/19.0/lisp/nntp.el' was compiled for Emacs 19")) #@495 *Hooks for the NNTP server. If the kanji code of the NNTP server is different from the local kanji code, the correct kanji code of the buffer associated with the NNTP server must be specified as follows: (setq nntp-server-hook (function (lambda () ;; Server's Kanji code is EUC (NEmacs hack). (make-local-variable 'kanji-fileio-code) (setq kanji-fileio-code 0)))) If you'd like to change something depending on the server in this hook, use the variable `nntp-server-name'. (defvar nntp-server-hook nil (#$ . -478)) #@184 *The number of the articles which indicates a large newsgroup. If the number of the articles is greater than the value, verbose messages will be shown to indicate the current status. (defvar nntp-large-newsgroup 50 (#$ . -1021)) #@269 *Non-nil if your select routine is buggy. If the select routine signals error or fall into infinite loop while waiting for the server response, the variable must be set to t. In case of Fujitsu UTS, it is set to t since `accept-process-output' doesn't work properly. (defvar nntp-buggy-select (memq system-type (quote (fujitsu-uts))) (#$ . -1257)) #@153 *The maximum number of the requests sent to the NNTP server at one time. If Emacs hangs up while retrieving headers, set the variable to a lower value. (defvar nntp-maximum-request 400 (#$ . -1613)) #@131 *Display '...' every 10Kbytes of a message being received if it is non-nil. If it is a number, dots are displayed per the number. (defvar nntp-debug-read 10000 (#$ . -1819)) #@42 Version numbers of this version of NNTP. (defconst nntp-version "NNTP 3.12" (#$ . 1999)) #@43 The name of the host running NNTP server. (defvar nntp-server-name nil (#$ . 2094)) #@45 Buffer associated with NNTP server process. (defvar nntp-server-buffer nil (#$ . 2184)) #@125 The NNTP server process. You'd better not use this variable in NNTP front-end program but instead use `nntp-server-buffer'. (defvar nntp-server-process nil (#$ . 2279)) #@167 Save the server response message. You'd better not use this variable in NNTP front-end program but instead call function `nntp-status-message' to get status message. (defvar nntp-status-string nil (#$ . 2455)) #@34 Return article number in HEADER. (defalias 'nntp-header-number '(macro . #[(header) " BB" [aref header (0)] 3 (#$ . 2671)])) #@41 Set article number of HEADER to NUMBER. (defalias 'nntp-set-header-number '(macro . #[(header number) " F" [aset header 0 number] 4 (#$ . 2805)])) #@34 Return subject string in HEADER. (defalias 'nntp-header-subject '(macro . #[(header) " BB" [aref header (1)] 3 (#$ . 2962)])) #@43 Set article subject of HEADER to SUBJECT. (defalias 'nntp-set-header-subject '(macro . #[(header subject) " F" [aset header 1 subject] 4 (#$ . 3097)])) #@33 Return author string in HEADER. (defalias 'nntp-header-from '(macro . #[(header) " BB" [aref header (2)] 3 (#$ . 3259)])) #@39 Set article author of HEADER to FROM. (defalias 'nntp-set-header-from '(macro . #[(header from) " F" [aset header 2 from] 4 (#$ . 3390)])) #@31 Return xref string in HEADER. (defalias 'nntp-header-xref '(macro . #[(header) " BB" [aref header (3)] 3 (#$ . 3539)])) #@37 Set article xref of HEADER to xref. (defalias 'nntp-set-header-xref '(macro . #[(header xref) " F" [aset header 3 xref] 4 (#$ . 3668)])) #@25 Return lines in HEADER. (defalias 'nntp-header-lines '(macro . #[(header) " BB" [aref header (4)] 3 (#$ . 3815)])) #@39 Set article lines of HEADER to LINES. (defalias 'nntp-set-header-lines '(macro . #[(header lines) " F" [aset header 4 lines] 4 (#$ . 3939)])) #@24 Return date in HEADER. (defalias 'nntp-header-date '(macro . #[(header) " BB" [aref header (5)] 3 (#$ . 4091)])) #@37 Set article date of HEADER to DATE. (defalias 'nntp-set-header-date '(macro . #[(header date) " F" [aset header 5 date] 4 (#$ . 4213)])) #@22 Return Id in HEADER. (defalias 'nntp-header-id '(macro . #[(header) " BB" [aref header (6)] 3 (#$ . 4360)])) #@33 Set article Id of HEADER to ID. (defalias 'nntp-set-header-id '(macro . #[(header id) " F" [aset header 6 id] 4 (#$ . 4478)])) #@47 Return references (or in-reply-to) in HEADER. (defalias 'nntp-header-references '(macro . #[(header) " BB" [aref header (7)] 3 (#$ . 4615)])) #@42 Set article references of HEADER to REF. (defalias 'nntp-set-header-references '(macro . #[(header ref) " F" [aset header 7 ref] 4 (#$ . 4766)])) #@413 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 'nntp-retrieve-headers #[(sequence) "q \nGeÉĉĉ \n \f \n\n@\"\nAT\nNU. b#eTU`W.VڦU_\" Qdb#!dZb! V!eb#؉#V!ebm!{!\f{\ny  mg>!{Ôf/0/\"P0 /\"_0 /\"n0/\"0!/\"0/\"0/\" 0*y%    \f\n\f  \n & B ySVڦU_\"%V%! ." [nntp-server-buffer erase-buffer sequence 0 nil references date lines xref from message-id subject article headers count received last-point number nntp-send-strings-to-server "HEAD" nntp-maximum-request accept-process-output re-search-forward "^[0-9]" t nntp-large-newsgroup 20 message "NNTP: Receiving headers... %d%%" 100 nntp-accept-response re-search-backward looking-at "^[23]" 3 "^\\. $" "NNTP: Receiving headers... done" "\\( ?\n[ ]+\\)+" replace-match " " "NNTP: Parsing headers..." "^[23][0-9][0-9][ ]+\\([0-9]+\\)[ ]+\\(<[^>]+>\\)" string-to-int 1 2 (50 51) "\\(From\\|Subject\\|Date\\|Lines\\|Xref\\|References\\|In-Reply-To\\):[ ]+\\([^ \n]+.*\\) $" c s char-equal 70 83 68 76 88 82 73 "(None)" "(Unknown User)" vector "NNTP: Parsing headers... %d%%" "NNTP: Parsing headers... done"] 13 (#$ . 4923)]) #@158 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 'nntp-open-server #[(host &optional service) "!6\"6!0\f\"#= ==\f*" [host getenv "NNTPSERVER" nil status "" nntp-status-string nntp-open-server-internal service nntp-wait-for-response "^[23].* $" set-process-sentinel nntp-server-process nntp-default-sentinel nntp-send-command "^[25].* $" "MODE" "READER" nntp-close-server-internal "NNTP server is not specified."] 5 (#$ . 6788)]) #@20 Close news server. (defalias 'nntp-close-server #[nil "  != \" \")" [((nntp-close-server-internal)) nntp-server-process nntp-default-sentinel process-sentinel set-process-sentinel nil nntp-server-opened nntp-send-command "QUIT"] 3 (#$ . 7390)]) (byte-code "KM" [nntp-request-quit nntp-close-server] 2) #@98 Return server process status, T or NIL. If the stream is opened, return T, otherwise return NIL. (defalias 'nntp-server-opened #[nil " !>" [nntp-server-process process-status (open run)] 2 (#$ . 7722)]) #@42 Return server status response as string. (defalias 'nntp-status-message #[nil "\"ÔÕOć" [nntp-status-string string-match "[0-9][0-9][0-9][ ]+\\([^ ]*\\).*$" 1 ""] 3 (#$ . 7938)]) #@43 Select article by message ID (or number). (defalias 'nntp-request-article #[(id) " !# " [id number-to-string nntp-send-command "^\\. $" "ARTICLE" nntp-decode-text] 4 (#$ . 8138)]) #@48 Select article body by message ID (or number). (defalias 'nntp-request-body #[(id) " # " [nntp-send-command "^\\. $" "BODY" id nntp-decode-text] 4 (#$ . 8338)]) #@48 Select article head by message ID (or number). (defalias 'nntp-request-head #[(id) " # " [nntp-send-command "^\\. $" "HEAD" id nntp-decode-text] 4 (#$ . 8511)]) #@43 Select article by message ID (or number). (defalias 'nntp-request-stat #[(id) " #" [nntp-send-command "^[23].* $" "STAT" id] 4 (#$ . 8684)]) #@20 Select news GROUP. (defalias 'nntp-request-group #[(group) " #" [nntp-send-command "^[23].*$" "GROUP" group] 4 (#$ . 8835)]) #@25 List active newsgroups. (defalias 'nntp-request-list #[nil "\" " [nntp-send-command "^\\. $" "LIST" nntp-decode-text] 3 (#$ . 8970)]) #@37 List newsgroups (defined in NNTP2). (defalias 'nntp-request-list-newsgroups #[nil "\" " [nntp-send-command "^\\. $" "LIST NEWSGROUPS" nntp-decode-text] 3 (#$ . 9116)]) #@40 List distributions (defined in NNTP2). (defalias 'nntp-request-list-distributions #[nil "\" " [nntp-send-command "^\\. $" "LIST DISTRIBUTIONS" nntp-decode-text] 3 (#$ . 9296)]) #@80 Set current article pointer to the previous article in the current news group. (defalias 'nntp-request-last #[nil "\"" [nntp-send-command "^[23].* $" "LAST"] 3 (#$ . 9485)]) #@34 Advance current article pointer. (defalias 'nntp-request-next #[nil "\"" [nntp-send-command "^[23].* $" "NEXT"] 3 (#$ . 9669)]) #@36 Post a new news in current buffer. (defalias 'nntp-request-post #[nil "\" ed\"!" [nntp-send-command "^[23].* $" "POST" nntp-encode-text nntp-send-region-to-server nntp-wait-for-response "^[23].*$"] 3 (#$ . 9807)]) #@52 Default sentinel function for NNTP server process. (defalias 'nntp-default-sentinel #[(proc status) " ? !" [nntp-server-process nntp-server-opened error "NNTP: Connection closed."] 2 (#$ . 10040)]) #@175 Decode text transmitted by NNTP. 0. Delete status line. 1. Delete `^M' at end of line. 2. Delete `.' at end of buffer (end of text mark). 3. Delete `.' at beginning of line. (defalias 'nntp-decode-text #[nil "qdbnceb`y`|m/hU)!ydby!B`y`|eb#T!E)" [nntp-server-buffer "\n" 1 nil 13 delete-char -1 looking-at "^\\.$" search-forward "\n.." t] 4 (#$ . 10255)]) #@141 Encode text in current buffer for NNTP transmission. 1. Insert `.' at beginning of line. 2. Insert `.' at end of buffer (end of text mark). (defalias 'nntp-encode-text #[nil "dbn ceb#cdbc)" ["\n" search-forward "\n." nil t "." ". \n"] 4 (#$ . 10669)]) #@73 Wait for server RESPONSE after sending CMD and optional ARGS to server. (defalias 'nntp-send-command #[(response cmd &rest args) "q \f #!)" [nntp-server-buffer erase-buffer apply nntp-send-strings-to-server cmd args response nntp-wait-for-response t] 4 (#$ . 10949)]) #@48 Wait for server response which matches REGEXP. (defalias 'nntp-wait-for-response #[(regexp) "\n \nq Feb!0̉!@̉ e`{dby!ỏX\n \f U \"\") V\n V!-" [t 0 nntp-debug-read 10000 dotsize dotnum wait status nntp-server-buffer nntp-accept-response looking-at "[23]" nil "[45]" nntp-status-string -1 regexp buffer-size newnum message "NNTP: Reading %s" make-string 46 ""] 6 (#$ . 11244)]) #@67 Send list of STRINGS to news server as command and its arguments. (defalias 'nntp-send-strings-to-server #[(&rest strings) "@A @QA\n\f P\"*" [strings cmd " " process-send-string nntp-server-process " \n"] 5 (#$ . 11749)]) #@64 Send current buffer region (from BEGIN to END) to news server. (defalias 'nntp-send-region-to-server #[(begin end) " \n # q ed#\n |)" [copy-to-buffer nntp-server-buffer begin end process-send-region nntp-server-process] 4 (#$ . 11996)]) #@70 Open connection to news server on HOST by SERVICE (default is nntp). (defalias 'nntp-open-server-internal #[(host &optional service) "! !!qp!  p +$ !)" [fboundp open-network-stream require tcp get-buffer-create " *nntpd*" nntp-server-buffer buffer-flush-undo erase-buffer kill-all-local-variables t case-fold-search "nntpd" host service "nntp" nntp-server-process nntp-server-name run-hooks nntp-server-hook] 6 (#$ . 12246)]) #@34 Close connection to news server. (defalias 'nntp-close-server-internal #[nil "!\n\n!ĉ" [nntp-server-process delete-process nntp-server-buffer kill-buffer nil] 2 (#$ . 12720)]) #@130 Read response of server. It is well-known that the communication speed will be much improved by defining this function as macro. (defalias 'nntp-accept-response #[nil " !>\f! !!!͏" [process-status nntp-server-process (open run) error "NNTP: Connection closed." nntp-buggy-select message "NNTP: Reading..." sleep-for 1 "" errorcode (accept-process-output nntp-server-process) ((error (byte-code "A@\n‡@A\"" [errorcode "select error: Invalid argument" nil signal] 3)))] 3 (#$ . 12920)]) (provide (quote nntp))