(provide (quote rnews)) (require (quote mail-utils)) (autoload (quote rmail-output) "rmailout" "\ Append this message to Unix mail file named FILE-NAME." t) (autoload (quote news-reply) "rnewspost" "\ Compose and post a reply to the current article on USENET. While composing the reply, use \\[mail-yank-original] to yank the original message into it." t) (autoload (quote news-mail-other-window) "rnewspost" "\ Send mail in another window. While composing the message, use \\[mail-yank-original] to yank the original message into it." t) (autoload (quote news-post-news) "rnewspost" "\ Begin editing a new USENET news article to be posted." t) (autoload (quote news-mail-reply) "rnewspost" "\ Mail a reply to the author of the current article. While composing the reply, use \\[mail-yank-original] to yank the original message into it." t) (defvar rmail-last-file (expand-file-name "~/mbox.news")) (defvar news-startup-file "$HOME/.newsrc" "\ Contains ~/.newsrc") (defvar news-certification-file "$HOME/.news-dates" "\ Contains ~/.news-dates") (defvar news-ignored-headers "^Path:\\|^Posting-Version:\\|^Article-I.D.:\\|^Expires:\\|^Date-Received:\\|^References:\\|^Control:\\|^Xref:\\|^Lines:\\|^Posted:\\|^Relay-Version:\\|^Message-ID:\\|^Nf-ID:\\|^Nf-From:\\|^Approved:\\|^Sender:" "\ All random fields within the header of a message.") (defvar news-mode-map nil) (defvar news-read-first-time-p t) (defvar news-user-group-list nil) (defvar news-current-news-group nil) (defvar news-current-group-begin nil) (defvar news-current-group-end nil) (defvar news-current-certifications nil "\ An assoc list of a group name and the time at which it is known that the group had no new traffic") (defvar news-current-certifiable nil "\ The time when the directory we are now working on was written") (defvar news-message-filter nil "\ User specifiable filter function that will be called during formatting of the news file") (defvar news-list-of-files nil "\ Global variable in which we store the list of files associated with the current newsgroup") (defvar news-list-of-files-possibly-bogus nil "\ variable indicating we only are guessing at which files are available. Not currently used.") (defvar news-group-article-assoc nil) (defvar news-current-message-number 0 "\ Displayed Article Number") (defvar news-total-current-group 0 "\ Total no of messages in group") (defvar news-unsubscribe-groups nil) (defvar news-point-pdl nil "\ List of visited news messages.") (defvar news-no-jumps-p t) (defvar news-buffer nil "\ Buffer into which news files are read.") (defmacro news-push (item ref) (byte-code "AA EE+" [ref item setq cons] 5)) (defmacro news-cadr (x) (byte-code "AADD+" [x car cdr] 3)) (defmacro news-cdar (x) (byte-code "AADD+" [x cdr car] 3)) (defmacro news-caddr (x) (byte-code "AAADDD+" [x car cdr] 4)) (defmacro news-cadar (x) (byte-code "AAADDD+" [x car cdr] 4)) (defmacro news-caadr (x) (byte-code "AAADDD+" [x car cdr] 4)) (defmacro news-cdadr (x) (byte-code "AAADDD+" [x cdr car] 4)) (defmacro news-wins (pfx index) (byte-code "AAAA DFD+" [pfx index file-exists-p concat "/" int-to-string] 6)) (defvar news-max-plausible-gap 2 "\ * In an rnews directory, the maximum possible gap size. A gap is a sequence of missing messages between two messages that exist. An empty file does not contribute to a gap -- it ends one.") (defun news-find-first-and-last (prefix base) (byte-code "AAA !Q!. (defmacro news-/ (a1 a2) (byte-code "AAAA\"!f (defun news-find-first-or-last (pfx base dirn) (byte-code " A CE \\!Q!. CEI #!Q!.A CEI #!Q!?.s I ##))+" [original-dir dirn pfx base offset news-max-plausible-gap file-exists-p "/" int-to-string * 2 / /= 0 + news-find-first-or-last] 21)) (defun rnews nil "\ Read USENET news for groups for which you are a member and add or delete groups. You can reply to articles posted and send articles to any group. Type \\[describe-mode] once reading news to get a list of rnews commands." (interactive) (byte-code "?A CE!^EEE!%!^I ^%^?^I ^?^IA!^ID!^NO!^O ^O ^O )+" [last-buffer news-buffer news-buffer-save buffer-read-only nil t buffer-name make-local-variable rmail-last-file switch-to-buffer get-buffer-create "*news*" news-mode erase-buffer set-buffer-modified-p sit-for 0 message "Getting new USENET news..." news-set-mode-line news-get-certifications news-get-new-news] 13)) (defun news-group-certification (group) (byte-code "AA \"!+" [group news-current-certifications cdr-safe assoc] 4)) (defun news-set-current-certifiable nil (byte-code " AAA #PCEE!+ (defun news-get-certifications nil (byte-code "S?)+" [news-current-certifications ((byte-code "AAA?!%+" [news-current-certifications car-safe var (byte-code "A !A!A!. C\"^?EE !)*+" [file news-certification-file buf substitute-in-file-name find-file-noselect file-exists-p switch-to-buffer norecord ((byte-code "A!+" [buf kill-buffer] 2)) read-from-string buffer-string] 7) ((error (byte-code "?" [nil] 1)))] 4))] 1)) (defun news-write-certifications nil (byte-code "SE)+" [news-current-certifications buf news-certification-file ((byte-code "DA!'^AA!A !^CE !!^E !)+" [news-current-certifications buf news-certification-file "*CeRtIfIcAtIoNs*" print get-buffer switch-to-buffer write-file substitute-in-file-name kill-buffer] 7))] 1)) (defun news-set-current-group-certification nil (byte-code "A \"f B%)+" [cgc news-current-news-group news-current-certifications news-current-certifiable assoc setcdr] 4)) (defun news-set-minor-modes nil "\ Creates a minor mode list that has group name, total articles, and attribute for current article." (byte-code "A A A RBC%^CE!+ (defun news-set-message-counters nil "\ Scan through current news-groups filelist to figure out how many messages are there. Set counters for use with minor mode display." (byte-code "?. (if news-mode-map nil (setq news-mode-map (make-keymap)) (suppress-keymap news-mode-map) (define-key news-mode-map "." (quote beginning-of-buffer)) (define-key news-mode-map " " (quote scroll-up)) (define-key news-mode-map "" (quote scroll-down)) (define-key news-mode-map "n" (quote news-next-message)) (define-key news-mode-map "c" (quote news-make-link-to-message)) (define-key news-mode-map "p" (quote news-previous-message)) (define-key news-mode-map "j" (quote news-goto-message)) (define-key news-mode-map "q" (quote news-exit)) (define-key news-mode-map "e" (quote news-exit)) (define-key news-mode-map "j" (quote news-goto-news-group)) (define-key news-mode-map "n" (quote news-next-group)) (define-key news-mode-map "p" (quote news-previous-group)) (define-key news-mode-map "l" (quote news-list-news-groups)) (define-key news-mode-map "?" (quote describe-mode)) (define-key news-mode-map "g" (quote news-get-new-news)) (define-key news-mode-map "f" (quote news-reply)) (define-key news-mode-map "m" (quote ne ws-mail-other-window)) (define-key news-mode-map "a" (quote news-post-news)) (define-key news-mode-map "r" (quote news-mail-reply)) (define-key news-mode-map "o" (quote news-save-item-in-file)) (define-key news-mode-map "" (quote rmail-output)) (define-key news-mode-map "t" (quote news-show-all-headers)) (define-key news-mode-map "x" (quote news-force-update)) (define-key news-mode-map "A" (quote news-add-news-group)) (define-key news-mode-map "u" (quote news-unsubscribe-current-group)) (define-key news-mode-map "U" (quote news-unsubscribe-group)) (define-key news-mode-map "" (quote news-caesar-buffer-body))) (defun news-mode nil "\ News Mode is used by M-x rnews for reading USENET Newsgroups articles. New readers can find additional help in newsgroup: news.announce.newusers . All normal editing commands are turned off. Instead, these commands are available: . move point to front of this news article (same as Meta-<). Space scroll to next screen of this news article. Delete scroll down previous page of this news article. n move to next news article, possibly next group. p move to previous news article, possibly previous group. j jump to news article specified by numeric position. M-j jump to news group. M-n goto next news group. M-p goto previous news group. l list all the news groups with current status. ? print this help message. C-c C-r caesar rotate all letters by 13 places in the article's body (rot13). g get new USENET news. f post a reply article to USENET. a post an original news article. A add a newsgroup. o save the current article in the named file (append if file exists). C-o output this message to a Unix-format mail file (append it). c \"copy\" (actually link) current or prefix-arg msg to file. warning: target directory and message file must be on same device (UNIX magic) t show all the headers this news article originally had. q quit reading news after updating .newsrc file. e exit updating .newsrc file. m mail a news article. Same as C-x 4 m. x update last message seen to be the current message. r mail a reply to this news article. Like m but initializes some fields. u unsubscribe from current newsgroup. U unsubscribe from specified newsgroup." (interactive) (byte-code "?I ^IA!^?^II!^IA!^?^IA!^?^ID!^IN!^IA!^?^IO!^?^OO!fF % ^UY!+" [news-read-first-time-p t news-current-group-begin news-current-message-number version-control major-mode mode-name text-mode-syntax-table news-mode-map local-abbrev-table text-mode-abbrev-table nil kill-all-local-variables make-local-variable news-current-news-group 0 news-total-current-group news-buffer-save never news-point-pdl news-mode boundp minor-mode-alist ("NEWS" news-minor-modes) "NEWS" news-set-mode-line set-syntax-table use-local-map run-hooks news-mode-hook] 15)) (defun string-subst-char (new old string) (byte-code "AAA !! CAO%^E \"%.  I^, +" [index old string new nil regexp-quote char-to-string 0 string-match] 7)) (defmacro news-update-message-read (ngroup nno) (byte-code "AAAAED E+" [ngroup nno setcar news-cdadr assoc news-group-article-assoc] 5)) (defun news-parse-range (number-string) "\ Parse string representing range of numbers of he form - to a list (a . b)" (byte-code "AA \"f (defun news-get-new-news nil "\ Get new USENET news, if there is any for the current user." (interactive) (byte-code "^??.  q^Ob^OOAE#.* ^UO \"! U \"fz \",?  @ A AED B%)^,7 (defun news-list-news-groups nil "\ Display all the news groups to which you belong." (interactive) (byte-code "??Sq^Ec^Ec^ A .M " "------------------------- ------------------------- " assoc 52 20 int-to-string " " 33] 6)) (defun news-set-mode-line nil "\ Set mode line string to something useful." (byte-code "AC !f !f !, R%^E IIII GZ]OQ%^IA!^DI!+" [mode-line-process news-current-message-number news-current-group-end mode-line-buffer-identification news-current-news-group t " " integerp int-to-string "??" "/" "NEWS: " " " 0 17 set-buffer-modified-p sit-for] 11)) (defun news-goto-news-group (gp) "\ Takes a string and goes to that news group." (interactive (byte-code "AA\"C+" [news-group-article-assoc completing-read "NewsGroup: "] 3)) (byte-code "^AA \"^A !^AA \"+" [news-group-article-assoc gp nil message "Jumping to news group %s..." news-select-news-group "Jumping to news group %s... done."] 5)) (defun news-select-news-group (gp) (byte-code "C \"?f \"A@A (defun news-goto-message (arg) "\ Goes to the article ARG in current newsgroup." (interactive "p") (byte-code "^?. (defun news-select-message (arg) (byte-code ";. EEI #IR @A (defun news-force-update nil "\ updates the position of last article read in the current news group" (interactive) (byte-code "^A@ \"^AA \"+" [news-point-pdl news-current-message-number nil setcdr message "Updated to %d"] 4)) (defun news-next-message (arg) "\ Move ARG messages forward within one newsgroup. Negative ARG moves backward. If ARG is 1 or -1, moves to next or previous newsgroup if at end." (interactive "p") (byte-code "? \\ W+ \" NWfK (defun news-previous-message (arg) "\ Move ARG messages backward in current newsgroup. With no arg or arg of 1, move one message and move to previous newsgroup if at beginning. A negative ARG means move forward." (interactive "p") (byte-code "?A[!+" [arg nil news-next-message] 2)) (defun news-move-to-group (arg) "\ Given arg move forward or backward to a new newsgroup." (byte-code " A \"C A@8%+ @8%+- (defun news-next-group nil "\ Moves to the next user group." (interactive) (byte-code "?AA!^?. (defun news-previous-group nil "\ Moves to the previous user group." (interactive) (byte-code "?AA!^?. (defun news-get-motion-lists (arg listy) "\ Given a msgnumber/group this will return a list of two lists; one for moving forward and one for moving backward." (byte-code " AA?*+" [temp listy result nil out (byte-code ".( CB\",$ \"%^A%^, (defun news-read-in-file (filename) (byte-code "A ^`A !^A ^b^AA!^mf (defun news-convert-format nil (byte-code "S?`AA?AA .@ ?.' "] 2) ((error (byte-code "?" [nil] 1))) narrow-to-region search-forward " From:" " Date:" beginning-of-line kill-line news-delete-headers] 8)) (defun news-show-all-headers nil "\ Redisplay current news item with all original headers" (interactive) (byte-code "^AAA ^C ^E EEE #II (defun news-delete-headers (pos) (byte-code "b^ ;.# [^ ]" forward-char -1] 8)) (defun news-exit nil "\ Quit news reading session and update the .newsrc file." (interactive) (byte-code "EAA!f0 (defun news-update-newsrc-file nil "\ Updates the .newsrc file in the users home dir." (byte-code "EI !! ES .{ @\"%^ A@A@ A@AA@UfD A%^,$ .? @\"%^Db^N @OPEE#.2 A% ^,| " backward-char 1 int-to-string "-" 2 "! " save-buffer kill-buffer] 25)) (defun news-unsubscribe-group (group) "\ Removes you from newgroup GROUP." (interactive (byte-code "AA\"C+" [news-group-article-assoc completing-read "Unsubscribe from group: "] 3)) (byte-code "^A !+" [news-group-article-assoc group nil news-unsubscribe-internal] 2)) (defun news-unsubscribe-current-group nil "\ Removes you from the newsgroup you are now reading." (interactive) (byte-code "?AA!. (defun news-unsubscribe-internal (group) (byte-code "A \"f, \"A@A @A\"^E (defun news-save-item-in-file (file) "\ Save the current article that is being read by appending to a file." (interactive "FSave item in file: ") (byte-code "?Aed#+" [file nil append-to-file] 4)) (defun news-get-pruned-list-of-files (gp-list end-file-no) "\ Given a news group it finds all files in the news group. The arg must be in slashified format. Using ls was found to be too slow in a previous version." (byte-code " . !\". #PA .: A?^ fl % ^ V.g B%^ S% ^,O (defun news-read-files-into-buffer (group reversep) (byte-code "D \"A@@A@A %^?^? ^N ^O \"^N ^@A@BC% ^ ?fT @ @\"^ %^O ^N ^O*OU #UU!R!^O ^N ^I,+" [files-start-end group news-group-article-assoc start-file-no end-file-no buffer-read-only nil news-current-news-group news-current-message-number news-current-group-end news-point-pdl news-list-of-files news-current-group-begin reversep news-path t assoc news-set-mode-line news-get-pruned-list-of-files erase-buffer setcdr news-set-message-counters news-read-in-file string-subst-char 47 46 "/" int-to-string] 16)) (defun news-add-news-group (gp) "\ Resubscribe to or add a USENET news group named GROUP (a string)." (interactive "sAdd news group: ") (byte-code "? III #PSD \"?f* *PAC#fB \"^UU!^UY!^Tc,N \"^a ^a a\"^a AC#^AAAA   OaAC#^`% ^a ^`%^a ^`% ^c UZ\"% ^ec  \"!   @ A AED B%),^e ^ep!,3 \"),> \"))+" [file-dir news-path gp news-group-article-assoc newsrcbuf news-startup-file nil t start end endofline tem range string-subst-char 47 46 assoc find-file-noselect substitute-in-file-name file-directory-p switch-to-buffer 0 search-forward "! " message "Re-subscribing to group %s." backward-char 2 delete-char 1 ":" "Added %s to your list of newsgroups." end-of-buffer insert ": 1-1 " search-backward ": " beginning-of-line end-of-line buffer-substring news-parse-range save-buffer kill-buffer "Newsgroup %s doesn't exist." "Already subscribed to group %s."] 26)) (defun news-make-link-to-message (number newname) "\ Forges a link to an rnews message numbered number (current if no arg) Good for hanging on to a message that might or might not be automatically deleted." (interactive "P FName to link to message: ") (byte-code "?ACEE #E f !, (defun caesar-region (&optional n) "\ Caesar rotation of region by N, default 13, for decrypting netnews." (interactive (byte-code "f !?f IWf! [I\"Z%,' I\"%^N !?.d \\\".* \\HI^ U \\ \\HI^  B \"% ^ G% ^ HHI^ c-+" [current-prefix-arg nil n t caesar-translate-table i lower upper from to str len numberp 13 0 26 % zerop boundp /= 97 "abcdefghijklmnopqrstuvwxyz" message "Building caesar-translate-table..." make-vector 256 upcase 65 "Building caesar-translate-table... done" region-beginning region-end buffer-substring kill-region] 19)) (defun news-caesar-buffer-body (&optional rotnum) "\ Caesar rotates all letters in the current buffer by 13 places. Used to encode/decode possibly offensive messages (commonly in net.jokes). With prefix arg, specifies the number of places to rotate each letter forward. Mail and USENET news headers are not rotated." (interactive (byte-code "f %))+" [current-prefix-arg nil buffer-status buffer-read-only major-mode mail-header-separator t rotnum set-mark search-forward " " equal news-mode "" caesar-region] 6)) .