home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff131.lzh / Mg1b / README < prev    next >
Text File  |  1988-03-14  |  3KB  |  74 lines

  1. This is a version of mg with an ARexx port.  Actually, there have been
  2. three major changes:
  3.  
  4.     * Macros can now be bound to keys, and multiple macros can exist.
  5.     * The startup file format has changed, to allow the above to be
  6.         done during startup.
  7.     * An ARexx port has been added.
  8.  
  9. All of these changes are interdependent.  I haven't added them to the
  10. source in a very clean way; there are no new #define's to turn the
  11. ARexx port on or off.  In addition, there are some things missing.
  12. Nonetheless, because of the demand I have seen for this, I am releasing
  13. it until I finish similar modifications to mg2a (which probably won't
  14. be for some time.)  Also, the stuff may not compile with Lattice any
  15. more.
  16.  
  17. To bind macros to keys, simply define your macro like you normally do,
  18. using ^X( and ^X) to bracket a set of commands and keystrokes.  Then,
  19. do a $x 'global-set-key-macro' key, where key is the key you wish to
  20. define.
  21.  
  22. The new startup file looks something like this (my personal example):
  23.  
  24. $x 'global-set-key' ^h 'backward-delete-char'
  25. $x 'global-set-key' \127 'delete-char'
  26. $x 'global-set-key' ^C 'save-buffers-kill-emacs'
  27. ^X( ^X^S $x 'rexx' 'TeXify' ^X)
  28. $x 'global-set-key-macro' \f1
  29. ^X( $x 'rexx' 'ToError' ^X)
  30. $x 'global-set-key-macro' \f2
  31.  
  32. As you can see, now you can put in any type of key you want.  $ means
  33. escape.  Single quotes enclose strings that are terminated with carriage
  34. returns, as in $x names and the like.  Control characters are preceded
  35. by a carat.  A backslash followed by a number in decimal means the key
  36. with that ASCII code; a backslash followed by f and a number means that
  37. function key; a backslash followed by almost any other character means
  38. that character.  As you can see, I define and bind to function keys two
  39. macros.  It was this capability that I needed to add and the main reason
  40. for my rewrite of the startup file stuff.
  41.  
  42. For documentation on the ARexx port, see the file Source/readme.tgr.
  43. Just as example, though, here is a REXX macro corresponding to the
  44. `ToError' above, which puts me at the location of an error in AmigaTeX:
  45.  
  46. /*  Now we try to determine the error location */
  47. options failat 5
  48. address 'AmigaTeX' 'ErrorLoc'
  49. errorloc = getclip('AmigaTeX.ErrorLoc')
  50. if errorloc = "" then exit
  51. else parse var errorloc filename linenum charpos
  52. address 'mg' "^X^F '"||filename||"'"
  53. address 'mg' "$x 'goto-line' '"||linenum||"'"
  54. address 'mg' "^U "||charpos-1||" ^F"
  55. exit
  56.  
  57. As you can see, the `mg' port gets messages like:
  58.  
  59.     ^X^F 'foobar.tex'
  60.     $x 'goto-line' '20'
  61.     ^U 12 ^F
  62.  
  63. to move to character 12, line 20, in file foobar.tex.  Simple, eh?
  64.  
  65. For information on ARexx, contact William Hawes, Box 308, Maynard, MA  01754
  66. or call him at (617) 568-8695.  (ARexx is not for those uncomfortable in
  67. the CLI.)  For information on this mg, or AmigaTeX, or whatever, I can be
  68. reached at Tomas Rokicki, Box 2081, Stanford, CA  94309.  My telephone is
  69. (415) 326-5312; you will probably have to leave a message.  Enjoy!
  70.  
  71. (Oh, I also set the default window to be a bordered, resizeable window;
  72. I hated that damn openwindow/closewindow/openwindow sequence whenever the
  73. old mg started up.)
  74.