home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / utilities / zap / !Zap / 3rdParty / CModeHelp < prev    next >
Encoding:
Text File  |  1994-03-03  |  8.6 KB  |  299 lines

  1.  
  2. This is the ReadMe file for ZapCMode 0.20
  3.  
  4.     © Bryan Scattergood (03-Mar-1994)
  5.  
  6. This is an extension mode for Zap.  It requires Zap 0.91 or later.  It adds
  7. simple bracket matching and automatic indent to the standard Text mode in Zap
  8. to create a mode suitable for editing C, Pascal, Tex, LaTex and Gofer.  It
  9. does *not* add bracket matching to BASIC mode.
  10.  
  11. It also adds a C function browser and function search commands, in the style
  12. of Martin Ebourne's derivative of CMode 0.03 (which he called 0.10).  It now
  13. supports a simplified version of his compilation command.
  14.  
  15. The distribution conditions of ZapCMode are the same as those for Zap, with
  16. one exception; you do not need my permission to copy ZapCMode if you have
  17. Dominic Symes' permission to copy Zap.  Thus, ZapCMode is freeware and those
  18. wishing to distribute it on a cover disk need only contact Dom for
  19. permission.
  20.  
  21.  
  22. Installation
  23. ============
  24.  
  25. 1. Check your version of Zap is >= 0.91 (in the Info box).
  26. 2. Copy the ZapCMode module into the !Zap directory.
  27. 3. Add the line
  28.     RMLoad <Zap$Dir>.ZapCMode
  29.    after the line
  30.        RMLoad <Zap$Dir>.ZapBasic
  31.    in the !Zap.!Run file, if it is not already present.
  32. 4. Restart your copy of Zap.
  33.  
  34.  
  35. The menu
  36. ========
  37.  
  38. The mode adds the following menu on the Zap Mode menu.
  39.  
  40. ....    +----------+
  41. CMode =>| Pause  =>|
  42. ....    | Indent =>|
  43.     | Match  =>|
  44.     | C        |
  45.     | Tex      |
  46.     | Gofer    |
  47.     +----------+
  48.     
  49. The pause option sets the delay in centiseconds when the cursor is moved back
  50. to the open bracket after a close bracket is typed.  The field can be set to
  51. any value between 0 and 255 inclusive.
  52.  
  53. The indent option sets the relative indent of lines following an open brace
  54. ('{').  The field can be set to any value between 0 and 31 inclusive.  The
  55. indent is relative to the start of the line containing the open brace, and
  56. consists of space characters.  Setting to 0 gives the same indent as
  57. AutoIndent on the lines following open braces.
  58.  
  59. The Match menu controls which 'bracket' characters are matched.
  60.  
  61.     +-------+    
  62.     |  { }  |
  63.     |  [ ]  |
  64.     |  ( )  |
  65.     |  ` '  |
  66.     |  " "  |
  67.     |  $ $  |
  68.     | $$ $$ |
  69.     |  ` `  |
  70.     +-------+    
  71.     
  72. The three sets of brackets are generally useful, as are the double quotes.
  73. The single quotes, and dollar patterns are useful for TeX, while the
  74. backquote is used in Gofer for turning functions into infix operators.
  75.  
  76. The remaining three options on the main menu select commonly used sets
  77. of options for the Match menu.
  78.  
  79. The keyboard
  80. ============
  81.  
  82. To enter CMode from the keyboard, with the default keymap, use scF8. In this
  83. version, the function browser is invoked using SAVEANDRUN, bound to scE in
  84. the standard keymap.  The bounce function is bound to BASIC, which is scB. 
  85. The next/previous function commands are on RUNANDQUIT and RUN respectively,
  86. normally scF and scU. The function lister is bound to scH as in BASIC mode.
  87. The compile entry point is on scC.
  88.  
  89. Overloadings of the basic mode entry points may be removed in later versions;
  90. they are no longer necessary given the keymaps of Zap 0.91 and later.
  91.  
  92.  
  93. The commands
  94. ============
  95.  
  96. Some of these keys are also available via other entry points and so are
  97. bound in the standard keymap to the indicated keys.
  98.  
  99. C_LIST_FUNCTIONS                (SAVEANDRUN, scE)
  100.  
  101. Pops up a function browser on the current buffer.  As usual with throwback
  102. buffers, double click will jump to the corresponding location in the original
  103. buffer.  The throwback buffer will not be displayed if no functions can be
  104. found.
  105.  
  106. C_PREV_FUNCTION                    (RUN, scU)
  107. C_NEXT_FUNCTION                    (RUNANDQUIT, scF)
  108.  
  109. These step to the next function definition in the appropriate direction.
  110.  
  111. C_COMPILE                    (COMPILE, scC)
  112.  
  113. Looks up one directory for a Makefile, and does a DataOpen broadcast if
  114. it finds one; this is only successful if !Make is already loaded.
  115.  
  116. C_BOUNCE                    (BASIC, scB)
  117.  
  118. This bounces back to the open corresponding to the close character under
  119. the cursor.
  120.  
  121. C_SET_PAUSE n
  122. C_SET_INDENT n
  123.  
  124. These set the pause delay and indent step (the writable menu items)
  125. to the corresponding value.
  126.  
  127. C_MODE
  128. TEX_MODE
  129. GOFER_MODE
  130.  
  131. Switch the buffer to CMode, and set the match flags appropriately.
  132.  
  133.  
  134. Bugs and suggestions
  135. ====================
  136.  
  137. First, the standard disclaimer:
  138.  
  139. This program is provided "as is", without any warranty of any kind. The
  140. entire risk as to its quality and performance is with you.  In no event will
  141. I be liable for damages arising from the use of this program.
  142.  
  143. Having said that, CMode has been under test (in various versions) for several
  144. months and is coded fairly defensively.  If you manage to find any bugs,
  145. especially serious ones, then contact me as soon as possible and I'll try
  146. to fix it.
  147.  
  148. Similarly, suggestions are welcome, although many of the usual requests are
  149. not possible with the current version of Zap without insane amounts of work.
  150.  
  151. I can be contacted as
  152.  
  153.     jbs@uk.ac.ox.prg
  154.     
  155. or by post as
  156.  
  157.     Bryan Scattergood
  158.     The Queens College
  159.     Oxford
  160.     OX1 4AW
  161.  
  162. both addresses being good until September 1994.  After then, post sent to the
  163. above address should reach me eventually.
  164.  
  165. Acknowledgements
  166. ================
  167.  
  168. Thanks must obviously go to Dominic Symes, firstly for creating Zap and
  169. secondly for answering my (numerous) questions about writing extension modes.
  170. Thanks must also go to the many members of the Oxford Arc User Group who
  171. pushed this from being a prototype supporting only C, to a configurable
  172. stable product supporting C, TeX and Gofer.  Their efficiency at finding
  173. some of the more subtle bugs was especially valuable.
  174.  
  175. This version of CMode incorporates some ideas first implemented by Martin
  176. Ebourne in his CMode, which in turn used code from CMode 0.03.  In doing
  177. so it fixes some bugs in the function browser code.
  178.  
  179.  
  180. Version history
  181. ===============
  182.  
  183. 0.01
  184. 0.02
  185.  
  186. Early prototype versions for testing by the Oxford Arc User Group.
  187.  
  188. 0.03
  189.  
  190. Simple version matching {}, () and [] unconditionally.  Released with Zap
  191. 0.90 by Dominic Symes.
  192.  
  193. 0.04
  194.  
  195. Added simple $..$ matching for Dom.
  196.  
  197. 0.05
  198.  
  199. Add quote matching and $$..$$, together with Match menu item to
  200. allow for configuration for different languages.
  201.  
  202. 0.06
  203.  
  204. Cleaned up sources, creating a separate library to share with other modes,
  205. and changed to use w_tabc rather than wiring in character 9.
  206.  
  207. 0.07
  208.  
  209. Added bounce command as BASIC, (so on scB).
  210.  
  211. 0.08
  212.  
  213. Added code to remove delay on bounce when the user types ahead.
  214.  
  215. 0.09
  216.  
  217. Added accelerators for commonly used Match combinations; TeX, C and Gofer.
  218.  
  219. 0.10
  220.  
  221. Added function searching and browsing, together with incomplete command
  222. interface.
  223.  
  224. 0.11
  225.  
  226. Allow tabs and spaces after the open brace when indenting on a return.
  227. Use Zap_BaseMode, rather than Zap_CallBaseMode.
  228. Moved C_LIST_FUNCTIONS onto e_listfns vector.
  229. Fixed glitch in function browser (scanner now handles '{' properly).
  230. Fixed the bounce bug introduced in 0.08; the delay for the display when
  231. bouncing was essentially random, and usually very small.
  232.  
  233. 0.12 (Released with Zap 1.0)
  234.  
  235. Fixed mistake with function browser when no functions present; tried to clear
  236. modify bit without checking whether throwback buffer had been generated.
  237.  
  238. 0.13 (Not released; checkpoint version before 0.14)
  239.  
  240. Modified recogniser to make the code more K&R friendly; essentially allow
  241. semicolon between the closing parenthesis and opening brace of a potential
  242. function body provided (a) there was some non white-space before and it
  243. and (b) there was only white space after it.
  244.  
  245. 0.14
  246.  
  247. Changed the recogniser still further so that preprocessor directives are
  248. skipped (and so correspond to whitespace).  This allows the idiom below,
  249. which is fairly common in code which must support both K&R and ANSI C
  250. compilers.
  251.  
  252.     #ifdef __ANSI__
  253.     void foo(int x)
  254.     #else
  255.     void foo(x)
  256.     int x;
  257.     #endif /* <- this is now skipped */
  258.     {
  259.       /* Wibble */
  260.     }
  261.  
  262. This also means that macro definitions involving blocks are no longer
  263. recognised as well, so that
  264.  
  265.     #define swap(x, y) { int t = x; x = y; y = t; }
  266.     
  267. is no longer considered a function definition (it was previously).
  268.  
  269. 0.15
  270.  
  271. (Alex) Character literals and strings are no longer scanned within comments.
  272. This prevents a comment like /* This " comment */ from losing all the
  273. subsequent functions in the file.
  274.  
  275. 0.16
  276.  
  277. Add a beep when the function browser fails to find any functions as feedback
  278. that the button was pressed.
  279.  
  280. 0.17
  281.  
  282. Add a minimal compile command; it simply broadcasts a DataOpen on the
  283. Makefile, if it exists.
  284.  
  285. 0.18
  286.  
  287. Revise source code layout in library area, and modify library loading
  288. to match.  No functional changes.
  289.  
  290. 0.19    Development version
  291.  
  292. Augmented the compile command to scan for ZapCompile:, and added ZapInitial:
  293. processing.  Added the *_MODE commands for use with Initial:.
  294.  
  295. 0.20    
  296.  
  297. Removed the ZapInitial and ZapCompile prototypes: abandon initial as too
  298. vulnerable to attack by Trojans, and ZapCompile needs much more work.
  299.