home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / EMACS / BIN / METERM.DOC < prev    next >
Text File  |  2000-06-30  |  3KB  |  67 lines

  1. Terminal customization for z80emacs is accomplished by using the 
  2. program METERM.COM
  3.  
  4. In order to keep the program as small as possible, thus allowing 
  5. you to edit as much data as possible, I assumed that there are only 
  6. two kinds of terminals in the world: ANSI and ASCII.
  7.  
  8. I also restricted z80emacs to using just three different terminal 
  9. control sequences: direct cursor motion, clear-to-end-of-line, and
  10. clear-whole-screen.
  11.  
  12. In order to keep the program as small as possible, I didn't use a 
  13. fancy termcap package ( though, if I had one, I could have 
  14. initialized it in an overlay, so my feeble excuse doesn't hold
  15. much water ). Another consideration is that, once z80emacs is 
  16. installed, it will "always" be used with one and only one 
  17. terminal type, and reading a termcap file would take time
  18. ( a slightly better argument; METERM.COM is like an overlay 
  19. that only executes once ).
  20.  
  21. That's what meterm is about: it reads ME.SYM and ME.COM, 
  22. reports what it finds, gets input from the user, and writes new 
  23. data to ME.COM; meterm is very careful to check that ME.COM 
  24. matches ME.SYM, by the way, so nothing cango rwong.
  25.  
  26. Just in case, meterm tells you where the ansimove() routine is 
  27. found, so that you can patch it if you need to; in case you need 
  28. to do so, the binary distribution includes TELANSI.C, TELANSI.ASM,
  29. TELANSI.O, and my apologies...
  30.  
  31. Most people shouldn't need to patch.
  32.  
  33. If your terminal is like a PC or like a VT100, it's ANSI; otherwise, 
  34. it's almost sure to be ASCII.
  35.  
  36. The sequences for clear-to-end-of-line and clear-whole-screen are 
  37. simply sent out as they appear in the termctrl[] table.
  38.  
  39. The problem is direct-cursor-motion; that's why there's a variable 
  40. called "ansiterm", that tells the ansimove() subroutine whether 
  41. it's dealing with an ANSI or ASCII terminal.
  42.  
  43. If ASCII, the cursor-motion sequence is probably 4 bytes long, 
  44. escape, '=', space, space; the first two characters are sent 
  45. out as is, the third character is added to the binary line 
  46. number and sent out, the fourth character is added to the 
  47. binary column number and sent out. This works as is for televideo, 
  48. wyse, qume, ADM, etc., etc; for a few others, you may have to modify 
  49. the second character.
  50.  
  51.     If the sequence isn't 4 bytes long, if the column number needs 
  52.     to be sent first, you'll have to patch.
  53.  
  54. If ANSI, the cursor-motion sequence as stored by z80emacs is 4 
  55. bytes long: "1b 5b 3b 48". The first two are sent out as is,
  56. then the line number is sent out in decimal, then the third is 
  57. sent out, then the column number in decimal, then the fourth.
  58.  
  59. In both cases, you can specify the sequence as being longer than 
  60. 4 bytes in order to send out "padding" bytes.
  61.  
  62. You may think this is a monumental kludge, but I think it's an
  63. elegant simplification. Nyahh, nyaah, so there!
  64.  
  65. ----Ralph Betza, October 1, 1991
  66.  
  67.