From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 11-AUG-1993 12:51:49.08
To:	EVERHART
CC:	
Subj:	Handy VMS-mail doo-dads (using EVE).

From: francois@italia.boeing.com (Francois VanSteertegem)
X-Newsgroups: comp.os.vms
Subject: Handy VMS-mail doo-dads (using EVE).
Message-ID: <103044@bcsaic.boeing.com>
Date: 10 Aug 93 14:53:27 GMT
Sender: francois@bcsaic.boeing.com
Distribution: na
Organization: Boeing Computer Services, Seattle
Lines: 122
To: Info-VAX@KL.SRI.COM
X-Gateway-Source-Info: USENET


   I've often heard VMS-mail users ask "How do you get those ">" thingies
at the beginning of every line when you reply to a message?"  Another common
question is "How can I get automatic-signature-block-appending?"

   I've put together a few lines of code to implement these functions and
included them (and instructions for using them) in this posting.

   Here we go...

   1) Place this line in your login.com:
	$ MAIL=="MAIL/EDIT=(SEND,REPLY=EXTRACT,FORWARD)"
      This will cause VMS-mail to invoke the default editor whenever you send,
      forward or reply to a message.  It will also cause the replied-to message
      to be included in your reply.

   2) Set your default mail-editor to EVE.  Get into mail, and at the MAIL>
      prompt enter the command:
         SET EDIT TPU
      Now--when you send a message--you'll use the EVE editor to compose it.
      If you're an EDT fan (like me) don't worry; EVE can be made to act
      very much like EDT.

   3) Create the file SYS$LOGIN:EVE$INIT.EVE and fill it with the code I've
      appended to the end of this posting.

   4) Create the file SYS$LOGIN:TPU$COMMAND.TPU and fill it with the code I've
      appended to the end of this posting.

   And that's it.  Now, when you go to send a mail message F11 will put a ">"
at the beginning of each line in the message, and F12 will cause the contents
of SYS$LOGIN:SIGNATURE.TXT to be appended to the end of the message.

   I haven't done extensive testing on this, but I'm pretty sure it'll run
on any vanilla VMS system (v5.4-2 or later) Feel free to modify the code or 
send me critisms.

				Good Luck!

				Francois VanSteertegem
				206-965-1384 (voice)
				206-237-0052 (fax)
				francois@boeing.com
					or
				francois@bmt.ca.boeing.com


!/\/\/\/\/\/\ This is the code for SYS$LOGIN:EVE$INIT.EVE \/\/\//\/\/\/\/\/\/\
!   This is the file sys$login:eve$init.eve  The TPU commands in this file
! get executed each time you start EVE. (Unless you have the logical EVE$INIT
! define to point at some othe initialization file.)

!  These lines make EVE look a lot like EDT.  They are optional
set key edt
set curs bound
set nowrap
!
! define keys to execute user-defined-TPU-procedures
!
!The "stick a > in front of every line" procedure
define key=f11 tpu user_mark_text
!
define key=f12 tpu user_append_signature
!/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/


!/\/\/\/\/\/ This is the code for SYS$LOGIN:TPU$COMMAND.TPU /\/\/\/\/\/\/\/\/\
!   This is the file sys$login:tpu$command.tpu  The procedures in this file
! are made available to your EVE editing session.  (Unless you've defined
! the logical tpu$command to point to something else.)  To execute these
! procedures enter the command TPU XXXX (where XXXX is the procedure-name)
! at the EVE "Command:" prompt.
!
!


PROCEDURE user_mark_text
!
! This procedure will stick a ">" in front of every line in the current buffer.
! It leaves the cursor in its original position.

   !Local variables...
   LOCAL
      starting_location,
      numlines,
      i;

   !Make note of the current cursor position.
   starting_location:=MARK (NONE);

   !How many lines are in the buffer?
   numlines:=GET_INFO (CURRENT_BUFFER,"record_count");

   !For every line in the buffer, go to the beginning of that line and
   !insert a ">".
   i:=0; 
   LOOP
      EXITIF i>=numlines;
      i:=i+1;
      POSITION (i);
      POSITION (LINE_BEGIN);
      COPY_TEXT (">");
   ENDLOOP;

   !Put the cursor back where we found it.
   POSITION (starting_location);

ENDPROCEDURE;


PROCEDURE user_append_signature
! This procedure appends the contents of sys$login:signature.txt to
! the end of the current buffer.

   !Go to the end of the buffer.
   POSITION (BUFFER_END);

   !And include the file.
   READ_FILE ("sys$login:signature.txt");

ENDPROCEDURE;
!/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

