Previous | Next | Contents | Index |
Normally, for each editing operation, PMDF MAIL starts up a new editing session. This might even involve spawning a new subprocess for every operation. This overhead can be avoided by keeping an editing subprocess and attaching to it for each editing operation. When PMDF MAIL is invoked with the command
$ PMDF MAIL/EDIT=KEPT |
If no subprocess exists with the name Edit_x, or if that subprocess cannot be attached to, then PMDF MAIL will attempt to spawn a process with that name and have it execute the command specified with the MAIL$EDIT logical. Appended to this command will be the four parameters described in Section 8.9.1.2; the job logical names described below will also be defined. This behavior allows PMDF MAIL to actually create the editing subprocess itself if it does not already exist.6 For this reason, it is recommended that in your login command procedure you define MAIL$EDIT to be the name of a command procedure to invoke your editor; e.g.,
$ DEFINE MAIL$EDIT "@PMDF_ROOT:[DOC.EXAMPLES]MAILEDIT.COM" |
$ VERI = 'F$VERIFY(0)' $ ! MAILEDIT.COM - Startup TPU as this process's editor $ ! $ ! P1 = Input file name $ ! P2 = Output file name $ ! P3 = Ignored; used by PMDF MAIL $ ! P4 = Starting position $ ! $ DEFINE/NOLOG SYS$INPUT SYS$COMMAND: $ P2 = F$EDIT(P2, "COLLAPSE") $ P4 = F$EDIT(P4, "COLLAPSE") $ IF P2 .NES. "" THEN P2 = "/OUTPUT=''P2'" $ IF P4 .NES. "" THEN P4 = "/START_POSITION=''P4'" $ EDIT/TPU'P2''P4' 'P1' $ VERI = F$VERIFY (VERI) |
When the editor is attached to, it should make use of the following job logicals to determine which input file to edit and where to write its output:
Logical Name | Usage |
---|---|
PMDF_MAIL_INPUT_FILE | Input file to edit. |
PMDF_MAIL_OUTPUT_FILE | Output file to generate; to cancel mail operation, do not generate an output file. |
PMDF_MAIL_COMMAND | Interactive PMDF MAIL command which requested the editing operation. Always one of EDIT, DIRECTORY, DIRECTORY/FOLDER, FORWARD, READ, REPLY, or SEND. |
PMDF_MAIL_START_POSITION | If possible, place the edit insert point on this line of the input file. That is, initial line of the file to place the cursor at. First line is line 1. |
A "kept" editor used with PMDF MAIL should do the following:
Use the command
$ PMDF MAIL/EDIT=KEPT=process-name |
process-name
, for the editor subprocess. PMDF
MAIL will then try to attach to the subprocess with the specified name;
if no subprocess with that name exists, then a subprocess will be
created and given that name.
6 PMDF MAIL will not attempt to delete this process when exiting.7 Note that at present if PMDF_MAIL_OUTPUT_FILE specifies a file name then it is the same name as that specified by PMDF_MAIL_INPUT_FILE unless the PMDF_MAIL_COMMAND translates to EDIT in which case the user might have explicitly specified a different output file name. |
Previous | Next | Contents | Index |