Sorry to repost this, but I got a fix for it, so it will work with VMS 5.1-1. also, I forgot to explain what it did last time. The procedures will do a couple of things. First, whenever you edit a mail message, a signature will be added to the end of the message when you press Ctrl-Z. This happens only when you edit mail. If you don't want it, you can simply press "Do" and type "exit". If you'd like the signature in another place, you can make a line with ".sig" and nothing else, and the signature will be located there. The signature is found in the file "Sys$Login:.signature". When you reply to a mail message, in addition to the .signature, the message that you are replying to will be quoted. Each line will be preceded by "=> " and the message "You write: " will appear at the top. If you accidently quote a message, you may use the procedure "mail unquote" (it's an EVE command) to undo the quote. The only thing it doesn't undo is the mail header. When the header is removed, it is stuck in a buffer called, originally enough, header. The header is defined simply as all lines up to and including the first blank line. You may wish to set mail to automatically extract and edit upon reply and forward, and edit on send. The way these determine if you are editing mail is through the file name. If you have a file named "mail_*_edit.tmp", it will think it is a mail file. I've never had problems, and I've used these for quite a while now. Please, send me mail if you have any problems. Again, my thanks to Alberto Gomide for adjusting these to work under VMS 5.1-1. Instructions on use follow. If you don't understand them, just send me email and I'll help you. Cheers, Darrin ------------------------ Instructions: If you use a TPU Command file: If you have an existing TPU command file (not an EVE command file) then you must merge this with your existing file. Make sure that the procedures are above any lines that come by themselves. You don't want to have the "Procedure TPU$Local_Init" and it's accompanying "EndProcedure;" to be in there. If you don't have an existing command file, simply extract this into a file, get rid of all extraneous lines, and define a logical called TPU$Command to point to the file. If you use a section file: First, extract this and delete all extraneous lines. It doesn't matter what the filename is, but we'll call it "mail.tpu" for our purposes here. Edit the file and uncomment the lines "Procedure TPU$Local_Init" and it's accompanying "EndProcedure;", you'll need them. Now, say "edit/tpu/com=mail.tpu". When in the editor, simply use the command "save extended eve", and give it the name of your section file at the prompt. You're now ready. ----------------------- ---------Cut here for procedures----------------------------- !There are a few changes. First, it now adds the line "You write:" at the top !of the message. Also, if you don't want the signature at the bottom, you can !use the ".sig" directive. Just put it at the the beginning of a line, and the !signature will be inserted there. If you don't want the signature, go to the !command line and type exit. There is also a new procedure mail unquote. It !will undo what the quote does, except for restoration of the header. !This will allow me to quote people in mail. The EVE command 'mailquote' will !accomplish this task Procedure Eve_Mail_Quote Local Here; On_Error Position(Here); Delete(Here); Return EndOn_Error; Position(Beginning_Of(current_buffer)); Here:=mark(free_cursor); If (Here=End_Of(current_buffer)) Then Return EndIf; Message('Quoting included message text...'); Copy_Text(" You write: "); Split_Line; Loop Copy_Text('=> '); Position(Line_Begin); Move_Vertical(1); ExitIf (mark(free_cursor)=End_Of(current_buffer)); EndLoop; Split_Line; Split_Line; Move_Vertical(-1); !uncomment the next line and you will be left in a position to begin typing in !in your message. As it is, you can edit their text easily. ! Position(Here); Delete(Here); EndProcedure; !This will unquote accidently quoted text Procedure Eve_Mail_UnQuote Local Here, scrat; On_Error Position(Here); Delete(Here); Return EndOn_Error; Position(Beginning_Of(current_buffer)); Here:=mark(free_cursor); If (Here=End_Of(current_buffer)) Then Return; EndIf; Message('Unquoting included message text...'); Erase_Line; Loop Position(Line_Begin); Erase_Character(3); Move_Vertical(1); ExitIf (mark(free_cursor)=End_Of(current_buffer)); EndLoop; Move_Vertical(-2); ! if (edit(current_line,trim,not_in_place)="") then Erase_Line; endif; ! if (edit(current_line,trim,not_in_place)="") then Erase_Line; endif; scrat:=current_line; edit(scrat,trim); if (scrat ="") then Erase_Line; endif; scrat:=current_line; edit(scrat,trim); if (scrat ="") then Erase_Line; endif; Position(Here); Delete(Here); EndProcedure; !This will remove the header from the received message. !It will delete lines until it finds a blank line. Procedure mdc$Remove_Header Local Here,theline,therange,select1,scrat; On_Error Position(Here); Delete(Here); therange:=0; message('Error deleting Mail Header'); Return(False); EndOn_Error; set(line_number,on); Here:=mark(free_cursor); Position(Beginning_Of(current_buffer)); if (mark(free_cursor)=end_of(current_buffer)) then return endif; therange:=select(none); Loop ! ExitIf(Edit(current_line,Trim,In_Place)=""); scrat:=current_line; edit(scrat,trim); ExitIf(scrat =""); move_vertical(1); EndLoop; move_vertical(1); select1:=select_range; position(header_buffer); move_text(select1); Position(Here); Delete(Here); therange:=0; EndProcedure; !This will be used if the .sig file needs to be appended to the message upon !exit. This is for use with Mail messages. Procedure mdc$exit Local thesig,thebuffer; On_Error Message(message_text(error)); Return(False); EndOn_Error; !Use the correct buffer... thebuffer:=mainbuffer; ! show(thebuffer); !First, look to see if they put in the ".sig" directive. It must be by itself, !at the beginning of a line. thesig:=Search_Quietly(line_begin&".sig",Reverse,No_Exact,thebuffer); if (thesig<>0) then !if they included the .sig directive, go there, and erase the line Position(thesig); Erase_Line; else !Go to the bottom of the buffer, the correct buffer Position(End_Of(thebuffer)); endif; !Tell them about it, then read the signature file in Message("Appending .signature file to message..."); Read_File("Sys$Scratch:.Signature."); !Update the display so they can see the .signature file in there... Update(current_window); !Lastly, call EVE's exit procedure eve_exit; EndProcedure; !uncomment the next line if you are using a section file !Procedure TPU$Local_Init mainbuffer:=current_buffer; !First, get the name and extension... if (File_Parse(get_info(Command_Line,"Output_File"),'','',Name)<>'') Then file_name:=File_Parse(get_info(Command_Line,"Output_File"),"","",Name); file_ext:=File_Parse(get_info(Command_Line,"Output_File"),"","",Type); Else file_name:=File_Parse(get_info(Command_Line,"File_Name"),"","",Name); file_ext:=File_Parse(get_info(Command_Line,"File_Name"),"","",Type); EndIf; !Now, find out if this is actually a mail message... !See if it is "Mail_*_Edit.Txt" If ((index(file_name,"MAIL_")<>0) and ((index(file_name,"_SEND")<>0) or (index(file_name,"_EDIT")<>0)) and (index(file_ext,".TMP")<>0)) then IsItMail:=1; header_buffer:=create_buffer("HEADER"); set(no_write,header_buffer,on); mdc$remove_header; EVE_Mail_Quote; Define_Key("mdc$exit",ctrl_z_key,"Exit"); Else IsItMail:=0; ! Undefine_Key(ctrl_z_key); Define_Key("eve_exit",ctrl_z_key,"Exit"); EndIf; !uncomment the next line if you are using a section file... !EndProcedure; ----end of procedures---------------------------------------- Write if you have questions or comments- Darrin mdchaney@iubacs mdchaney@bronze.ucs.indiana.edu mdchaney@rose.ucs.indiana.edu /* ---------- */