From:	CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 23-MAR-1989 04:56
To:	MRGATE::"ARISIA::EVERHART"
Subj:	MAIL$EDIT, TPU, '>' insertion and signature


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Thu, 23 MAR 89 01:31:33 PDT
Received: from CUNYVM.CUNY.EDU by KL.SRI.COM with TCP; Thu, 23 Mar 89 01:23:27 PST
Received: from ITOPOLI2.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.1) with BSMTP id 5923; Thu, 23 Mar 89 04:15:04 EST
Date: Thu, 23 Mar 89 10:15 GMT+1
From: "P.L. Montessoro * CENS-CNR * +39-11-556.7013" <PIERLUCA%ITOPOLI2.BITNET@CUNYVM.CUNY.EDU>
Subject: MAIL$EDIT, TPU, '>' insertion and signature
To: INFO-VAX@KL.SRI.COM
X-VMS-To: @INFOVAX



Hello to everybody,

it  seems  that  there is some interest in having a powerful editor callable
from  MAIL,  with  some  additional  special  features.  The  following  two
procedures  (DCL and TPU) allow the use of a customized TPU editor from MAIL
environment. The content of  a  signature  file  will  be  appended  to  the
message,  and,  if  editing a previously existing message (it is the case of
forwarded messages),  a "> " string will be inserted  at  the  beginning  of
each line.

This implementation (that can be easily modified) handles:

-  a TPU section file (SYS$LIBRARY:EXTEDTTPU.TPU$SECTION), installed for all
   the users,

-  a  TPU  command file for each user (SYS$LOGIN:EVEINI.TPU) that customizes
   the editing session,

-  a signature file for each user (SYS$LOGIN:MAIL.SIG).


It  is necessary the definition of the symbol MAIL$EDIT to point to the  DCL
command file, e.g.,

$ define MAIL$EDIT "sys$util:[mailedit]maileve.com"


I tested it under VMS 4.7 and 5.0. It seems to work very well.

Pier Luca.




*** File MAILEVE.COM ***

$ assign/user sys$command sys$input
$ edit/tpu/section=SYS$LIBRARY:EXTEDTTPU.TPU$SECTION -
  /command=sys$util:[mailedit]mailini.tpu/output='p2 'p1
$ exit '$status

*** End of file MAILEVE.COM ***




*** File MAILINI.TPU ***

! insert '> ' at the beginning of each line

position (beginning_of (current_buffer));
loop;
   exitif (mark (none) = end_of (current_buffer));
   copy_text ("> ");
   move_horizontal (-2);
   move_vertical (1);
endloop;

! read and execute the customization file

mail$initbuffer := create_buffer ("mail$initbuffer", "SYS$LOGIN:EVEINI.TPU");
execute (compile (mail$initbuffer));
delete (mail$initbuffer);

! append the signature file

position (end_of (current_buffer));
read_file ("SYS$LOGIN:MAIL.SIG");
position (beginning_of (current_buffer));

*** End of file MAILINI.TPU ***




Pier Luca MONTESSORO
Dipartimento di Automatica e Informatica
Politecnico di Torino
Corso Duca degli Abruzzi 24
10129 Torino
ITALY

Tel.   011-556.7013 (Int. + 39-11-556.7013)
Fax.   011-556.7099 (Int. + 39-11-556.7099)
Telex. 220646 POLITO I

Bitnet:       pierluca@itopoli.bitnet
Span/Physnet: 39494::PIERLUCA



