-*-Text-*-  File: RMAIL Node: Top Up: (DIR) Next: DEFAULT RMAIL is a program for reading and editing mail. As you receive mail, it is put in your "mail file". When you use RMAIL, the new mail is moved into an "RMAIL file" which accumulates all your old mail. RMAIL then provides you with convenient commands for looking at, editing, and replying to that mail. * Menu: To learn all about RMAIL, type "2" and then "N"'s. If you know nothing about it, just start doing "N"'s. * Default:: Invoking RMAIL to read your own mail the usual way. * Peruse:: Using RMAIL to look at someone else's mail. * Update:: Invoking RMAIL if you don't keep your mail files in the usual places. * Options:: Once you are in RMAIL, how to do things. * Printing:: Using RMAIL on a printing terminal. * EMACS:: Using RMAIL under EMACS. * GMSGS:: Using RMAIL to read system announcements as well as personal mail. * Insides:: Details for hackers.  File: RMAIL, Node: DEFAULT, Up: Top, Previous: Top, Next: Options To invoke RMAIL in the usual way, just do :RMAIL, or MM RMAIL inside an EMACS. This will assume that you wish to edit your own mail and that you keep your mail in the expected places. If you use RMAIL, you don't have to discard your mail as soon as you see it. You can save it instead, in what is known as an "RMAIL file". Any mail that you save will automatically be found the next time you use RMAIL, after all the new mail you have received. In fact, every message is saved unless you give RMAIL a command to delete it. So if you stop editing in RMAIL without looking over all of your old saved mail, it will continue to be saved. Thus, your RMAIL file can have new mail added whenever you run RMAIL, but nothing every disappears from it except when you say so. The normal place for your RMAIL file to live is under the name RMAIL on your working directory. Once you have invoked RMAIL, you can begin reading, editing and deleting messages. RMAIL uses single-character commands known as "options". See the next node for how to use them.  File: RMAIL, Node: PERUSE, Up: Top, Next: Update, Previous: Default Perusal mode: In perusal mode, RMAIL can be used to look at (but not modify) any files of mail. It is invoked with a command of this sort: :RMAIL ,,... where the files listed are those to be examined. The default for the first filespec is DSK:; MAIL. The default for each other filespec is the previous file. If only one filename is specified, it is the first filename. "^A" may be used at the beginning of a filespec to represent the default first filename, in case it is desired to change only the second. Thus, "^ASENDS" will get the SENDS file for the user whose name is the default at that moment. All the files named are read in, concatenated together, in the order they appear in the command string, and the first message in the first newmail file is then displayed. Editing may be done in perusal mode, but RMAIL will not write the edited string into any file of its own accord. If you try to delete messages, you will get an error message, on the grounds that you probably don't realize that your changes will be lost. The feature that used to exist, where / would specify that user's mail file, has been removed temporarily due to the change in where mail files are stored. When TECO gains tha ability to ask DDT where a user's mail file is stored, this capability will exist again.  File: RMAIL, Node: UPDATE, Up: Top, Next: Options, Previous: Peruse Update mode: Update mode is RMAIL's normal mode, in which RMAIL intends to write back all the changes you make permanently on disk, into a file which is called "the RMAIL file". Your RMAIL file is a cumulative record of all the mail you have received, as you have edited it in all the times you have run RMAIL. Naturally, you shouldn't keep all the mail you receive; when a message is no longer interesting, you should tell RMAIL to delete it. If you give RMAIL no command string at all when you invoke it, as in :RMAIL, then RMAIL will operate in update mode, and it will assume the standard default values for all the filenames it needs. If you don't like the defaults, or you want to edit someone else's mail, you can specify everything explicitly. An update mode command string must specify the name of the RMAIL file. In addition, it may specify the names of newmail files, whose contents are to be read in and merged into the RMAIL file. They may also be deleted after their contents have been safely written into the RMAIL file - it depends on what you specify. The LAST thing in an update mode command string is the RMAIL file name, followed by an dollarsign. The dollarsign is what tells RMAIL that you intend to use update mode and not perusal mode. Before the RMAIL file name come the names of the newmail files if any. They are specified just as in a perusal mode comand string. The last newmail file name must be followed by a comma (or a slash), to separate it from the RMAIL file name. A newmail file whose name is ended with a slash will be deleted after its contents are merged into the RMAIL file. A newmail file whose name is ended with a comma will not be deleted. An example of an RMAIL command string specifying update mode is :RMAIL ; MAIL/; RMAIL$ which specifies (assuming that both 's are identical) that 's mail file should be appended into ; RMAIL and then deleted. RMAIL then edits the combined contents. After editing, any results are again written into ; RMAIL. If you fill your XUNAME in as and your home directory (HSNAME) in as , that is precisely what RMAIL does if given no command string. The default names for the rmail file are taken from the last newmail file, except that the default second file name is always RMAIL. Normally, newmail files are added at the front of the RMAIL file, but if the RMAIL file starts with "*APPEND*" then they are added at the end instead. People who use R-OPTION APPEND in the mailer to receive their mail in the order of oldest first should use this. In update mode, when you exit RMAIL (with the Q command), the results of your editing are written back into the RMAIL file. You can also save your editing so far at any time with the S command. The I option switches into update mode, asking the user to specify the name of the new rmail file. If RMAIL was already in update mode, the old rmail file is written out (as by S).  File: RMAIL, Node: OPTIONS, Up: Top, Next: Printing, Previous: Update RMAIL Commands ("Options"): RMAIL is normally in option mode. In that mode, several single-character commands, called options, are available, including escapes into other modes. If an unrecognized option is typed, a statement to that effect will be typed out. The user then has another chance to type an option, and is reminded that "?" types documentation. Unless it says otherwise in the description of a particular option, after any option is executed, the current message will be displayed, and a new option will be awaited. In other words, options normally do not leave option mode. Some options read input during their operation, using ^R mode. To quit out of such an option, use ^G or ^], which will abort the operation and return to option mode. The options are: N move to Next message (then display it and read an option) When looking at the last message, N does nothing but notify the user of that fact. N may be preceded by a decimal integer, which will act as a repeat count. ZN is a good way to go to the last message in the buffer. D Delete the message and move to the next. ^D Delete the message and move to the previous. U Undelete the last message deleted, putting it before the message now current which had been current, and moving back to it. Successive undeletes will undelete earlier messages (the deleted messages live in a stack). P move to the Previous message. When looking at the first message, P does nothing but notify the user of that fact. P may be preceded by a decimal integer repeat count. J Jump to message, specified by absolute number. J goes to the first message, ZJ goes to the last, and J goes to message . SPACE move to the next screenful of a long message. BACKSPACE move to the previous screenful. . move to the beginning of the current message. In addition, if more than one message is being looked at (as, after a W option), "." will select just the message that the pointer is inside. Thus, "." is the "inverse" of W, in some ways. ; execute several options with no display between them. An entire line is read in, with rubouts handled, and then all the characters in the line are executed as options with no intervening attempts to display. Then, at the end, display is done. R Reply to message. You are shown the skeleton of a message, into which you can edit the values of the fields. The text of the message should go below the line of dashes. The fields of the header should go above them. Each field takes up one line, and consists of the field name, a colon, and the field value. You can alter or delete the supplied fields as you wish, or add fields that are not present. The reply command will intially fill in the fields it thinks are apropriate. It tries to do the "right thing" on failed mail messages returned by the comsat. Currently recognized fields are: To: There can be more then one line of To: fields. Each To: field may have more than one receipient in it. A copy of the message will go to each receipient in a To: field and each one will appear in a To: line in the header of all copies of the message sent out. (Exception: only a single simple receipient and ITS format.) If the reply command is given an argument of 1 (1R), then it copies all the receipients of the message being replied to into the To: field of the reply being formed before presenting it to the user for editing. Cc: Just like To: except receipients listed under Cc: will appear under a Cc: line on each copy of the message sent out. If the reply command is given an argument of 1 then all the Cc:'s in the message being replied to will be copied. Subject: or S: A line to appear in the subject field of the message, or the "Re" heading if ITS format. If there is a subject field in the message being replied to then it will be copied. Header-Force: or H: Values should be RFC733, NET or ITS. Says which type of header the message being sent out should be formed with. Replying to a non-ITS header with 1R will automatically generate a Header-Force:RFC733. Registered: or R: Instructs the Comsat on whether to notify the sender (return a receipt) indicating success or failure of delivery. Values are N (no receipt), F (receipt on failure only), or A (always receipt). Default is to receipt unless mail was sent immediately (not queued), unless this is overridden by your NAMES database entry. C-C C-C (C-M-Altmode) (or ^C in TRMAIL) will end the editing and send the message. RMAIL will return to option mode. C-] quits out of the R option and returns to option mode without mailing anything. That is what to do if you change your mind about the reply. (Note that ^G will no longer perform this function). The C command to rmail can be used to resume the reply you quit out of. While the reply is being edited, the character C-M-Y (^Y in TRMAIL) is set up to insert the text of the message being replied to, in case it is desirable to quote part of the message in the reply. Some of the lines of the message header will be omitted and the text will be indented by four spaces unless you give C-M-Y a numeric argument. C Continue editing a reply. After aborting an R or M with C-], the C option "re-enters" the R or M where it was aborted. In between the C-] and the C anything except another R or M may be done. Note that if the current message at the time of the C is not the same as it was at the time of the R, the reply will still contain the senduer of the message R'd (unless the user had changed that himself), but C-M-Y will yank whatever message is current at the time of the C. M Mail a message. Like R, except that it presents you with a completely empty message, with only a "From" field. You must specify any recipients yourself. O Output the message to a file - good for forwarding a message to someone else's mail file; also good for filing messages according to topics. The filenames to use are read in echoing at the bottom of the screen. The default names are the names used in the last "O" option; they are typed out in parentheses. In your input, a lone filename specifies the first filename of the file to be written. End the input with a CR to tell RMAIL to proceed, appending the current message to the front of the specified file, which will be created if necessary. However, if the file starts with "*APPEND*", the new message will go at the end instead of the front. To abort the O command, type ^G. Q Quit: kill the job and return control to DDT. If an rmail file was specified, the current buffer is written out into the rmail file first. S Save: write the rmail file. Does nothing if no rmail file was specified. The RMAIL is NOT killed, so further editing may be done. I Inputs a new rmail file, and enters update mode. If RMAIL was already in update mode, the old rmail file is written out, as if the S option had been typed. Then RMAIL reads in the name of the new RMAIL file to read in, echoing it at the bottom of the screen. Terminate the name with a CR. The defaults are the names of the old RMAIL file. To abort the I command, type ^G. G Gobble new mail. Saves the RMAIL file, if in update mode. Then reads in any new mail, just as RMAIL does when it is started up (with a null command string). This is useful if you receive mail while in RMAIL and want to use RMAIL on it. ^C, ^Z just as in TECO; returns to DDT. When RMAIL is proceeded, it will redisplay the screen. ^R escape into ^R mode to edit the message. An altmode will return to option mode. X eXecute an extended command. This is the same as Meta-X in EMACS. Type the name of the extended command, an Altmode, the arguments, and a carriage return. ALTMODE escape to the TECO interpreter (actually, the EMACS Minibuffer). You may then type in one TECO command string, ended by altmode altmode. After the command string is executed you will return to option mode. While you are typing in the command string, you may edit it, since you are in ^R mode. L Show a List of all messages. This command puts on the screen text that resembles the mail file except that every message is truncated to 100 characters at most. RMAIL then invokes ^R mode, which allows the user to move the cursor to any message he desires. On exiting from ^R, RMAIL will show and point at the message which was selected in that manner. Typing ^G will abort the L command, leaving the old current message still current. W show the Whole buffer. Normally, virtual buffer boundaries are set up to restrict editing to a single message. This option flushes them. After doing a W, the option "." will go back to the single message that the pointer is in. P or N will do that and then move back or forward. A D option is unwise after a W, but one can recover from it using "$G9$$". The W option is especially useful before a ^R or altmode. F reads in a string, terminated by a CR, and searches through all the remaining messages for the string. It stops on the first message that contains the string. To find the same string as last time, give the null string as the argument (type just a CR). To abort the F option, type ^G. F starts searching from the cursor and leaves the cursor after the string it finds, so it will never find a single occurrence of the string more than once, but it may find more than one occurrence in a single message. ^L clears the screen and redisplays. ^A redisplays keeping the cursor on the top line of the screen. Useful if you're reading multi-screen message and have the screen messaed up by line noise or getting a :SEND type message. ? shows a brief description of all available options. The display will remain until a character is typed in; that character will be used as an option. RMAIL EXTENDED COMMANDS: There are some extended commands which are useful within Rmail, and are therefore loaded as part of the Rmail package. These can be executed just like any other extended command from within Rmail, by typing the X command and then the name of the extended command in the usual fashion in response to the "M-X" prompt. [*Note M-X: (Emacs)M-X.] The Rmail style arguments to the X command will show up as the arguments to M-X. Reformat Tenex Mail takes the currently selected message as a Tenex format message file and converts it to ITS format. Ie. the Tenex file probably contained a lot of messages, but they all looked like one to Rmail because they weren't separated by ^_'s. Reformating deletes the header lines that Tenex mail format inserts between messages and replaces them with ^_'s. Then one can use normal Rmail commands to select the individual messages, reaply to them etc. Undigestify Mesage Extracts the component messages from a digest message. Digest messages are usually used on large mailing lists such as HUMAN-NETS. All messages sent each day to the list are packaged into one digest which is sent all at once. This makes mailing more efficient. (*note DigFor: Format of digest.) Undigestify divides the digest message back into the messages that were packaged into it, so that Rmail treats them all as separate messages (instead of treating the whole digest as one message). The numeric argument, if nonzero, says to keep a copy of the digest in addition to the component messages. The digest copy comes after the components if the arg is negative; before, if the arg is positive. If there is no arg at all, the value of the variable Undigestify Keep Digest is used instead. If the variable also does not exist, no copy is kept.  File: RMAIL, Node: Format of digest, Up: OPTIONS For the benefit of those who want to create digests on their own, here's a partial description of the format: Date: 1 February 1983 02:00 EST From: Gail Zacharias The digest format that undigestify wants is: First word of message must be the list name. The topics section ends with a line of 70 hyphens. The individual messages are separated by a blank line followed by a line of 30 hyphens.  File: RMAIL, Node: Printing, Up: Top, Previous: Options, Next: EMACS Using RMAIL on Printing Terminals: RMAIL can be used on printing terminals, and the options generally do the same things. However, messages are (by default) not automatically printed when they are selected, as they are on displays. Instead, give the T option to print the beginning of a message, and Space to print the rest or a specified number of lines. Here are the options provided especially for printing terminals: T Type the beginning of the current message. Guaranteed to go far enough to include the subject line, or the first line of text if there is no subject. If the message is very short, it will be typed in full; otherwise, RMAIL will stop and say how many more lines there are. If the average line length is greater than the length of the terminal's line, RMAIL will put a star after the number of lines; if greater than twice the terminal width, two stars, etc. Space Type all (the rest) of the current message. Starts typing where the previous type-out command stopped. With an argument, types as many lines as specified, then says how many lines remain and --MORE-- again. B types a Brief summary of the current message (with arg, summarizes the next messages). Here is a sample: # Lines Date From Subject 1: 5 5 OCT 1976 012 [USER@SYSTEM] Ineresting discussions 2: 26 10/04/76 1121- [Pogran@Multics] Proposed RFC on ITS 3: 10 10/04/76 22:24 [RMS@AI] T: Since @ works fine on se 4: 193 10/03/76 19:26 [To: FOO@BAR, Mic] answer to your qu The number under # is the position of the message in the file; that number given to J will reselect it. The Date and Subject fields are truncated to fit the space. The "T:" in the "Subject" of message #3 shows that it is actually the first text line, shown since the message has no subject field. Message 4: was sent by the person reading the mail, so instead of his name, the recipients' names are shown (with "To:" to flag them) under "From". The header line is printed only when B is given an argument. A Advance to the next message and summarize it, a la B. If your printing terminal is relatively fast, you might want to have messages automatically printed when you move to a new one. To request that, set the TECO variable QRMAIL Auto Type nonzero by doing Altmode, then 1M.VRMAIL Auto Type. After this, every time you move to a new message, or delete or undelete a message, an automatic "T" option will be done.  File: RMAIL, Node: EMACS, Up: Top, Previous: Printing, Next: GMSGS Using RMAIL under EMACS: If you are an EMACS user, then you can run RMAIL inside of EMACS. Then, when you use the M or R option to edit a reply, or the ^R option to edit a message, you will have your EMACS environment to edit with instead of the bare TECO environment. To do this, execute M-X Read Mail in an EMACS. The command string is exactly as described in the Peruse and Update mode sections for :RMAIL. Note that for update mode you must use dollarsign, not altmode, to end the RMAIL file name. If you want to use the default files, you can do just M-X Read Mail, or, even easier, C-X R (in the default EMACS environment). Having invoked RMAIL in this way, you can get back out to EMACS with the Q option as usual. You can also get out "temporarily" with the ^X option, which does not write out the RMAIL file and does not throw away any of RMAIL's data bases. Then, you can re-enter RMAIL with a C-X R. You will be back where you were before the ^X. Inside RMAIL, a buffer named *RMAIL* is always selected. This buffer's major mode is Text Mode (unless you change it), and it is visiting the RMAIL file (that's how the RMAIL file is remembered). The I option is essentially the same as C-X C-V in EMACS. The S option is essentially C-X C-S. A few things about RMAIL work differently when RMAIL is run under EMACS. For one thing, the ^R and L options that call ^R-mode recursively must be exited with the EMACS command for doing that: Control-Altmode OR C-C C-C. The M and R reply-editing options are also different. To exit them and send the reply, use C-M-C, the standard exit command. C-C does not exit, so that you can use C-C as the Control-Meta prefix to type the C-M-C. To yank in the message you are replying to, you must use C-M-Y instead of simply C-Y - this leaves you the use of C-Y for yanking back text you have killed. Altmode is not redefined, so you can use it as a Meta-prefix. If you wish to insert an altmode, you can use C-M-Altmode or C-Q Altmode. To abort sending a message, use the C-] command (Abort Recursive Edit), which is the standard way of getting out of all recursive edits. To resume again after aborting, the C command is still good. The M option of RMAIL is available independently from EMACS as M-X Send Mail, or C-X M. With an argument, they do a C option (resume editing an aborted or sent message). The C-X M creates a special EMACS buffer named *Mail* for editing the message to be sent; this is so that you can be editing the message in Text mode regardless of the mode you were in when you gave the C-X M command. The M command inside EMACS normally just uses a TECO buffer, so that the modes are all inherited from the *RMAIL* buffer, which gives Text mode anyway. If you want the RMAIL commands R, M and C to store the message to be sent in a separate EMACS buffer, set the variable RMAIL Reply Buffer to a string containing the desired EMACS buffer name. Normally RMAIL Reply Buffer is zero or nonexistent before RMAIL is run, and RMAIL replaces this with the TECO buffer object when the first R, M or C command is executed.  File: RMAIL, Node: GMSGS, Up: Top, Previous: EMACS, Next: Insides Using the GMSGS program to read system announcements. The GMSGS program copies all system announcements that you have not yet seen into your mail file as messages. Run GMSGS in your DDT init file; then you can read the system announcements along with your mail, using RMAIL or any other mail reading mechanism. The usual way to invoke GMSGS is to do :GMSGS in DDT. All system announcements created since the time you last looked at them will be added to the front of your mail file in reverse chronological order. If you use (R-OPTION APPEND), you should say :GMSGS /R ("Reverse"), which will add the announcements to the end of your mail file in forward chronological order. If there actually are any new announcements, GMSGS prints out "(There are MSGS)". If you want to suppress this, give GMSGS the /S (for "Silent") switch. On the other hand, you can give the /N ("Notify") switch and GMSGS will also tell you whether you have any personal mail, typing "(There is mail)" if you do. GMSGS can actually mail the messages to you instead of putting them directly in your mail file. Usually the result is the same, but once in a while there is some advantage in doing it this way. Give GMSGS the /M switch to direct this to happen. If you are a real loser, you can make GMSGS print the announcements on the terminal instead of putting them in your mail file by using the /T ("Type") switch. GMSGS usually does not copy the Expires: and Distrib: fields of announcements. If you want to see them, specify the /D ("Distribution") switch. Normally, GMSGS shows you only those announcements "addressed" to the users of the machine you are on. These are the announcements whose distribution specs include *FOO, where FOO is the machine you are on. If you wish to see also announcements addressed to other machines' users, specify in the arguments to GMSGS the names of the machines you are interested in, with stars. For example, :GMSGS *AI,*MC will show you all announcements addressed to users of AI or MC. :GMSGS * is equivalent to listing all the ITS systems, including the BBOARD messages. *Note BBoard: (SYSMSG). Finally, the way to create an announcement is to :MAIL to an appropriate address, such as *AI or *MAC. RMAIL's and Babyl's options are not suitable, because the MAIL program requests additional information when the recipient you specify is an announcement sink.  File: RMAIL, Node: Insides, Up: Top, Previous: GMSGS Random Information on How RMAIL Works: RMAIL's messages all live in the buffer named RMAIL. When RMAIL is entered, it pushes the current EMACS buffer and selects (or creates) RMAIL. If the buffer is empty, RMAIL reads in the mail files, etc. Q to exit kills the contents of the buffer, so that the next invocation will read the files in again. ^X leaves the buffer untouched. The RMAIL file is remembered as the file the buffer is visiting. In peruse mode, the buffer isn't visiting any file. RMAIL keeps data in several Q-registers. QRMAIL Reply Buffer The user may put the name of an Emacs buffer in this variable before entering Rmail, and that buffer will be used for the M or R commands. This is necessary if the user wants to have special modes set for this buffer (eg. he might have a reply hook which sets fill mode, or a particular fill column). If this variable is not set, or 0, then an ordinary Teco buffer will be created, which will inheret the modes of the previous buffer (when inside Rmail, this will usually be text mode). In both cases this buffer stays around between commands and can be gotten at with the C command, or by giving a numeric argument to ^XM. QRMAIL O Filename holds the default filenames for the O option. QRMAIL F Default holds the last string specified in an "F". QRMAIL Deletions holds a buffer which holds all messages deleted with "D". Exiting from RMAIL in any way leaves the O filename and the F default untouched, so they will be remembered in the next invocation. They may be preset before the first invocation if desired. Exiting with Q clears out the RMAIL Deletions buffer so that undeletion of its contents is not possible in the next invocation. The RMAIL Reply Buffer always remains available for re-use with a C command in the same invocation or a later one. If QRMAIL Reply Hook is nonzero, then the R and M options macro it. If you would like a few special commands while editing replies, or you would like to have the normal extra commands on different characters, you should put a string in this variable to set them up. Remember to push any characters you change! If you have a nonzero reply hook, R won't even try to bind Altmode or ^C. In addition, R won't ever bind C-Y or Altmode or ^C if they don't have their bare TECO definitions. The input and output files are not clobbered by RMAIL. Some options may clobber Q-regs 0 and 1, but I hope by now those qregs are always saved and restored. The sources for RMAIL are AI:EMACS1;RMAILX > and AI:EMACS1;RMAILZ >. RMAILX contains the option-executing loop and the definitions if the options, while RMAILZ processes the command string and the input files. They are compiled together into a pure file, EMACS;[RMAI] >, which is always read via the link EMACS;RMAIL :EJ. Do MM Generate Library EMACS;[RMAI] > RMAILZ  RMAILX  in an EMACS with the PURIFY library loaded, to update the pure file after changing the sources. See the comments at the front of each file for how to call them and what they do with and to various qregs. The stand-alone RMAIL is actually an EJ file which loads in the RMAIL :EJ library and runs various macros. Changes in RMAIL usually do not require altering it. When it is necessary to redump the bootstrap, do ":TECO RMAIL;", if you have a macro package that will take that to mean "run (INIT);RMAIL .TECO." (as ALL macro packages morally should). This will write a file EMACS;TSRMAI >, which SYS1;TS RMAIL is a link to.