home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / uemlsrc / uemail.mss < prev    next >
Encoding:
Text File  |  1987-08-24  |  37.4 KB  |  617 lines

  1.  
  2.                                    Uemail
  3.  
  4. Uemail is an emacs-like full-screen editor for the Atari-ST computer
  5. equipped with a color or monochrome monitor.  It supports all of the major
  6. commands offered by microEmacs version 30, plus some extensions that make
  7. its interface closer to that used by GNU_EMACS. Although smaller than
  8. 1ST_WORD and many GEM-based programs, uemail is a large program by TOS
  9. standards.  It was ported from a two megabyte 68K system and scaled down to
  10. fit in the small memory of a 1040ST. It requires more than 128K to load.
  11. To support shell commands, it returns 256K to the operating system at
  12. startup.  On the 68K system the shell command required only 12K of code and
  13. 128K of operating space and did not require loading a command processor to
  14. get at the operating system.  But since the ST has no command control
  15. processor, you must load a shell program such as COMMAND.PRG or
  16. PCOMMAND.PRG to get at the file system.  You may run any TOS based program
  17. from within the editor, but programs that require a GEM interface will
  18. crash the system.  You will have to exit the editor entirely to run GEM
  19. programs as there is just not enough extra memory to run GEM programs.
  20.  
  21. Running uemail from within a shell program diminishes the available text
  22. buffer space.  The return TPA command (ESC-@) reports the amount of space
  23. used and the amount available.  Long source code files (900 or more lines)
  24. are the biggest memory eaters.  If uemail runs directly from the desktop,
  25. buffer space is rarely a problem even with a 360K ramdisk loaded, but
  26. running this program and trying to edit large files on a 520ST may be a
  27. problem if ramdisks or numerous desk accessories are in memory.  Files
  28. consume approximately one and one-half times their physical size.  Text
  29. files consume a little less, and because program code often has a number of
  30. blank lines for which space must be allocated, it consumes somewhat more
  31. memory in relation to its size.
  32.  
  33. The main reason for the size of the program is the added kermit utility not
  34. usually found in a text editor, and the aliasing system for loading text
  35. files and shell programs.  The disadvantage of tying these functions into
  36. the program and using up memory space is outwayed by the advantage gained
  37. by integration.  The ability to transfer text directly into and out of an
  38. editor buffer saves time and programming effort.  The integrated program
  39. also gives the programmer a relatively easy way to implement individual
  40. protocol schemes to communicate with remote systems since all of the
  41. readaux and sendaux functions are already defined.  If the kermit section
  42. and the terminal section were to be separate from the editor, then loading
  43. those free standing programs into memory would require a larger shell space
  44. as each of those programs would be linked to its own copy of the run-time
  45. library.  Finally, the additional features make the editor more of an
  46. all-purpose tool, the type of program that can be loaded and serve as a
  47. simple shell from which to carry out most tasks on the computer.
  48.  
  49. Uemail is designed to work in tandem with GNU_EMACS on a remote computer.
  50. When the program is connected to the serial line, all of the function keys
  51. and the number pad keys send the same commands as they do from within
  52. uemail, and the defined keyboard macros (macros triggered by the accent
  53. grave key) are also sent across the line. This allows you to set up special
  54. function key definition files and macro definition files to use with a
  55. remote emacs. Macro files can be loaded into memory from within an editor
  56. buffer or while online using the terminal section.
  57.  
  58. In addition to the direct connect terminal section, uemail has a connect
  59. mode which supports kermit protocol for 7-bit transfers between two
  60. computers. This ability allows the editor to work with text from a remote
  61. system and to transfer it back to that system when done.  For remotes that
  62. do not support the kermit protocol there are log and transfer commands
  63. which use the ST's flow control (settable from within the terminal mode) to
  64. transfer text without dropping characters (provided that the remote
  65. supports one of the ST's handshaking protocols).  Because the modem I have
  66. does not support RTS/CTS, I have not been able to determine if it works as
  67. well with an RTS/CTS protocol as it does with XON/XOFF.  Uemail sets the
  68. baud rate while in connect mode.  At the beginning of the connect session,
  69. the baud rate defaults to 1200 bps, but it can be reset to 300, 2400, 9600,
  70. or 19200 bps.  When uemail exits from terminal mode, it saves the terminal
  71. screen.  When it returns to terminal mode, it rewrites that screen placing
  72. the cursor at its previous position.  You cannot set parity or stop bits
  73. from within the terminal section, if anyone finds this to be a problem, let
  74. me know, and I'll figure a way to get around it.  However, you can always
  75. run a TOS-based modem program from within uemail that can set the additional
  76. parameters.  The sample alias file shows how to define an xmodem program
  77. that will run when the CTRL-C command is given `xmodem' for a program name.
  78.  
  79. Macro commands are a quick way to automate repetitive tasks, and they also
  80. may be used to send strings, such as dial commands or logon scripts, to a
  81. modem.  The limitations of the execute macro command (CTLX-E) in many
  82. microemaxen are only one macro may be defined at a time, defining a new
  83. macro kills the old one, macros cannot be saved across editing sessions,
  84. and macros cannot be loaded from a disk file.  Uemail overcomes these
  85. limitations while retaining the "flavor" of the original define and execute
  86. macro command.  Any macro defined by the define macro command (CTLX-() may
  87. be assigned to a key on the keyboard using the getmacro command (CTLX-`)
  88. which will prompt for the key to bind.  The current keyboard macro is
  89. copied into a safe place in memory, and a pointer to it is stored in a
  90. macro table (a dynamically allocated structure).  From then on typing the
  91. accent grave (`) key followed by the key that you assigned to that macro
  92. will cause the appropriate macro to execute.  Macros can then be saved to
  93. disk, using the `-CTRL-M command, for later loading, using the `-CTRL-L
  94. command.  When the editor starts up, it attempts to load the file
  95. UEMAIL.MCR default macro file from the default drive and path.  The
  96. off-line program EXTMAC reads a macro file and writes a C-code equivalent
  97. of each function to a file.  This external program, which can be run using
  98. the shell command, replaces the old C-Mac buffer scheme in previous
  99. versions and, unlike the earlier built-in function, will create C-code for
  100. any defined macro.
  101.  
  102. Macro files may also be loaded from the terminal mode using the ALT-L
  103. command.  Macros are used in the terminal mode the same way as they are in
  104. an editor buffer (by typing a ` followed by the appropriate character).
  105. Macros are of two basic types: character strings and command strings.
  106. Character strings are words that have been typed to the screen while
  107. defining a macro.  For example from within a buffer you can type the begin
  108. macro command, type "ATDT5551234<CR>," followed by the end macro command
  109. (CTLX-)), and the getmacro command (CTLX-`), binding this string to `5.
  110. Then from the terminal section you can type `5 to send the string to your
  111. modem. Command strings are macros which would normally cause uemail to
  112. execute a series of commands (such as CTRL-A CTRL-O to go to the beginning
  113. of the line and open a blank line above it).  Command strings make the most
  114. sense when uemail is serving as a terminal connection to a remote Emacs
  115. editor, allowing you to define a set of macros that behave the same way in
  116. both editors.
  117.  
  118. As of version 33 of uemail ST, the cc command is an off-line program which
  119. runs in the space uemail returns to the operating system.  The sample
  120. start-up file (cc.ini) shows how to define an alias for CC.PRG which makes
  121. the new interface transparent.  The CC.PRG will also run by itself to drive
  122. the Alcyon compiler.  It accepts wildcards or multiple files on the command
  123. line, can compiler or simply assemble a file.  (It goes directly to the
  124. assembler for any file with an `.S' file type.)  It will link a group of
  125. files if the cc.ini file has the `dolink=1' command in it.  It will compile
  126. the files first if you supply a command line.  With no command line and the
  127. dolink option on, the program will skip compilation and go directly to the
  128. linker.  It envokes the linker by passing it a command file whose first
  129. name is that defined in the cc.ini file as the `linkfile.'  If the linker
  130. is successful, the program will attempt to relmod the resulting linker
  131. output. To make all of this work properly you must define the parts of your
  132. cc.ini program correctly.  the source directory is where the compiler,
  133. assembler, and relmod expect to find their input files.  The temp directory
  134. is where the assembler places its output.  The program expects the linkfile
  135. to be on the source directory and assumes that the linkfile contains a
  136. complete link68 script.  It also assumes that the linker output file will
  137. have the same filename as the linkfile name, that the extension will be
  138. 68K, and that it will be located on the source directory.  Because the
  139. link68 program cannot handle filenames longer than 13 letters, including
  140. the path and drive, your filename plus source directory should be no more
  141. than 10 characters long.
  142.  
  143. WARNING:  it is not safe to batter the CTRL-C key while CC.PRG is running in
  144. the background as this will often send you back to the desktop (OK if you
  145. have saved your files).  Instead if you find runaway errors while compiling,
  146. type CTRL-S first and wait for the program to stop; then type one CTRL-C.
  147. Future versions of uemail will incorpaorate a buffer in which to run all
  148. shell commands.  That buffer will allow you to type a number of different
  149. halt commands to stop runaway background programs.  It will also let you
  150. keep the program output.  This will require operating system redirection and
  151. all sorts of stack manipulation, so don't expect it any time soon, but a
  152. version with this feature is currently running under CP/M-68K using the
  153. Alcyon compiler.
  154.  
  155. One added ability the command buffer will give is being able to run SID
  156. from within the editor and, with a split screen, to read the source for a
  157. file currently being debugged.  The CP/M version uses the <ESC> key to
  158. suspend the background process and return to the editing buffer.  That
  159. allows the background program to be reentered at anytime without having it
  160. reloaded.  Using SID this way to debug a file for which the symbols table
  161. has remained intact, is very close to using the fancy symbolic debuggers on
  162. other systems.  With two megs you can even load the assembly source code
  163. produced by the compiler and go line by line through SID.  But these are
  164. features not yet available for the ST version.
  165.  
  166. The aliasing feature mention above is implemented via the cc.ini file.  When
  167. uemail starts up, it attempts to read the file from the current directory
  168. and drive.  It attempts to read this file before any initialization takes
  169. palce; therefore, you can use aliases (provided the cc.ini file is on the
  170. correct drive and directory) on the startup line.  The cc.ini file (example
  171. below) may contain any aliases you wish to use.  And new files may be loaded
  172. from the disk (using CTLX CTRL-E) at any time.  The function key and number
  173. pad definitions do not cause any additional space to be allocated.  But all
  174. other aliases do use space (approximately 10 bytes plus the number of
  175. characters in the alias string and the definition per each alias).
  176.  
  177. Aliases are freed from memory and new pointers are installed everytime the
  178. alias function sees a matching alias name, it does not check to see whether
  179. the aliases value is the same as the original, but simply reallocates space
  180. and frees the old value.  This means that alias files need not contain
  181. every value that is needed.  For example you might wish to redefine the
  182. number pad or the function keys but not change the paths.  You can do this
  183. by creating an alias file listing just those keys you wish to redefine and
  184. loading that file with the CTLX-CTRL-E command.  The alias file also
  185. controls the screen color with a color monitor; however the load alias
  186. command issued from an editing buffer does not automatically update the
  187. screen.  The new colors will be installed if you issue the set global modes
  188. command and give it the word `color' as a mode name.  The colors will also
  189. be installed when you return from a terminal session or from a background
  190. (shell) operation.  The load command file command is also available from
  191. the modem section using the ALT-E key.  In that case the colors are
  192. installed immediately.  The following is a sample cc.ini file:
  193.  
  194. /* cc.ini file for cc.prg and uemail.prg
  195.  * the first ten are used by the cc or link commands. the aliases must
  196.  * be spelled as they are here and must be in lower case. change the
  197.  * path names to match your set-up.
  198.  */
  199. /* these are for the cc.prg which also reads this file */
  200. source=e:                       /* C, lnk, and 68K files        */
  201. include=d:\stdlib.h\            /* headers                      */
  202. temp=m:                         /* temporary files, o files, and final prg  */
  203. symb=c:\bin\                    /* as68symb.dat                 */
  204. bin=c:\bin\                     /* compilers, assembler, linker, and loader */
  205. syslib=c:\bin\                  /* library directory            */
  206. linkfile=xemacs                 /* filename of link command file*/
  207. float=                          /* flag for floating point -f, -e or nil*/
  208. dolink=1                        /* if 1, call linker after compiling file[s] */
  209. delete=1                        /* delete I, S, 68K files? 1==YES       */
  210. /* the next two are used by shell */
  211. shell=c:\util\pcommand.prg      /* shell program        */
  212. xmodem=c:\comm\bmodem.ttp       /* xmodem program       */
  213. extmac=c:\uemail\extmac.ttp     /* extract macros       */
  214. cc=c:\uemail\cc.prg             /* compiler driver      */
  215. /* these are not used and if not needed, may be deleted */
  216. home=c:\uemail\                 /* where it all began   */
  217. root=c:\                        /* boot directory       */
  218. assembly=d:\assembly.s\         /* assembly sources     */
  219. etc=c:\util\                    /* utility programs     */
  220. comm=c:\comm\                   /* communications       */
  221. arc=c:\util\arc.ttp             /* arc cruncher         */
  222. vt100=c:\comm\vt100.tos         /* small vt100 prog     */
  223. /* set up colors the way I like. aliases and color names must be lower
  224.  * case.  additional colors are grey, magenta, teal, green, yellow, and
  225.  * white. cobalt is a deep blue. if colors are not aliased, you get
  226.  * white on black as default.
  227.  */
  228. border=black                    /* color #0             */
  229. desk=cobalt                     /* color #2             */
  230. cursor=red                      /* color #1             */
  231. letter=black                    /* color #3             */
  232. /* function key bindings for uemail.ttp The F must be upper case */
  233. F1=setmark                      /* sets the mark        */
  234. F2=listbuffers                  /* lists current buffers        */
  235. F3=filename                     /* change current filename      */
  236. F4=writeregion                  /* write text between point and mark to file */
  237. F5=fileinsert                   /* insert file at point         */
  238. F6=fileread                     /* read file into current buffer*/
  239. F7=filevisit                    /* visit (find) a file          */
  240. F8=filewrite                    /* write out buffer to named file       */
  241. F9=filesave                     /* save current buffer if changed       */
  242. F10=quit                        /* save all changed buffers and exit    */
  243. /* Number pad bindings for uemail.ttp. the N must be upper case as must
  244.  * the word NENTER.
  245.  */
  246. N(=backword                     /* backward word        */
  247. N)=forwword                     /* forward word         */
  248. N/=grtw                         /* globally remove trailing whitespace */
  249. N*=retversion                   /* return current version to message line */
  250. N7=gotobol                      /* goto beginning of line */
  251. N8=gotoeol                      /* goto end of line     */
  252. N9=rettpa                       /* return usage to message line */
  253. N-=pageback                     /* back by one text page (60 lines default) */
  254. N4=backsent                     /* goto beginning of sentence */
  255. N5=forwsent                     /* goto end of sentence */
  256. N6=unkncom                      /* unknown              */
  257. N+=pageforw                     /* forward by one text page */
  258. N1=gotbop                       /* goto beginning of paragraph (blank line) */
  259. N2=goteop                       /* goto end of paragraph (blank line) */
  260. N3=unkncom                      /* unknown              */
  261. N.=forwdel                      /* delete character under cursor */
  262. NENTER=indent                   /* newline and indent   */
  263.  
  264. Each line must be formatted as above.  The word before the equal sign is
  265. the `alias' name used by the program, and the line to the left of the equal
  266. sign is the actual path name assigned to the aliased variable.  There can
  267. be no embedded blanks or tabs in a name or alias, but comments may appear
  268. on any line as long as there is at least one space or tab character between
  269. the end of the path and the beginning of the comment.  No special comment
  270. characters are necessary although using standard comment markers like those
  271. above help to make the comments more readable.  The order of definitions is
  272. unimportant, and lines that contain no `=' signs are ignored.
  273.  
  274. The aliasing mechanism attempts to find aliases for any command file you
  275. type at the shell command (but not for the command line arguments).  Typing
  276. `cc' after issuing the shell command (CTRL-C) and the filename at the
  277. command line prompt invokes the compiler driver CC.PRG. It will also expand
  278. `temp' to m:\ because it does not check to see is the aliased name makes
  279. sense in context.  If the aliased name would not load, you will receive an
  280. error message on the message line. You also can use the aliases the usual
  281. way in the shell command.  If the first character of the program name is a
  282. `~,' the function will attempt to expand the aliased path.  Thus
  283. `~etc\arc.ttp' is the same as `arc' and `c:\util\arc.ttp.'
  284.  
  285. The set path command and all the file commands also use the alias table. If
  286. at the command's prompt you type a line which begins with a `~', these
  287. commands look up the word after the ~ and test it against the known
  288. aliases.  If the word match matches a known alias, the string associated
  289. with that alias is copied into the filename.  Thus if "temp=c:\files\temp"
  290. is in the cc.ini file at startup, typing the read file command CTRL-X
  291. CTRL-R and asking for the file ~temp\test.i will read in the file
  292. c:\files\temp\test.i (note that the `\' character is necessary, and the `~'
  293. must be the first character on the line).
  294.  
  295. Uemail also supports writers.  In addition to the useful macro function,
  296. uemail provides sentence, paragraph, and page movement commands.  It
  297. provides two punctuation movement commands, forward to next punctation and
  298. backward to previous puntuation, useful for moving to the next comma or
  299. quotation mark in a text.  Uemail extends the usual microemacs on-screen
  300. editing features, adding an indent column with the ability to define an
  301. indent prefix.  Unlike other versions of microemacs, uemail's fill
  302. paragraph command leaves the cursor inside the paragraph in the same spot
  303. where it was when the command was issued.  There are line-based commands for
  304. formatting texts.  The flushleft, flushright, center, transpose words, and
  305. globally delete trailing whitespace all deal with text appearance.  The
  306. indent subsequent newline same as this lets you open a line underneath the
  307. present line with the same indentation without having to be at the end of
  308. the present line.  The drop line and indent command works similarly but
  309. inserts the new line above the present line.  Both of these functions are
  310. not only useful for formatting text, but also for indenting program code.
  311.  
  312. Uemail provides a rudimentary interface for a spelling checker.  If your
  313. spelling checker uses the standard spell correction mark (0x93), the
  314. program will search for that character in your file when you type the go
  315. spell command (CTLX-S), placing your cursor at the beginning of the word to
  316. correct. The program has a word count function which reports the average
  317. size of words in a buffer.  This function reports the length of your buffer
  318. in letters and characters.  It uses the letter total to determine averages.
  319. This leads to a more accurate average than methods which divide the total
  320. number of characters in a buffer by the total number of words.
  321.  
  322. Uemail can print buffers with page numbers, two header lines, and single or
  323. double spacing.  The page size is settable, and the internal code
  324. automatically sets up any Diablo/Xerox compatible printer for standard 12
  325. pitch type.  The program can print while editing (as long as there is
  326. keyboard activity), and if you try to exit while printing, uemail will ask
  327. whether you want to exit for sure.  In order for the print buffers command
  328. to work properly, be sure to define a temp directory in your cc.ini file.
  329.  
  330. Uemail allows you to set your colors at start up to any four of nine
  331. possible colors (black, white, grey, teal, red, green, yellow, magenta, and
  332. cobalt).  Each of the four parts of the screen is attached to a color.  You
  333. may use up to four color, defining them with lines in your cc.ini file (see
  334. example above).  When you read a new set of colors, you update the colors
  335. on the screen by issuing the set global modes command (META-M) and choosing
  336. color as the new mode.  If you are currently in the kermit mode, the colors
  337. are automatically updated when you load the file.  The aliasing mechanism
  338. allows you to write short color files that contain only the information
  339. needed to set up the colors you want and to load them into memory as
  340. needed.  One additonal command (CTLX-C) alllows you to switch your
  341. background to any color currently defined.  The command is intelligent
  342. enough to prevent the screen from "dissappearing" if you choose to make the
  343. background the same as the letter color (background is the `desk').  For
  344. example, if your desk is cobalt and your letters are black, issuing the
  345. command and answering black for the new color will give you a black desk
  346. with blue letters and a blue border.  A similar transposition occurs if you
  347. wish the background to be the color of the cursor.
  348.  
  349. Unlike most microEmaxen, uemail follows the GNU_EMACS convention of
  350. writing all `dirty' buffers when exitting.  If a normal exit is chosen
  351. (CTLX-CTRL-C) and no argument is given, the program asks the user whether
  352. individual modified files should be saved.  The quick exit command (CTRL-Z)
  353. saves every modified buffer without asking.  The ST is prone to BUS and
  354. address errors, uemail tries to protect the user from these by intercepting
  355. the vectors associated with these exceptions. When the code signals an
  356. error, the program gives you the opportunity to save your files before
  357. restoring the system and exiting.  This can avoid a lot of frustration.
  358.  
  359. The following list of commands is arranged according to category.  The
  360. column marked KEY shows the keystrokes bound to the command.  The column
  361. marked COMMAND gives the internal name of the command that uemail uses.
  362. And the DESCRIPTION gives a brief explanation of what the command does.  In
  363. the chart, the ^ character in front of a letter means that letter is a
  364. control character; ESC is the escape key, and ` is the accent grave.  Any
  365. ESC sequence that uses a simple alphabetic key as the second argument is
  366. reachable using the ALT key while typing the alpha key.  For example both
  367. ESC-F and ALT-F move forward one word.  The difference between the two
  368. options is that the ESC version requires typing two keys, while the ALT
  369. version requires one "shifted" keystroke.  Some of the commands below react
  370. differently depending upon whether the function is passed a numeric
  371. argument.  Numeric arguments are used most often to cause commands to
  372. repeat a set number of times.  There are two ways to signify an argument to
  373. a function.  Each method requires typing a repeat command before typing the
  374. function.  The two repeat commands are CTRL-U and the ESC key followed by
  375. any digit or by the negative sign.  CTRL-U is called the universal prefix
  376. and always defaults to four repeats.  Typing CTRL-U repeatedly multiplies
  377. the repeat count.  The count echos to the message line.  Typing ESC
  378. followed by a number does essentially the same thing but allows you to
  379. choose the number directly.  For example: ESC-2 followed by CTRL-K deletes
  380. two full lines forward, which is equivalent to deleting a line and the
  381. trailing newline.  Some commands look for zero arguments to change their
  382. normal actions.  For example: CTLX-D is the set path command; however, when
  383. it is prefaced with ESC-0 or CTRL-U-0, it returns the current default drive
  384. and path to the message line.  The showtime command is similar.  If it is
  385. called normally, without an argument, or if it is called with a zero or
  386. negative argument, it writes the current time to the message line.  If it
  387. is called with a possitive argument less than 1000 (a special case), it
  388. writes the time into the document at the current position.  The 1000 value
  389. is used by the kermit section to write to the message line.  Since the
  390. kermit section must use a different message writing scheme from that used
  391. by the editor.
  392.  
  393. Commands for Uemail
  394. ===================
  395. KEY (lower case OK)     COMMAND                 DESCRIPTION
  396. --------------------------------------------------------------------------
  397. MISCELLANEOUS UTILITIES
  398. ESC-~           clearflag();            /* Clear changed buffer flag    */
  399. ^X-~ or ^C      shell();                /* run a child process or cc    */
  400. ^Q              quote();                /* Insert literal               */
  401. ^G              ctrlg();                /* Abort out of things          */
  402. ^X-^C           quit();                 /* Quit prompt to save files    */
  403. ^Z              quickexit();            /* low keystroke exit and save  */
  404. ^X-=            showcpos();             /* Show the cursor position     */
  405. ^X-W            wc();                   /* word and line count of buffer*/
  406. ^X-*            retversion();           /* version date                 */
  407. ^X-M            setmode();              /* set a mode for a buffer      */
  408. ^X-^T           showtime();             /* tell the time or insert in buffer */
  409. ESC-M           sglmode();              /* set global mode              */
  410. ESC-X           mdoncom();              /* do named command             */
  411. ESC-@           rettpa();               /* show available memory and usage */
  412. ESC-^N          enumerate();            /* start or incr. counter variable */
  413. Lots-o-keys     unkncom();              /* unknown command BEEP         */
  414.  
  415. FILE OPERATIONS
  416. ^X-^E           commfill();             /* Read a cc.ini command file   */
  417. ^X-I            fileinsert();           /* Insert existing file at point*/
  418. ^X-^R           fileread();             /* Get a file, into existing buf*/
  419. ^X-^V           filevisit();            /* Get a file, new buffer       */
  420. ^X-^W           filewrite();            /* Write a file                 */
  421. ^X-^S           filesave();             /* Save current file            */
  422. ^X-^F           filename();             /* Change file name             */
  423. ^X-D            setpath();              /* set path if arg=0 get path   */
  424.  
  425. CURSOR MOVEMENT
  426. ^A              gotobol();              /* Move to start of line or prev*/
  427. ^E              gotoeol();              /* Move to end of line or next  */
  428. ^B              backchar();             /* Move backward by characters  */
  429. ^F              forwchar();             /* Move forward by characters   */
  430. ^P              backline();             /* Move backward by lines       */
  431. ^N              forwline();             /* Move forward by lines        */
  432. ESC-V           backpage();             /* Move backward by screens     */
  433. ^V              forwpage();             /* Move forward by screens      */
  434. ESC-B or ESC-^B backword();             /* Backup by words              */
  435. ESC-F or ESC-^F forwword();             /* Advance by words             */
  436. ESC-N           goteop();               /* goto end of paragraph        */
  437. ESC-P           gotbop();               /* goto beginning of paragraph  */
  438. ^X-<            btopunct();             /* move backward to last punctuation */
  439. ^X->            ftopunct();             /* move forward to next punctuation  */
  440. ESC-A           backsent();             /* backward to beginning of sentence */
  441. ESC-E           forwsent();             /* forward to end of sentence   */
  442. ESC-, or ESC-<  gotobob();              /* Move to start of buffer      */
  443. ESC-. or ESC->  gotoeob();              /* Move to end of buffer        */
  444. ESC-G           goline();               /* goto arg line in text        */
  445. ^@ or ESC-SP    setmark();              /* Set mark                     */
  446. ^X-^X           swapmark();             /* Swap "." and mark            */
  447.  
  448. DOCUMENT FORMATTING
  449. ^X-#            setpage();              /* set page size to arg length  */
  450. ^X-!            paginate();             /* insert '\f' every page       */
  451. ^X-+            pageforw();             /* move forward set page length */
  452. ^X-- (dash)     pageback();             /* move back set page length    */
  453. ^X-TAB          print();                /* print buffer with heading    */
  454. ^X-F            setfillcol();           /* Set fill column.             */
  455. ESC-Q           fillpar();              /* fill paragraph to fill column*/
  456. ^X-.            setindcol();            /* Set indent column or prefix  */
  457. ^T              twiddle();              /* Twiddle characters           */
  458. ESC-T           twaddle();              /* transpaose two words in place*/
  459. TAB             tab();                  /* Insert tab                   */
  460. RETURN          newline();              /* Insert CR-LF                 */
  461. ^J              indent();               /* Insert CR-LF, then indent    */
  462. ^O              openline();             /* Open up a blank line         */
  463. ^X-^O           deblank();              /* Delete blank lines           */
  464. ESC-O           mdropln();              /* drop current line and move up*/
  465. ESC-J           mindnl();               /* indent subsequent NL same as this */
  466. ESC-\           mdelind();              /* delete beginning line indentation */
  467. ESC-^R          mrflush();              /* flush right current line     */
  468. ESC-^C          mcenter();              /* center current line          */
  469. ^X-\            grtw();                 /* remove trailing white space  */
  470. ESC-^O          clowsp();               /* close up intervening white space  */
  471. ESC-^P          tglcase();              /* toggle case of letter at point    */
  472.  
  473. BUFFERS AND WINDOWS
  474. ^X-^B           listbuffers();          /* Display list of buffers      */
  475. ^X-B            usebuffer();            /* Switch a window to a buffer  */
  476. ^X-K            killbuffer();           /* Make a buffer go away.       */
  477. ESC-!           reposition();           /* Reposition window            */
  478. ^L              refresh();              /* Refresh the screen           */
  479. ^X-^N           mvdnwind();             /* Scroll window down           */
  480. ^X-^P           mvupwind();             /* Scroll window up             */
  481. ^X-N            nextwind();             /* Move to the next window      */
  482. ^X-P or ^X-O    prevwind();             /* Move to the previous window  */
  483. ^X-1            onlywind();             /* Make current window only one */
  484. ^X-2            splitwind();            /* Split current window         */
  485. ^X-Z            enlargewind();          /* Enlarge display window.      */
  486. ^X-^Z           shrinkwind();           /* Shrink window.               */
  487. ^X-C            paintbuffer();          /* change the backgound color   */
  488.  
  489. DELETION AND REGIONS
  490. ESC-H           markpar();              /* mark paragraph sets mark     */
  491. ^D              forwdel();              /* Forward delete               */
  492. DEL             backdel();              /* Backward delete              */
  493. ESC-TAB         kill();                 /* Kill line forward            */
  494. ^Y              yank();                 /* Yank back from killbuffer.   */
  495. ESC-U           upperword();            /* Upper case word.             */
  496. ESC-L           lowerword();            /* Lower case word.             */
  497. ^X-^L           upperregion();          /* Upper case region.           */
  498. ^X-^U           lowerregion();          /* Lower case region.           */
  499. ESC-C           capword();              /* Initial capitalize word.     */
  500. ESC-D           delfword();             /* Delete forward word.         */
  501. ESC-DEL         delbword();             /* Delete backward word.        */
  502. ^K              mdeleln();              /* delete entire line from beginning */
  503. ESC-^K          mdelwln();              /* delete entire line including NL   */
  504. ESC-K           killsent();             /* kill sentence forward sets mark */
  505. ^W              killregion();           /* Kill region.                 */
  506. ESC-W           copyregion();           /* Copy region to kill buffer.  */
  507. ^X-R            writereg();             /* write defined region to file */
  508.  
  509. SEARCHING
  510. ^S              forwsearch();           /* Search forward               */
  511. ^R              backsearch();           /* Search backwards             */
  512. ESC-R           replace();              /* Search and replace           */
  513. `^R or ESC-^T   backisearch();          /* Incremental search back      */
  514. `^S or ESC-^S   forwisearch();          /* Incremental search forward   */
  515. ^X-S            gospell();              /* Search for 0x93 (unix spell) */
  516.  
  517. Function Key, Cursor Pad, and Numeric pad bindings.  The keycode associated
  518. with the primary EMACS binding for each of the rebound functions is sent
  519. over the serial line.  This allows you to set up your bindings at the ST to
  520. match those you normally use with the EMACS on a remote computer.
  521.  
  522. KEY             FUNCTION
  523. ===========================
  524. F1              setmark()
  525. F2              listbuffers()
  526. F3              filename()
  527. F4              writeregion()
  528. F5              fileinsert()
  529. F6              fileread()
  530. F7              filevisit()
  531. F8              filewrite()
  532. F9              filesave()
  533. F10             quickexit()
  534. Number pad      (bound to functions except when CapsLock is on)
  535. (               backword()
  536. )               forwword()
  537. /               grtw()
  538. *               retversion()
  539. 7               gotobol()
  540. 8               gotoeol()
  541. -               pageback()
  542. 4               backsent()
  543. 5               forwsent()
  544. +               pageforw()
  545. 1               gotbop()        /* beginning of paragraph */
  546. 2               goteop()        /* end of paragraph */
  547. 0               Control-X prefix
  548.                forwdel()
  549. ENTER           indent()
  550. [All of the other number pad keys are bound to unkncom() (the unknown
  551. command function), but those can be rebound to something useful through a
  552. command file.]
  553. [The cursor pad cannot be rebound.  It would not be that difficult to add
  554. this feature to the source.]
  555. CURSORS         what they look like they should do
  556. INSERT          openline()
  557. UNDO            yank()
  558. HELP            kermit()        showhelp() in terminal mode
  559. CLR             refresh()
  560.  
  561. KERMIT (and subcommands)
  562. ^_ or HELP      kermit();               /* file transfer */
  563.  ________________
  564. | [The following subcommands are supported.  Only the first letter is
  565. |  significant.]
  566. |  send         send a file (in a uemail buffer) to remote kermit
  567. |  receive      receive a file from remote
  568. |  put          send a file in server mode
  569. |  get          recieve in server mode (uemail prompts for remote name)
  570. |  finish       finish remote kermit server mode
  571. |  bye          finish server and logoff remote
  572. |  transfer     send a uemail buffer to remote appending EOF to end
  573. |  emacs        same as above but without EOF
  574. |  log          copy remote session into a uemail buffer (`^\ turns it off)
  575. |  connect      connect to the RS232 line in terminal mode
  576. |  ^G           abort a kermit session (get, put, rec, send, fin, or bye)
  577. |               Use this if one of the kermit commands appears to "lock up"
  578.  ================
  579. |  [Terminal mode commands.]
  580. |       ALT-CTRL-B      send break
  581. |       ALT-CTRL-C      run program or shell
  582. |       ALT-B           set baud rate (prompts for value)
  583. |       ALT-C           change background color
  584. |       ALT-E           load alias file and update color
  585. |       ALT-L           load macros file
  586. |       ALT-O           turn off handshaking
  587. |       ALT-R           use RTS/CTS handshaking
  588. |       ALT-T           show time on mode line
  589. |       ALT-X           use XON/XOFF handshaking
  590. |       ALT-?           show help information
  591. |       HELP            show help information
  592. |       ALT-UNDO        exit terminal mode (return to current uemail buffer)
  593. |       ALT-any-other   sends the character (i.e. NULL)
  594.  ----------------
  595.  
  596. MACROS
  597. ======
  598. ^X-(            ctlxlp();               /* Begin macro                  */
  599. ^X-)            ctlxrp();               /* End macro                    */
  600. ^X-E            ctlxe();                /* Execute macro                */
  601.  ________________
  602. | The following commands let you bind a macro that was defined using
  603. | ^X( to any keyboard key.  That macro can be executed using the accent
  604. | grave (putmacro) command.  The macros can be saved to disk and reloaded
  605. | when needed.
  606.  ----------------
  607. ` (grave)       putmacro();             /* print line macros in text    */
  608. ^X`             getmacro();             /* bind current kbdm to key     */
  609. [The following macros are predefined and cannot be rebound.]
  610. `^G             abort
  611. `^L             load a file of previously defined macros
  612. `^M             write currently defined macros to file
  613. `^R             incremental search back
  614. `^S             incremental search forward
  615. `^T             show time on mode line
  616. ``              insert an accent grave
  617.