File:  [Research Unix] / researchv9 / cmd / emacs / macros / mail
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

�runs the mail processing subsystem [MACRO]

B			save the name of the current buffer
<mail
			goto mail buffer
|�		check if should be special file
	�1~0<
		<Mail file to use? 
	�		else read new mail
	� 0<Retrieving Mail
		0		indicate that execution is in progress
		<$MAIL
		-���empty mail file
		<$HOME/mbox
��
F-	get (or create) the mailbox file
��		mark the end of the old mail
-		append new mail and save
			go to the top of the new mail
<lnumb
2�0
	turn off lnumb mode (save old value)
110	go to one window mode
			loop until 1 is returned
^�8~!�-<mail? 
	�			exit mail
					save mail file
		B%	display old buffer and kill this one
		<lnumb
		2
		restore old lnumb mode
		�			return 1 to exit loop
	�?			help display
		B<Mail
		<~EMACS/macros/mail_help
		0-<Continue? 
		B%	kill Mail buffer
		100�	redisplay and return 0
	�!s		shell escape
		100�
	�		refresh screen
		100�
	�<��Next
		100�	first message
	�>��Last
		100�	last message
	�n�Next
		100�	next message
	�p�Last
		100�	previous message
	��skip_down
		00�		next page
	� �skip_down
		00�		next page
	��skip_up
		00�		previous page
	�l			look for next From in newsletters
		<^From
		��		move next From to top of screen
		00�
	�d�Mark
				delete message
		%			swap it and the buffer name
		100�	redisplay and return 0
	�u%-		undelete message
		�Last
		100�	redisplay and return 0
	�f			forward message
		�Put
		<${MAILER:-mail} 
		+<Forward to? 
		�
		B%	display mail buffer & kill temp buffer
		100�	redisplay and return 0
	�w			write message to file
		�Put
		<Write mail to File? 
		
		B%	display mail buffer & kill temp buffer
		0�		replace cursor and return 0
	�eB		edit mail buffer
		�Last
					restore mail buffer if other buffer displayed
		100�	redisplay and return 0
	�s			send message
		<Mail
		2To: 
		Subject: 		insert message header
		�reply_send
		100�	redisplay and return 0
	�r			reply to message
		�Mark
		�		push original message
		<Mail
		2�		switch to Mail buffer and get message
		^�~�>	While next line is '>'
			|��~�*	If not Forwarding line
				���+<!
				+��		This line processed
			�	Move on
		�		get to start of sender string
		^�2~� 	while less than a blank
			�+	append word to string
			�<
					then get subject
		|� ��<^[Ss]ubj.*:
			��	if line starts with some subject line
			��	get line after :
			� 
			|� ��<^[rR]e:
				��
			��	If a subject get line after :
			� < 
			��		put in a space if no subject
		��
		���-	throw away message
		To: %-	address reply buffer
		Subject:-
		�reply_send
		-			pop the original message
		100�	redisplay and return 0
	�N			unix news
		<news
		�News
		00�
	�U			Usenet news
		<if nchk;then netnews -p;fi
		�News
		00�
	�P			print message
		�Put
		<8by11
		�
		B%	display mail buffer & kill temp buffer
		100�	redisplay and return 0
	�A			append message to BLFP add file and delete
		�Put
		<add
				append message to file
		B%	display mail buffer & kill temp buffer
		%			delete message so it can be undeleted
		100�	redisplay and return 0
	�C			append message to BLFP con file and delete
		�Put
		<con
				append message to file
		B%	display mail buffer & kill temp buffer
		%			delete message so it can be undeleted
		100�	redisplay and return 0
��
Next
	go to the next mail header
<^From 
|�	search for next From
	���
	� ���
Last
	back up to the last mail header
<^From 
|�	Search backwords for a From
	�-2��
	� ���
Mark
	mark this message for deletion or putting on the kill stack
�Last
��Next

Put
	put this message in the Mail buffer
�Mark
B�<Mail
-�
reply_send
	common code for sending and replying to a message

Cc: 

�			put cursor at end of first line
<fill
�
		set fill mode (save old value)
<usilent
3�0
	turn off usilent mode (save old value)
<$HOME/.mail_reply
		add a file name to keep autosave mode happy
|�	�<Mail
	�Sign
			if successfull edit, then sign, save the message,
	��		and mail
�
			else save the partial message
<usilent
3
		restore old usilent mode value
<fill

		restore old fill mode value
B		return to other buffer & kill reply buffer
1			restore one window mode
<mail
			display mail buffer in case other file was displayed

News
0<Retrieving News
0		indicate that execution is in progress
<usilent
3�
		turn on usilent mode (save old value)
�B<.exec
<(.*).*:..:
0>^��	while we find a search string
	�From -0>�
-����	put the news on the kill stack
�			mark .exec as up-to-date
%�-1 go to beginning and set at top of page
<usilent
3
		restore old usilent mode
			clear message line
0< 

Sign

|�Look for what kind of mail
	��<@
	���<$HOME/.sig_arpa
	�	Arpanet mail
	��<!
	���<$HOME/.sig_btl
	�	btl mail
	� 	Default, local mail
	<$HOME/.sig_local
	��
���	Read in signature (If any)
|�� �	If this worked, do nothing
	� <$HOME/.signature
	�	Read in default signature
��
skip_down go to next page with cursor at top
^��~	while not at end of file after moving
�~�=�1�and not off the screen
�			then put this line at the top of a page

skip_up go to previous page with cursor at top
�0	get previous page on screen
�=	and go up the number of the line on the screen


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.