EMACS.VMS -- Emacs-VAX/VMS Setup for Z88 Remote Terminal -------------------------------------------------------- This note describes how to set up the Emacs screen editor on a DEC VAX computer operating under VMS so that you can use Emacs with the Z88 when it is connected to the VAX as a remote terminal. Background information on Emacs and the installation of Emacs on a Unix system is contained in the file EMACS.INF, also in Area 2. If you have not already done, so I recommend you read that file first. Note that to use Emacs as described here (and in EMACS.INF) you must be using the built-in VT52 terminal emulation capability of the Z88, either by calling TERMINAL directly from the INDEX, using []V, or the GO TO TERMINAL option in Phil's excellent Z88COM program. If you are using the Z88TERM or COMM88 software from Wordmongers, this information on Emacs will be of no value to you. To the best of my knowledge, those two programs bypass the built-in VT52 terminal emulation and provide some undefined emulation, perhaps nothing more than a "glass teletype". (Actually, LCD teletype in this case.) The process of configuring Emacs on a VMS system is somewhat different than on a Unix system. Part of this is due to the inherent command and file structure differences between Unix and VMS, and part is due to the fact that Emacs was written for Unix systems, and then adapted to VMS. Therefore, you have to do some "Unix-like" things on VMS to configure Emacs for the Z88 (or any other non-DEC terminal). However, the basic steps remain the same: 1) Find the system copy of termcap and copy it to your own directory. 2) Modify a copy of the VT52 entry in termcap for the Z88. 3) Tell the system to use your personal copy of termcap instead of the system copy. 4) Tell the system you are using a Z88 before invoking Emacs. Steps 1-3 are done only once. Step 4 must be done once each login session when you want to use the Z88. (Unless, of course, you are never going to use any terminal other than the Z88 with Emacs. In that case step 4 can be made automatic.) Before starting, three more comments about Emacs and VMS. First, I don't believe the information that follows is different for the different versions of VMS, but just in case, my VAX is running Version 4.7 of VMS. Second, VMS is case insensitive, while Unix is case sensitive. That means the VMS commands can be typed in either upper or lower case, and the operating system converts them to uppercase before processing them. This effects the configuration of Emacs since Emacs _is_ case sensitive, even when operating on VMS. I will type VMS commands in UPPERCASE to distinguish them from normal text. You can use either lower or upper case, except in the one instance I will identify. Third, there are different versions of Emacs running on VMS systems, and they use at least two different forms to define their own variables. You will find out which form you need to use as part of Step 1. Step 1. Find the system copy of termcap and copy it to our own directory. Go to the VMS command level and type SHOW LOGICAL *TERM* The response will be either EMACSVAR_TERMCAP = or EMACS_TERMCAP = . [Remember whether your system uses EMACSVAR or EMACS, you will need this for Step 3.] The should end in termcap.dat. On my system the response is: EMACSVAR_TERMCAP = EMACS_DIR:TERMCAP.DAT Now copy termcap.dat to one of your own sub-directories. I put my copy in my BIN directory, so I typed: COPY EMACS_DIR:TERMCAP.DAT [ROBERTS.BIN]*.* Remember to replace the name of the destination directory with the name of one of your own directories. Step 2. Modify a copy of the VT52 entry in termcap for the Z88. This step is identical on both VMS and Unix systems, except the VMS file is called TERMCAP.DAT while the Unix file is called termcap. Using your favorite VAX text editor and normal terminal, find the vt52 profile in your personal copy of TERMCAP.DAT, make a copy of it, in the duplicate of the vt52 profile change the li#24 entry to li#8, and change the name of the modified profile from vt52 to z88. My z88 profile is shown below (the "name" of the profile is the second entry in the profile): z8|z88|Z88 Portable Computer, like dec vt52, but with 8-line screen:\ :cr=^M:do=^J:nl=^J:bl=^G:\ :le=^H:bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#8:nd=\EC:\ :ta=^I:pt:sr=\EI:up=\EA:ku=\EA:kd=\EB:kr=\EC:kl=\ED:kb=^H: Notice that I have named the profile z88, instead of Z88. This is consistent with the convention used in termcap files, but does create a small amount of extra work later on. (I guess this shows how conservative I really am.) Step 3. Tell the system to use your personal copy of termcap instead of the system copy. You will use the VMS "DEFINE" statement to tell Emacs to use your TERMCAP.DAT file instead of the system copy. To do this, you need the results of your experiment in Step 1. Type either DEFINE EMACSVAR_TERMCAP [ROBERTS.BIN]TERMCAP.DAT or DEFINE EMACS_TERMCAP [ROBERTS.BIN]TERMCAP.DAT depending upon whether EMACSVAR_TERMCAP or EMACS_TERMCAP was returned by the SHOW LOGICAL operation in Step 1. Also, remember to use the name of your own directory instead of mine as shown in the example! I recommend strongly that this statement be put in your LOGIN.COM file, so it is executed automatically each time you login. In that case, remember that the first character on the line in LOGIN.COM must be a "$" $ DEFINE .............. Step 4. Tell the system you are using a Z88 before invoking Emacs. The VMS "SET TERMINAL" command will only accept terminal types that DEC understands, or the type "unknown". If you want to use any other type of terminal with Emacs, you therefore have to set a special Emacs variable, which is either EMACSVAR_TERM or EMACS_TERM, depending upon the results of the SHOW LOGICAL operation in Step 1. The format is: DEFINE EMACSVAR_TERM "z88" or DEFINE EMACS_TERM "z88" The " " is needed to keep VMS from translating the z88 to Z88. If this happens, Emacs will tell you it cannot find the profile for a Z88, because you named the profile in lower case. If you are not bound by tradition, and name your profile Z88 in your personal copy of TERMCAP.DAT, then you do not need the " ". If EMACS_TERM (or EMACSVAR_TERM) is left undefined, Emacs reads the terminal type from the VMS SHOW/SET TERMINAL data. Since you are probably using other terminals with your VAX, the Z88 "DEFINE" should not be in your LOGIN.COM file, but should be invoked only when you want to use the Z88. The way I have chosen to do this is to create a short command file I called Z88.COM and placed in my BIN directory. Z88.COM contains only three lines: $ SET TERMINAL/DEVICE_TYPE=VT52 $ SET TERMINAL/PAGE=8 $ DEFINE EMACSVAR_TERM "z88" The first two lines tell VMS that I have a terminal just like a VT52 except it has 8 lines. This makes VMS things like MAIL work correctly (but not, alas, VMS editors like EDT.) The third line, tells Emacs to use the z88 profile. And, finally, I put the following line into my LOGIN.COM file: $ z88 :== @[ROBERTS.BIN]Z88.COM Therefore, when I login using the Z88, I just type "z88", and the VAX is automatically setup for the Z88. There is one bit of odd behavior with Emacs on the VAX I do not yet understand. When I type a , Emacs echos the but "saves" the until I type the next character. Then both the and the character I typed are echoed. This is very strange, and does not happen on the Unix-based SUN. I have confirmed that the profiles in the Unix termcap file and the VMS TERMCAP.DAT file are identical, and have confirmed that the problem is in the basic VT52 emulation, not the Z88. I have done this using a VT100 clone in my office (a real terminal, not a PC running an emulator). When I put the terminal in the VT52 mode and run Emacs in the VT52 mode on VMS I get the same problem. As with the Z88, the problem is not there using the VT100/VT52 terminal on the SUN system while running Emacs in the VT52 mode. This is not a serious problem, since the is echoed eventually (better late than never), but very curious. If I ever figure out what is wrong I will post a note. I am sorry this is so long. I hope it is useful to someone. Let me know if you find any errors. Vic Roberts June 10, 1989