home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / M_EXT23.ZIP / M_EXT.DOC < prev    next >
Text File  |  1989-07-22  |  9KB  |  225 lines

  1. ------------------------------------------------------------------
  2.  
  3. Microsoft Editor Extension (m_ext.zxt)
  4.  
  5. ------------------------------------------------------------------
  6.  
  7. (c)  Copyright Ken Waldron, 1989.
  8.                P.O. Box 69807 Stn K, Vancouver, B.C. V5K 4Y7
  9.  
  10.      Permission is granted to distribute this documentation for
  11.      non-commercial purposes on electronic bulletin boards
  12.      provided that documented source files and executables are
  13.      distributed with it, and no special fee is charged for
  14.      downloading them. For other uses, please obtain written
  15.      permission. Microsoft and Wordstar are registered trademarks
  16.      of Microsoft Corporation and Micropro International,
  17.      respectively.
  18.  
  19.      NOTE:  If you've used earlier versions, please note that
  20.      =====  the extension name has been changed to m_ext.ZXT.
  21.  
  22. This file documents release 2.3 of m_ext.zxt, an extension for the
  23. Microsoft Editor. The editor, M.EXE, is shipped with MASM 5.x and
  24. MSC 5.x. The extension adds a number of editor functions that I
  25. have found useful. The functions are written in assembly language
  26. so they are compact and fast. Here's a quick list:
  27.  
  28.      Changecase
  29.      Dequeue
  30.      Enqueue
  31.      Fill
  32.      Number
  33.      Pdelword
  34.      Quik
  35.      Transpose
  36.  
  37. To use the new functions, either load the extension manually, or
  38. place the following in your tools.ini file just after [M] label:
  39.  
  40.      load:$INIT:m_ext.zxt
  41.  
  42. This will work as shown if your environment defines INIT as a path
  43. to a directory and if you have copied m_ext.zxt to that directory.
  44. If you keep m_ext.zxt elsewhere, specify the correct path.
  45.  
  46. Assign the new functions to desired key-chords. It is convenient
  47. to put the assignments in tools.ini also. For example:
  48.  
  49.      Changecase:alt+C
  50.      Pdelword:alt+T
  51.      Quik:ctrl+Q
  52.  
  53. If you have any questions or problems or would like to suggest a
  54. new function to be added to the extension, please write to me at
  55. the address shown above.
  56.  
  57. ------------------------------------------------------------------
  58.  
  59. Changecase
  60.      Toggles the case of an alphabetic character under the cursor.
  61.  
  62. Arg boxarg Changecase
  63. Arg markarg Changecase       [the area referenced must be a box]
  64.      Changes upper-case characters in specified box to lower-case.
  65.  
  66. Arg Arg boxarg Changecase
  67. Arg Arg markarg Changecase   [the area referenced must be a box]
  68.      Changes lower-case characters in specified box to upper-case.
  69.  
  70. Returns FALSE if the argument is invalid, otherwise TRUE.
  71.  
  72. ------------------------------------------------------------------
  73.  
  74. Dequeue
  75.      Inserts the contents of the queue at the current line.
  76.  
  77. Meta Dequeue
  78.      Inserts the first line of the queue at the current line and
  79.      removes the line from the queue.
  80.  
  81. Returns FALSE if queue is empty and TRUE otherwise.
  82.  
  83. See the definition of the Enqueue function for more information
  84. about the queue functions and the queue file.
  85.  
  86. ------------------------------------------------------------------
  87.  
  88. [Meta] Enqueue
  89.      Copies the current line to the end of the queue.
  90.  
  91. Arg [Arg] [Meta] linearg Enqueue
  92. Arg [Arg] [Meta] numarg Enqueue
  93. Arg [Arg] [Meta] markarg Enqueue [area referenced must be a linearg]
  94.      Copies the selected lines to the end of the queue. If the
  95.      extra Arg prefix is supplied, then the selected lines are
  96.      deleted after they are copied (the deleted lines are not
  97.      copied to the built-in editor clipboard).
  98.  
  99. If the Meta prefix is supplied then the contents of the queue are
  100. erased before the new text is appended.
  101.  
  102. Returns FALSE if the argument is invalid and TRUE otherwise.
  103.  
  104. See also the Dequeue function.
  105.  
  106. The queue is a pseudo file maintained by the Enqueue and Dequeue
  107. functions. I use it to gather scattered lines together: Enqueue
  108. the lines in turn, then Dequeue them all at the desired location.
  109. The queue may be used to reverse the order of a group of lines:
  110. Enqueue the lines, then Meta Dequeue them one at a time. The queue
  111. is also handy as an extra clipboard (but note that the queue is
  112. strictly line-oriented).
  113.  
  114. ------------------------------------------------------------------
  115.  
  116. Arg linearg Fill
  117. Arg numarg Fill
  118. Arg markarg Fill     [the area referenced must be a linearg]
  119.      Fills the selected lines by rearranging text to the right of
  120.      the cursor to fit as many words as possible on each line
  121.      between the cursor column and the fill margin. The default
  122.      fill margin is at column 72 (this can be changed by assigning
  123.      a different value to the numeric switch "fillmargin"). Words
  124.      are delimited by spaces. Extra spaces and lines are lost
  125.      after filling. If a single word is too long to fit between
  126.      the cursor column and the fill margin then the word will
  127.      spill over the margin.
  128.  
  129. Returns FALSE if the argument is invalid or the fillmargin is
  130. less than the initial cursor column or greater than BUFLEN.
  131. Otherwise returns TRUE.
  132.  
  133. Tip: Fill may be used to break a group of lines into a list of
  134.      words. Set fillmargin to 1, mark the lines, and Fill.
  135.  
  136. Bugs:
  137.      If the editor switch "trailspace" is on, then trailing spaces
  138.      are treated as a word.
  139.  
  140.      Lines which end up "empty" after filling are deleted, even if
  141.      they contain text to the left of the cursor.
  142.  
  143.      After a call to Fill, only that one Fill can be undone; the
  144.      rest of the undo stack is lost (I don't know why).
  145.  
  146. ------------------------------------------------------------------
  147.  
  148. [Meta] Number
  149.      This function is used to generate integer sequences. Each
  150.      time it is called, Number inserts a string representing the
  151.      current value of "numcount" as a base "numbase" integer at
  152.      the cursor position, then increments numcount by the amount
  153.      of "numstep" (which may be negative, in which case numcount
  154.      is decremented). If the Meta prefix is used then the number
  155.      is right adjusted in a field "numwidth" columns wide, padded
  156.      with the character of ASCII value "numpad" (if the number is
  157.      too long for the field then numwidth is ignored).
  158.  
  159. [Meta] Arg Number
  160.      As above, except that numcount is not incremented.
  161.  
  162. [Meta] Arg Arg Number
  163.      As in first paragraph above, except that numcount is first
  164.      initialized to zero.
  165.  
  166. Always returns TRUE.
  167.  
  168. Numeric switches        Default value        Legal values
  169. recognized by Number
  170. --------------------    ----------------     -----------------------
  171.      numcount                 0              -32768..32767
  172.      numstep                  1              -32768..32767
  173.      numwidth                 6              1..BUFLEN
  174.      numbase                 10              2..36
  175.      numpad                  32  (space)     1..255
  176.  
  177. Bugs:
  178.      Expect weirdness if switches are set out of range. If numbase
  179.      is out of range, Number will use the default base 10 to avoid
  180.      fatal math errors. If numpad is zero, then if padding is
  181.      used, the NUL padding character(s) will truncate the current
  182.      line before the number is inserted. If numpad is otherwise
  183.      out of range the padding character is unpredictable. If
  184.      numwidth is out of range it will be ignored. If numcount is
  185.      incremented out of range it will simply wrap around, changing
  186.      its sign. If you undo Number, numcount will NOT be
  187.      decremented by the undo.
  188.  
  189. ------------------------------------------------------------------
  190.  
  191. Pdelword
  192.      Deletes the character under the cursor and any characters
  193.      immediately following which are in the same class. There are
  194.      two main character classes: alphanumeric characters and
  195.      space. Others (including tab and newline) are in classes of
  196.      their own. Deleted text is not copied to the clipboard. The
  197.      deletions are undoable.
  198.  
  199. Always returns TRUE.
  200.  
  201. ------------------------------------------------------------------
  202.  
  203. Quik
  204.      I attach this function to ctrl+Q to implement the Wordstar
  205.      quick cursor movement commands. It is a replacement for the
  206.      WS.ZXT extension supplied with the editor. Only the cursor
  207.      movement keys are supported (ctrl+Q S|D|E|X|R|C), and their
  208.      interpretation is changed slightly. Avoids the need to load
  209.      two extension files, saving time and memory (if you can live
  210.      without the non-cursor commands ctrl+Q A|F|K|Y)
  211.  
  212. Returns the value of the command string executed.
  213.  
  214. ------------------------------------------------------------------
  215.  
  216. Transpose
  217.      Exchanges the character under the cursor with the following
  218.      character. If the cursor is at or beyond the last character
  219.      on the line, then the last two characters on the line are
  220.      exchanged.
  221.  
  222. Always returns TRUE.
  223.  
  224. ------------------------------------------------------------------
  225.