[net.sources] news 2.10.2 misc part 1 of 1

rick@seismo.UUCP (Rick Adams) (10/07/84)

if test ! -d misc
then
	echo mkdir misc
	mkdir misc
fi
echo x - misc/dirform
sed 's/^X//' >misc/dirform <<'*-*-END-of-misc/dirform-*-*'
XName of site.
XWhat the site is all about.
X
XName of contact person at site.
XElectronic mail address of contact person.
XU.S. Mail address of contact person.
XPhone number of contact person.
X
XSystems with whom news articles are exchanged.
X(what kind of link, who the neighbor(s) are).
X
XSystems with whom mail is exchanged.
X(what kind of link, who the neighbor(s) are, what frequency
Xof connection, whether or not you'll pass outside mail along).
X
XWillingness (or lack thereof) to connect to new sites that
Xwant to join usenet.  If you run uucp, tell if new sites can
Xcall you, if you will poll them, what your policy is.
XIf on the arpanet, are you willing to forward news on to new
Xsites by establishing an arpanet usenet connection?
X
XIf you want to publish your uucp phone number, login, and password,
Xinclude that info.
*-*-END-of-misc/dirform-*-*
echo x - misc/euuname.sh
sed 's/^X//' >misc/euuname.sh <<'*-*-END-of-misc/euuname.sh-*-*'
X: From cbosg!mcnc!unc!smb Sat Feb 27 05:45:42 1982
X: Date: 27-Feb-82 05:45:41-EST
X
X: Heres a shell file that should be distributed with netnews.
X: Its intended to be the program that replies to the mapping control
X: message, it extracts info from the L.sys file, add extra names, and
X: suppresses private ones.
X
X: To use this, change the senduuname control message to call
X: LIBDIR/euuname instead of uuname, and install this script in that location.
X: the lists secret and extras are names you want deleted from added to
X: your uuname output.
X
XPATH=/usr/ucb:/bin:/usr/bin
Xexport PATH
Xcd /usr/lib/news
Xtrap "rm -f /tmp/nam$$; exit" 0 1 2
Xsort secret >/tmp/nam$$
Xecho Subject: edited uuname output enclosed
X((cat extras; uuname) | sort | comm -23 - /tmp/nam$$) | uniq
*-*-END-of-misc/euuname.sh-*-*
echo x - misc/fa.recording
sed 's/^X//' >misc/fa.recording <<'*-*-END-of-misc/fa.recording-*-*'
XRead the directions!  You're supposed to use mail to post to fa
Xnewsgroup, not inews!  Also, don't include any proprietary information.
*-*-END-of-misc/fa.recording-*-*
echo x - misc/net.recording
sed 's/^X//' >misc/net.recording <<'*-*-END-of-misc/net.recording-*-*'
XPosting to this newsgroup will cause your article to be broadcast to
Xthe entire USENET, including sites outside of Bell Labs.  You should
Xnot include any proprietary information in this article.
*-*-END-of-misc/net.recording-*-*
echo x - misc/restore.active
sed 's/^X//' >misc/restore.active <<'*-*-END-of-misc/restore.active-*-*'
X: recreate the active file from readers .newsrc files
X: and from the existing articles
X
Xlib=${1-/usr/lib/news}
Xtmp=/tmp/$$
X: Find the highest numbered articles from the .newsrcs
Xcat `sed 's/[^:]*:[^:]*:[^:]*:[^:]*:[^:]*://
Xs/:.*//' /etc/passwd | sort -u | sed 's;$;/.newsrc;' ` 2>/dev/null  | 
Xsed '/:/!d
Xs/:.*[,-]/ /
Xs/: */ /'  >$tmp
X: in case there are groups no-one reads, look in the list of newsgroups
Xsed 's/[ 	].*/ 1/' $lib/newsgroups >>$tmp
Xsort  +0 -1 +1nr  $tmp | sort -m +0u -1 | sed 's/$/ 00001 y/
X/^fa/s/y$/n/' >$lib/active
X: finally, scan the spool directory and fix up the active file.
X$lib/expire -u
Xrm -f $tmp
*-*-END-of-misc/restore.active-*-*
echo x - misc/rnews.ml
sed 's/^X//' >misc/rnews.ml <<'*-*-END-of-misc/rnews.ml-*-*'
XDate: 25 Apr 1983 10:29-PDT (Monday)
XFrom: Jim Rees  <jim@uw-beaver>
XSubject: rnews.ml
XMessage-Id: <83/04/25 1029.783@uw-beaver>
X
X	Emacs Readnews Distribution
X
XThis is an mlisp package, rnews.ml, for reading the news in Gosling
XEmacs.  It is similar to rmail.ml, and in fact depends on some of the
Xfunctions in rmail.ml.  Our rmail.ml is modified, but I think this will
Xalso work with the unmodified rmail.ml.
X
XThis version is for use with news 2.10.  There is a different version for
Xuse with news 2.9.
X
XTo install rnews, install rnews.ml in your emacs/maclib directory.  In your
Xprofile, put an autoload for rnews.ml:
X
X	(autoload "rnews" "rnews.ml")
X
XThen enter emacs and do ESC-X-rnews.
X
XThe rnews directory is kept in your ~/Messages directory, so if you
Xdon't use rmail you might have to make this directory before you can
Xuse rnews.
X
XThere is an info page, written by grkermit!chris.  To install it, change to
Xyour Emacs databases directory and run "dbadd info emacs:rnews" with the
Xinfo page as standard input.  To be complete you should change all the info
Xnodes pointing to rnews, for example "up", "previous", and "next", but it
Xwill work if you don't change them.
X
XIf you have any suggestions or criticisms, or want your name added to the
Xdistribution list for new releases and updates, send mail to
Xemacs-rnews-request at uw-beaver via uucp or Arpanet.  You can send mail to
Xthe list by mailing to emacs-rnews at uw-beaver.
X
XHere are the info page and rnews.ml:
X
XFile: emacs     Node: rnews     Up: Packages
X
X Unix Emacs readnews facility.
X
X"rnews" is used for reading news.  Executing it places your news
Xdirectory into a window and enters a special command interpretation loop.
XThe commands that it understands are:
X
Xp          move to the previous article.
Xn          move to the next article.
Xf          move forward in the current article.
Xb and <backspace>
X           move backward in the current article.
Xd          delete the current article. (the one indicated by '>')
Xu          undelete the current article.
XD          delete the article at the cursor.
XU          undelete the article at the cursor.
Xr          reply to the current article.
Xm          enter smail, to send mail.
Xa          append the current article to a file.
XF          Post a followup to the current article.
XP          Post an article.
Xq          quit out of Rnews, saving undeleted articles.
X?          display the info page for rnews
X<          go to the first article
X>          go to the last article
Xs          asks for a number, skips down that number of articles
Xg          asks for a number, goes to the article that many lines from the top
X`          decrypts a net.jokes "rot 13" article
XH          show the entire article header, including "junk" lines
X^X-U       unsubscribe to the current group
X:          execute an emacs extended command
X<space> and <return>
X           make the article at the cursor be the current article
X
XWhen in Post mode:
X
X^Xd        positions you in the Distribution: field of the message,
X           creating it if necessary.
X
X
XWhile in rnews, the current article is indicated with an ">" on the left
Xmargin.  You can move the cursor around with C-N, C-P, C-V, arrow keys,
Xsearches etc.  If you move the cursor, and want to see an article far from
Xthe current article, <space> or <return> makes the article at the cursor
Xcurrent.
X
XIf you provide an argument to the rnews command (usually with ^U) you will
Xbe put into rnews, but the directory will not be updated to include new
Xarticles.  This is much faster and is useful, for example, if you just want
Xto post a new article or re-read an old one.
X
X------------------------------ Rnews.ml----------------------------------
X(if (! (is-bound rmail-default-log))
X    (load "rmail.ml"))
X(message "Loading the news system, please wait...")
X(sit-for 0)
X
X; Unix Emacs readnews facility.
X
X; "rnews" is used for reading news.  Executing it places your news
X; directory into a window and enters a special command interpretation loop.
X; The commands that it understands are:
X;  p	move to the previous message.
X;  n	move to the next message.
X;  f	move forward in the current message.
X;  b	move backward in the current message.
X;  d	delete the current message.
X;  u	undelete the last deleted message.
X;  D	delete the article at the cursor.
X;  U    undelete the article at the cursor.
X;  r	reply to the current message.
X;  m	enter smail, to send mail.
X;  a	append the current message to a file.
X;  F	Post a followup to the current message.
X;  P	Post a message.
X;  q	quit out of RMail, appending all undeleted messages to mbox.
X;  ?	display the info page for rnews
X;  <	go to the first article
X;  >	go to the last article
X;  s	asks for a number, skips down that number of articles
X;  g	asks for a number, goes to the article that many lines from the top
X;  `	decrypts a net.jokes "rot 13" article
X;  H	show the entire article header, including "junk" lines
X;  ^X-U	unsubscribe to the current group
X;  :	execute an emacs extended command
X;  <space> and <return>
X;	   make the article at the cursor be the current article
X
X; When in Post mode,
X;  ^Xd	positions you in the Distribution: field of the message,
X; 	creating it if necessary.
X
X; If you want replies sent back along the path by which they arrived,
X; change the 1 in (setq internet-replies 1) to 0.  You will need to do
X; this if your mail program doesn't do automatic uucp routing.
X
X; "smail" is used for sending mail.  It places you in a buffer for
X; constructing the message and locally defines a few commands:
X;  ^X^S	send the mail -- if all went well the window will disappear,
X;	otherwise a message indicating which addresses failed will appear
X;	at the bottom of the acreen.  Unfortunatly, the way the mailers on
X;	Unix work, the message will have been sent to those addresses which
X;	succeded and not to the others, so you have to delete some
X;	addresses and fix up the others before you resend the message.
X;  ^Xt	positions you in the To: field of the message.
X;  ^Xc	positions you in the Cc: field of the message, creating it if it
X;	doesn't already exist.
X; 		The abbrev facility is used for mail address expansion,
X; 		the file /usr/local/lib/emacs/RMailAbbrevs should contain
X; 		abbrev definitions to expand login names to their
X;		proper mail address.  This gets used at CMU since we have
X;		7 VAXen, 4 10's and countless 11's;  remembering where a
X;		person usually logs in is nearly impossible.
X;  ^Xs	positions you in the Subject: field of the message.
X;  ^Xa	positions you to the end of the body of the message, ready to
X; 	append more text.
X
X(defun
X    (rnews nbx internet-replies
X	this-from this-id this-length
X
X	(setq internet-replies 1)
X	(setq nbx (concat (getenv "HOME") "/Messages/Newsbox"))
X	(message "Please wait while I read the news...")
X	(sit-for 0)
X	(save-window-excursion
X	    (pop-to-buffer "rnews-directory")
X	    (setq mode-line-format
X		(concat "     News from message file "
X		    (substr nbx 1 -1)
X		    "      %M   %[%p%]"))
X	    (setq mode-string "RNews")
X	    (erase-buffer)
X	    (set-mark)
X	    (if (! prefix-argument-provided)
X		(filter-region (concat "readnews -e >> " nbx)))
X	    (read-file nbx)
X	    (end-of-file)
X	    (setq case-fold-search 0)
X	    (if (error-occured (re-search-reverse "^[>N ]"))
X		(beginning-of-file)
X		(next-line)
X	    )
X	    (error-occured
X		(re-replace-string "^" "N "))
X	    (setq case-fold-search 1)
X	    (save-excursion
X		(temp-use-buffer "Full Header")
X		(setq needs-checkpointing 0)
X	    )
X	    (rnews-position)
X	    (rnews-mark)
X	    (sit-for 0)
X	    (message "Type ^C to exit rnews; ? for help")
X	    (recursive-edit)
X	    (pop-to-buffer "rnews-directory")
X	    (rnews-erase-messages)
X	    (if buffer-is-modified (write-current-file))
X	    (temp-use-buffer "current-message")
X	    (setq buffer-is-modified 0)
X	)
X	(novalue)
X    )
X)
X
X(defun
X    (rnews-position
X	(beginning-of-line)
X	(if (! (looking-at "^>"))
X	    (progn
X		(beginning-of-file)
X		(if (error-occured (re-search-forward "^>"))
X		    (if (error-occured (re-search-forward "^N"))
X			(progn
X			    (end-of-file)
X			    (previous-line)
X			)
X		    )
X		)
X		(beginning-of-line)
X	    )
X	)
X    )
X)
X
X(defun
X    (rnews-pickup rnews-file
X	(beginning-of-line)
X	(save-excursion
X	    (provide-prefix-argument 2 (forward-character))
X	    (set-mark)
X	    (search-forward " ")
X	    (backward-character)
X	    (copy-region-to-buffer "Scratch Stuff")
X	    (temp-use-buffer "Scratch Stuff")
X	    (setq needs-checkpointing 0)
X	    (beginning-of-file)
X	    (set-mark)
X	    (error-occured
X		(replace-string "." "/"))
X	    (end-of-line)
X	    (setq rnews-file (region-to-string))
X	    (pop-to-buffer "current-message")
X	    (setq needs-checkpointing 0)
X	    (setq this-from "")
X	    (setq this-length "")
X	    (setq this-id "")
X	    (if (error-occured
X		    (read-file (concat "/usr/spool/news/" rnews-file)))
X		(progn
X		    (erase-buffer)
X		    (setq mode-line-format
X			(concat "Expired article " rnews-file)))
X		(progn
X		    (setq case-fold-search 1)
X		    (beginning-of-file)
X		    (if (error-occured (search-forward "\n\n"))
X			(message "Garbled header")
X			(rnews-fix-header))
X		    (set-rnews-mode-line-format))
X	    )
X	)
X    )
X
X    (rnews-fix-header
X	(set-mark)
X	(beginning-of-file)
X	(copy-region-to-buffer "Full Header")
X	(narrow-region)
X	(convert-head "Posted:" "Date:")
X	(convert-head "Title:" "Subject:")
X	(convert-head "Article-I.D.:" "Message-ID:")
X	(error-occured
X	    (re-search-forward "^From:[ \t]")
X	    (end-of-line)
X	    (set-mark)
X	    (re-search-reverse "[!:@]")
X	    (re-search-reverse "[!: ]")
X	    (forward-character)
X	    (setq this-from (region-to-string))
X	    (beginning-of-file)
X	)
X	(error-occured
X	    (re-search-forward "^Lines:[ \t]*\\(.*\\)")
X	    (region-around-match 1)
X	    (setq this-length (region-to-string))
X	    (beginning-of-file)
X	    (re-replace-string "^Lines:.*\n" "")
X	    (beginning-of-file)
X	)
X	(error-occured
X	    (re-search-forward "^Message-ID:[ \t]*\\(.*\\)")
X	    (region-around-match 1)
X	    (setq this-id (region-to-string))
X	    (beginning-of-file)
X	    (re-replace-string "^Message-ID:.*\n" "")
X	    (beginning-of-file)
X	)
X	(error-occured (re-replace-string "^.*-version:.*\n" ""))
X	(error-occured (re-replace-string "^Path:.*\n" ""))
X	(error-occured (re-replace-string "^Sender:.*\n" ""))
X	(error-occured (re-replace-string "^.*received:.*\n" ""))
X	(widen-region)
X	(if (= (length this-length) 0)
X	    			; The constant 38 comes from the average
X				; line length of 356 articles in net.*
X	    (setq this-length (concat "~" (/ (buffer-size) 38))))
X    )
X
X    (convert-head re1 re2
X	(setq re1 (concat "^" (arg 1)))
X	(setq re2 (concat "^" (arg 2)))
X	(if (error-occured (re-search-forward re2))
X	    (error-occured (re-replace-string re1 (arg 2)))
X	    (beginning-of-file))
X	(error-occured (re-replace-string (concat re1 ".*\n") ""))
X    )
X
X    (rnews-show-full-header
X	(save-window-excursion
X	    (temp-use-buffer "current-message")
X	    (beginning-of-file)
X	    (set-mark)
X	    (error-occured
X		(search-forward "\n\n")
X		(erase-region)
X		(yank-buffer "Full Header")
X	    )
X	)
X    )
X
X    (rnews-next-page
X	(save-excursion
X	    (pop-to-buffer "current-message")
X	    (next-page)
X	    (set-rnews-mode-line-format)
X	)
X    )
X    
X    (rnews-previous-page
X	(save-excursion
X	    (pop-to-buffer "current-message")
X	    (previous-page)
X	    (set-rnews-mode-line-format)
X	)
X    )
X
X    (set-rnews-mode-line-format from
X	(save-excursion 
X	    (temp-use-buffer "Scratch Stuff")
X	    (erase-buffer)
X	    (insert-string this-from)
X	    (set-mark)
X	    (beginning-of-line)
X	    (error-occured (replace-string "%" "%%"))
X	    (setq from (region-to-string))
X	    (use-old-buffer "current-message")
X	    (end-of-file)
X	    (setq mode-line-format
X		(concat
X		    "From: " from
X		    (if (!= (length this-length) 0)
X			(concat "  Lines: " this-length)
X			"")
X		    "  %[%p%]"
X		    (if (dot-is-visible)
X			""
X			"  --More--")
X		)))
X    )
X)
X
X(defun
X    (rnews-erase-messages
X	(save-excursion
X	    (pop-to-buffer "rnews-directory")
X	    (beginning-of-file)
X	    (error-occured
X		(while 1
X		    (re-search-forward "^.D")
X		    (beginning-of-line)
X		    (set-mark)
X		    (end-of-line)
X		    (forward-character)
X		    (erase-region)
X		)
X	    )
X	)
X    )
X)
X
X(defun
X    (rnews-com
X	(argc)
X	(rnews)
X	(exit-emacs)
X    )
X
X    (rnews-next-message
X	(rnews-position)
X	(delete-next-character)
X	(insert-character ' ')
X	(beginning-of-line)
X	(next-line)
X	(if (eobp) (progn (previous-line)
X			  (message "You're at the last message already")))
X	(delete-next-character)
X	(insert-character '>')
X	(rnews-pickup)
X    )
X
X    (rnews-previous-message
X	(rnews-position)
X	(delete-next-character)
X	(insert-character ' ')
X	(previous-line)
X	(beginning-of-line)
X	(delete-next-character)
X	(insert-character '>')
X	(rnews-pickup)
X    )
X
X    (rnews-delete-message
X	(rnews-position)
X	(forward-character)
X	(delete-next-character)
X	(insert-character 'D')
X	(beginning-of-line)
X    )
X
X    (rnews-undelete-message
X	(rnews-position)
X	(forward-character)
X	(delete-next-character)
X	(insert-character ' ')
X	(beginning-of-line)
X    )
X
X    (rnews-delete-message-at-cursor
X	(beginning-of-line)	
X	(forward-character)
X	(delete-next-character)
X	(insert-character 'D')
X	(beginning-of-line)
X    )
X
X    (rnews-undelete-message-at-cursor
X	(beginning-of-line)
X	(forward-character)
X	(delete-next-character)
X	(insert-character ' ')
X	(beginning-of-line)
X    )
X
X    (rnews-goto-message n
X	(setq n (get-tty-string "Goto message number: "))
X	(rnews-unmark)
X	(beginning-of-file)
X	(provide-prefix-argument n (next-line))
X	(rnews-mark)
X    )
X)
X
X(defun
X    (rnews-help
X	(&info "emacs" "rnews")))
X
X(defun
X    (rnews-reply subject dest excess refs
X	(setq subject "")
X	(setq dest "")
X	(setq excess "")
X	(save-window-excursion
X	    (pop-to-buffer "current-message")
X	    (setq case-fold-search 1)
X	    (beginning-of-file)
X	    (search-forward "\n\n")
X	    (set-mark)
X	    (beginning-of-file)
X	    (narrow-region)
X	    (error-occured
X		(re-search-forward "^Subject:[ \t]*\\(.*\\)")
X		(region-around-match 1)
X		(setq subject (region-to-string))
X		(if (!= (substr subject 1 3) "Re:")
X		    (setq subject (concat "Re: " subject))
X		)
X	    )
X	    (save-excursion
X		(temp-use-buffer "Full Header")
X		(beginning-of-file)
X		    (if internet-replies
X			(if (error-occured (re-search-forward
X					       "^Reply-To:[ \t]*\\(.*\\)"))
X			    (setq dest this-from)
X			    (progn
X				(region-around-match 1)
X				(setq dest (region-to-string)))
X			)
X			(progn
X			    (if (error-occured (re-search-forward
X				    "^Path:[ \t]*[^ \t!]*!\\(.*\\)"))
X				(re-search-forward
X				    "^From:[ \t]*[^ \t!]*!\\(.*\\)"))
X			    (region-around-match 1)
X			    (setq dest (region-to-string))))
X	    )
X	    (beginning-of-file)
X	    (error-occured edest
X		(save-excursion 
X		    (temp-use-buffer "Scratch Stuff")
X		    (setq needs-checkpointing 0)
X		    (erase-buffer)
X		    (insert-string dest)
X		    (set-mark)
X		    (beginning-of-file)
X		    (if (! (error-occured
X			(re-search-forward " (\\(.*\\))")))
X			(progn
X			    (region-around-match 1)
X			    (setq dest (region-to-string))
X			    (beginning-of-file)
X			    (insert-string (concat dest "  <"))
X			    (re-replace-string "  *(.*" ">")
X			    (end-of-line)
X			    (set-mark)
X			    (beginning-of-line)
X			    (setq dest (region-to-string))
X			)
X		    )
X		    (error-occured 
X			(re-replace-string
X			    "  *at  *[^,\n]*\\| *@ *[^,\n]*\\| *([^)\n]*)\\| *<[^>\n]*>"
X			    ""))
X		    (error-occured
X			(re-replace-string ".*!" ""))
X		    (setq edest (region-to-string))
X		)
X		(error-occured
X		    (re-search-forward "^Date:[ \t]*\\(.*\\)")
X		    (region-around-match 1)
X		)
X		(setq excess (concat
X				 "In-Reply-To: "
X				 edest "'s message of "
X				 (region-to-string)
X				 "\n"))
X		(beginning-of-file)
X	        (if (error-occured
X			(re-search-forward "^References:[ \t]*\\(.*\\)")
X			(region-around-match 1)
X			(setq refs (concat (region-to-string) " " this-id)))
X		    (setq refs this-id))
X	    )
X	    (widen-region)
X	    (pop-to-buffer "send-mail")
X	    (setq needs-checkpointing 0)
X	    (setq case-fold-search 1)
X	    (erase-buffer)
X	    (insert-string subject)
X	    (newline)
X	    (insert-string dest)
X	    (newline)
X	    (insert-string excess)
X	    (insert-string (concat "References: " refs "\n"))
X	    (do-mail-setup)
X	)
X	(rnews-position)
X	(if (looking-at "^>")
X	    (progn
X		(forward-character)
X		(delete-next-character)
X		(insert-character 'A')
X		(beginning-of-line)))
X    )
X)
X
X(defun
X    (rnews-followup newsgroups subject refs
X	(setq newsgroups "")
X	(setq subject "")
X	(setq refs "")
X	(save-window-excursion
X	    (pop-to-buffer "current-message")
X	    (beginning-of-file)
X	    (search-forward "\n\n")
X	    (set-mark)
X	    (beginning-of-file)
X	    (narrow-region)
X	    (error-occured
X		(re-search-forward "^Newsgroups:[ \t]*\\(.*\\)")
X		(region-around-match 1)
X		(setq newsgroups (region-to-string))
X	    )
X	    (save-excursion
X		(temp-use-buffer "Scratch Stuff")
X		(setq needs-checkpointing 0)
X		(erase-buffer)
X		(insert-string newsgroups)
X		(beginning-of-file)
X		(error-occured
X		    (replace-string "general" "followup"))
X		(set-mark)
X		(end-of-file)
X		(setq newsgroups (region-to-string))
X	    )
X	    (beginning-of-file)
X	    (error-occured
X		(re-search-forward "^Subject:[ \t]*\\(.*\\)")
X		(region-around-match 1)
X		(setq subject (region-to-string))
X		(if (!= (substr subject 1 3) "Re:")
X		    (setq subject (concat "Re: " subject))
X		)
X	    )
X	    (beginning-of-file)
X	    (if (error-occured
X		    (re-search-forward "^References:[ \t]*\\(.*\\)")
X		    (region-around-match 1)
X		    (setq refs (concat (region-to-string) " " this-id)))
X		(setq refs this-id))
X	    (beginning-of-file)
X	    (widen-region)
X	    (pop-to-buffer "send-mail")
X	    (setq needs-checkpointing 0)
X	    (setq case-fold-search 1)
X	    (erase-buffer)
X	    (insert-string (concat "Newsgroups: " newsgroups))
X	    (newline)
X	    (insert-string (concat "Subject: " subject))
X	    (newline)
X	    (insert-string (concat "References: " refs))
X	    (newline)
X	    (newline)
X	    (rnews-do-post)
X	)
X	(rnews-position)
X	(if (looking-at "^>")
X	    (progn
X		(forward-character)
X		(delete-next-character)
X		(insert-character 'F')
X		(beginning-of-line)))
X    )
X
X    (rnews-post
X	(save-window-excursion
X	    (pop-to-buffer "send-mail")
X	    (setq needs-checkpointing 0)
X	    (setq case-fold-search 1)
X	    (erase-buffer)
X	    (insert-string "Newsgroups: \nSubject: \n\n")
X	    (beginning-of-file)
X	    (end-of-line)
X	    (rnews-do-post)
X	)
X    )
X
X    (rnews-do-post rnews-do-send
X	(setq rnews-do-send 1)
X	(setq right-margin 72)
X	(local-bind-to-key "exit-emacs" "\^X\^S")
X	(local-bind-to-key "exit-emacs" "\^X\^F")
X	(local-bind-to-key "rnews-abort-send" "\^X\^A")
X	(local-bind-to-key "justify-paragraph" "\ej")
X	(local-bind-to-key "rnews-post-goto-dist" "\^Xd")
X	(while (= rnews-do-send 1)
X	    (progn
X		(recursive-edit)
X		(if (= rnews-do-send 1)
X		    (rnews-call-inews))))
X    )
X
X    (rnews-post-goto-dist	; Move to the "Distribution:" field
X	(beginning-of-file)
X	(if (error-occured (re-search-forward "^Distribution:.*"))
X	    (progn (re-search-forward "\n\n\\|^Subject:.*\n.")
X		(backward-character)
X		(backward-character)
X		(insert-string "\nDistribution: ")))
X    )
X
X    (rnews-call-inews inews-errors
X	(save-excursion
X	    (beginning-of-file)
X	    (set-mark)
X	    (end-of-file)
X	    (copy-region-to-buffer "Delivery-errors")
X	)
X	(message "Sending...")
X	(sit-for 0)
X	(save-window-excursion
X	    (temp-use-buffer "Delivery-errors")
X	    (setq needs-checkpointing 0)
X	    (beginning-of-file)
X	    (set-mark)
X	    (end-of-file)
X	    (filter-region "inews -h")
X	    (beginning-of-file)
X	    (set-mark)
X	    (error-occured (re-replace-string "\n\n* *" "; "))
X	    (end-of-line)
X	    (setq inews-errors (region-to-string))
X	    (if (= (length inews-errors) 0)
X		(progn
X		    (setq rnews-do-send 0)
X		    (message "Posted")
X		)
X		(message inews-errors)
X	    )
X	)
X    )
X
X    (rnews-abort-send
X	(if (!= "y" (substr (get-tty-string
X				"Do you really want to abort the message? ")
X			    1 1))
X	    (error-message "Turkey!"))
X	(setq rnews-do-send 0)
X	(exit-emacs)
X    )
X)
X
X(defun
X    (rnews-unmark
X	(error-occured
X	    (rnews-position)
X	    (delete-next-character)
X	    (insert-character ' ')
X	    (beginning-of-line)))
X    
X    (rnews-mark
X	(beginning-of-line)
X	(if (error-occured
X		(if (eobp)
X		    (re-search-reverse "^.")
X		    (progn
X			(re-search-forward "^.")
X			(beginning-of-line)))
X	    )
X	    (message "No messages")
X	    (progn
X		(delete-next-character)
X		(insert-character '>')
X		(rnews-pickup))
X	)
X    )
X
X    (rnews-first-message
X	(rnews-unmark)
X	(beginning-of-file)
X	(rnews-mark)
X    )
X
X    (rnews-last-message
X	(rnews-unmark)
X	(end-of-file)
X	(rnews-mark)
X    )
X
X    (rnews-skip n
X	(setq n (get-tty-string "Skip messages: "))
X	(rnews-unmark)
X	(provide-prefix-argument n (next-line))
X	(rnews-mark)
X    )
X
X    (rnews-this-message save-dot
X	(setq save-dot (dot))
X	(rnews-unmark)
X	(goto-character save-dot)
X	(rnews-mark)
X    )
X
X    (rnews-decrypt-joke
X	(save-window-excursion
X	    (temp-use-buffer "current-message")
X	    (beginning-of-file)
X	    (search-forward "\n\n")
X	    (set-mark)
X	    (end-of-file)
X	    (filter-region "tr a-zA-Z n-za-mN-ZA-M")
X	)
X    )
X
X    (rnews-unsubscribe group newsrc
X	(beginning-of-line)
X	(save-excursion
X	    (provide-prefix-argument 2 (forward-character))
X	    (set-mark)
X	    (search-forward " ")
X	    (search-reverse "/")
X	    (setq group (region-to-string))
X	    (temp-use-buffer ".newsrc")
X	    (if (error-occured (setq newsrc (getenv "NEWSRC")))
X		(setq newsrc (concat (getenv "HOME") "/.newsrc")))
X	    (read-file newsrc)
X	    (if (error-occured (search-forward (concat group ":")))
X		(message "Already unsubscribed")
X		(progn
X		    (delete-previous-character)
X		    (insert-character '!')
X		    (write-current-file)
X		    (message (concat "Unsubscribed from " group))))
X	)
X    )
X)
X
X(save-excursion i
X    (temp-use-buffer "rnews-directory")
X    (setq i ' ')
X    (while (< i 128)
X	(local-bind-to-key "illegal-operation" i)
X	(setq i (+ i 1)))
X    (local-bind-to-key "rnews-next-page" 'f')
X    (local-bind-to-key "rnews-previous-page" 'b')
X    (local-bind-to-key "rnews-previous-page" '^H')
X    (local-bind-to-key "rnews-next-message" 'n')
X    (local-bind-to-key "rnews-previous-message" 'p')
X    (local-bind-to-key "rnews-delete-message" 'd')
X    (local-bind-to-key "rnews-undelete-message" 'u')
X    (local-bind-to-key "rnews-delete-message-at-cursor" 'D')
X    (local-bind-to-key "rnews-undelete-message-at-cursor" 'U')
X    (local-bind-to-key "rnews-help" '?')
X    (local-bind-to-key "exit-emacs" 'q')
X    (local-bind-to-key "rnews-reply" 'r')
X    (local-bind-to-key "rnews-followup" 'F')
X    (local-bind-to-key "rnews-post" 'P')
X    (local-bind-to-key "smail" 'm')
X    (local-bind-to-key "rnews-goto-message" 'g')
X    (local-bind-to-key "rnews-first-message" '<')
X    (local-bind-to-key "rnews-last-message" '>')
X    (local-bind-to-key "rnews-skip" 's')
X    (local-bind-to-key "rmail-append" 'a')
X    (local-bind-to-key "rmail-shell" '!')
X    (local-bind-to-key "execute-extended-command" ':')
X    (local-bind-to-key "rnews-this-message" ' ')
X    (local-bind-to-key "rnews-this-message" '\r')
X    (local-bind-to-key "rnews-decrypt-joke" '`')
X    (local-bind-to-key "rnews-show-full-header" 'H')
X    (local-bind-to-key "rnews-unsubscribe" "\^Xu")
X)
*-*-END-of-misc/rnews.ml-*-*
echo x - misc/sendnewsmail
sed 's/^X//' >misc/sendnewsmail <<'*-*-END-of-misc/sendnewsmail-*-*'
XFrom cbosg!ucbvax!decvax!ittvax!swatt Thu Mar 25 07:06:53 1982
XDate: Wed Mar 24 20:29:56 1982
XFrom: cbosg!ucbvax!decvax!ittvax!swatt
XSubject: sendnewsmail script
XVia: cbosgd.uucp (V3.73 [1/5/82]); 25-Mar-82 07:06:53-EST (Thu)
XMail-From: cbosg received by cbosgd at 25-Mar-82 07:06:51-EST (Thu)
XTo: cbosgd!mark
XStatus: R
X
X
XMark:
X
XI find the following handy as a mail interface to news; you don't have
Xto remake the aliases database everytime a new newsgroup gets formed.
X
X	- Alan
X=======================================================================
X#! /bin/sh
X: '/*********************************************************************
X   program:	sendnewsmail
X   description:	Send news items from mail
X   programmer:	Alan S. Watt
X		(ittvax!swatt)
X   
X   Sccsid=@W@
X
X   usage:
X	Not invoked by user: called as program mail alias
X	News item title and newsgroup(s) are specified on the
X	mail subject line by:
X
X	Subj: <news item title> : <newsgroup> ...
X
X	Several (blank separated) newsgroups may be specified;
X	the news article will be submitted to each.  There is
X	no way to embed a colon character in the title, so there
X	can only be one colon on the subject line.
X
X   arguments:
X	None
X   
X   notes:
X	To install this, put it someplace safe from system updates
X	(I use /usr/lib/news), and put an alias in the system
X	mail alias file (/usr/lib/aliases) that names this program
X	as the alias for the use "news":
X
X		news:"|/usr/lib/news/sendnewsmail"
X
X   history:
X	11/11/81	original version
X	11/19/81	fixed to properly handle default newsgroup
X	03/13/82	changes to work with "B" netnews
X	03/35/82	Modest documentation changes
X   *********************************************************************/'
X
XPROGRAM_NAME='sendnewsmail'
XVERSION_NUMBER='@I@'
XTOOL_LOG='/usr/advanced/logs/testlog'
XUSAGE='mail news'
X
X
X: 'mail alias program to send news items through mail(1)'
X: 'need to get newsgroup and title from subject line'
X
Xtempf=/tmp/news$$.tmp
Xerrorf=/tmp/news$$.err
X
X: 'copy standard input to a temporary file'
Xcat >$tempf
X
X: 'read the message and grab title and newsgroups from the
X   Subject line. Grab the sender from the From line.
X   Header ends on first blank line (/^$/).
X  '
Xeval `sed -n '
X/^Subj/	{
X	s/^Subj[^ :]*[ :] *\([^:]*\):\(.*\)/title="\1";newsgroup="\2"/p
X	s/^Subj[^ :]*[ :] *\([^:]*\)$/title="\1"/p
X}
X/^From/ {
X	s/^[fF]rom[: ] *\([^ ]*\).*/sender="\1"/p
X}
X/^$/	{
X	b done
X}
X: done
X' $tempf`
X
X: 'default newsgroup to "general" if unspecified'
Xcase $newsgroup in
X'')	newsgroup=general ;;
Xesac
X
X: 'make up something if the title unspecified'
Xcase $title in
X'')	title="News from mail" ;;
Xesac
X
X: 'Submit the article to news'
Xif sed "1,/^$/d" $tempf | inews -t "$title" -n $newsgroup >$errorf 2>&1
Xthen
X	: 'OK exit, do nothing'
Xelse
X	: 'On errors, return article together with error messages to user'
X	: 'Change this line if your mailer does not have a -s flag'
X	mail -s 'Rejected News Article' $sender <<!EOF
X
XThe news article you submitted could not be accepted for the reasons:
X`cat $errorf`
X
XThe text of the article you submitted was:
X`cat $tempf`
X!EOF
X
Xfi
X
X: 'clean up'
Xrm -f $tempf $errorf
X
X
X
X
X
*-*-END-of-misc/sendnewsmail-*-*
echo x - misc/trimlib
sed 's/^X//' >misc/trimlib <<'*-*-END-of-misc/trimlib-*-*'
Xcd /usr/lib/news
Xmv log olog
Xcp /dev/null log
Xchmod 666 log history
*-*-END-of-misc/trimlib-*-*
exit