home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / ME22-OS2.ZIP / CHANGES.22 next >
Text File  |  1989-08-13  |  30KB  |  890 lines

  1.                           Changes to ME 2.2
  2.            ----------------------------------------------------
  3.  
  4. Swap entire editor out of memory for DOS commands
  5. -------------------------------------------------
  6. We are using a package written by Thomas Wagner of Germany to swap the
  7. entire editor out to disk when we shell out to DOS. There is only a very
  8. small portion of the editor left in memory after the swapping is done. This 
  9. will free up a lot more memory for those big compiles which you need to do
  10. from within ME.
  11.  
  12. For those of you who are technically minded, we now need to use malloc() to
  13. allocate a VM page buffer instead of allocating directly from DOS as we did 
  14. before. If you know that you are not going to shell out to DOS during an
  15. editing session and you want the editor to allocate a page buffer directly
  16. from DOS, invoke ME with the -a argument.
  17.  
  18.  
  19. UNDO and REDO Command
  20. ---------------------
  21. The big addition to 2.2 is the UNDO/REDO capability. This is true UNDO - any
  22. editing operation can be undone, even global substitution.
  23.  
  24. To invoke UNDO, press the <GREY MINUS> key. You can then press the left arrow 
  25. key to undo an operation and the right arrow key to redo it. This function can
  26. be referenced in the macro language as "new_undo".
  27.  
  28. un, ul and uc options in CONFIG.ME
  29.   un is 1 if you want UNDO, 0 if not. If un is not found in CONFIG.ME,
  30. then UNDO will be enabled.
  31.   ul is the undo buffer length for each buffer (default = 4096)
  32.   uc is the depth of the undo stack (default = 64).
  33.  
  34. -ul<num> and -uc<num> are new command-line arguments. -ul8192 sets the
  35. undo buffer to be 8192 bytes long, and -uc100 sets the undo stack to
  36. 100 operations.
  37.  
  38.  
  39. State file
  40. ----------
  41. The state of your last editing session is now preserved in an external
  42. state file. The editor will load a state file if you invoke ME without
  43. any file names on the command line.
  44.  
  45. The STATE.ME file is an ASCII file which contains information about the
  46. state of the last editing session. It is patterned after the state file
  47. which the Microsoft C v6 compiler uses.
  48.  
  49. The MESTATE environment variable defines the path where you would like
  50. the STATE.ME file to reside. If you do not define this variable, then
  51. a STATE.ME file will be created in every subdirectory which you use the
  52. editor in. If you choose to use the MESTATE environment variable, then
  53. the editor will look for STATE.ME in the defined path, and will write the
  54. new STATE.ME file to that path.
  55.  
  56. The "st" variable in both the options menu and in the CONFIG.ME file control
  57. whether or not to read and write the state file. The default value is TRUE.
  58.  
  59.  
  60. New Command Line Arguments
  61. --------------------------
  62. -s<n> command line option for MaxPageSlots * 1K
  63.   ie:  -s3 gives you 3K page slots
  64.  
  65. -p<n> command line option for PageSize * 1K
  66.   ie:  -p16 gives you a 16K VM page
  67.  
  68.  
  69. New Environment Variables
  70. -------------------------
  71. 1) MEFLAGS environment variable.
  72. If you always want to start ME with certain
  73. command-line options (such as -4, -lxxx, etc), you can place these options
  74. in an environment variable called MEFLAGS. Each option must be separated by
  75. a space. To use the MEFLAGS variable, you can place the following command in
  76. your AUTOEXEC.BAT file :
  77.  
  78.   set MEFLAGS=-<opt1>[ -<opt2>...]
  79.  
  80. For instance,
  81.  
  82.   set MEFLAGS=-veverex3.drv -ul4096
  83.  
  84. will automatically load the everex3.drv video driver, and will set the undo
  85. buffer length to 4K per buffer.
  86. If you have the MEFLAGS variable set, and you start ME with command-line
  87. arguments, the options specified in MEFLAGS will be acted on first followed
  88. by the ones which you specified on the command line.
  89.  
  90.  
  91. 2) MEPATH environment variable and the "mp" option. 
  92. When you try to read a file, you usually specify the name of the file if you
  93. want to access the current directory, and you usually specify a path plus
  94. the file name if you want to access another directory. We have added a
  95. convenience feature which makes accessing files in other directories
  96. easier. The MEPATH environment variable can be set to a list of semi-colon
  97. separated pathnames (like the DOS PATH environment variable) which ME will
  98. search if the file is not in the current directory. For instance, if you
  99. often want to view the C compiler's include files while editing, you might
  100. put the following line in your AUTOEXEC.BAT file :
  101.  
  102.   set MEPATH=d:\msc5\include;d:\msc5\include\sys
  103.  
  104. If you want to view the file STDIO.H while in an ME session, press the
  105. key which corresponds to the open_window() command. When ME asks you for the
  106. file to put in the other window, merely type "stdio.h". If STDIO.H is not
  107. in your current directory, then all of the directories in MEPATH will be
  108. searched.
  109.  
  110. There is an editor variable which you can set in either the CONFIG.ME file
  111. or in the options menu which controls whether or not the MEPATH environment
  112. variable should be used. The "mp" option should be set to 1 if the MEPATH
  113. should be searched, and 0 if not.
  114.  
  115.  
  116. Saving the Original Display
  117. ---------------------------
  118. We now save the opening DOS/OS2 screen. There is a "ds" parameter in the
  119. CONFIG.ME file (but not in the options menu) which should be 1 if you want
  120. to save the DOS screen and 0 if not. (The default is 1.)
  121. The user can view the opening screen by pressing <CTRL F1> or by invoking
  122. the show_dos_screen() macro.
  123.  
  124.  
  125. Command to Key Help
  126. -------------------
  127. The <SHIFT F1> key is now bound to the function name_to_key(string cmdname).
  128. This command accepts the name of am editing command or a macro, and returns
  129. the keystroke name(s) which invokes that command/macro.
  130.  
  131.  
  132. Case change function added
  133. ---------------------------
  134. There is a new command in the block menu. If you type the letter 'k', the
  135. case of the letters in the block will be changed to either all upper case or
  136. all lower case.
  137.  
  138.  
  139. Regular Expressions Improved
  140. ----------------------------
  141. We added '{' and '}' for parenthesized expressions.
  142. Example
  143.   {abc}+ searches for one or more occurences of "abc".
  144.  
  145. We have also improved alternation.
  146.  
  147. We added the following shortcuts:
  148.  
  149.   "[a-zA-Z0-9]",  'a',            /* :a => alphanumeric */
  150.   "[ \t]+",       'b',            /* :b => whitespace */
  151.   "[a-zA-Z]",     'c',            /* :c => alpha */
  152.   "[0-9]",        'd',            /* :d => any digit */
  153.   "[0-9a-fA-F]+", 'h',            /* :h => hex number */
  154.   "[0-9]+",       'i',            /* :i => integer */
  155.   "[a-zA-Z_][a-zA-Z_0-9]+", 'l',  /* :l => valid C identifier */
  156.   "[a-zA-Z]+",    'w',            /* :w => word */
  157.  
  158. IMPORTANT - To search for a colon, you must prefix it with a backslash
  159. (ie - \:). Your next-error macros will probably have to be altered slightly.
  160.  
  161.  
  162. Simpler Access to Block Indent
  163. ------------------------------
  164. Pressing TAB or BACKTAB in response to a pick command will
  165. invoke block indent. These keys can be used in addition to the current
  166. method of pressing 'i' and then pressing the arrow keys.
  167.  
  168.  
  169. Percentage Indicator
  170. --------------------
  171. ME now shows the percentage of the file currently being read. This does
  172. not speed up reads, but will let you know how the editor is progressing
  173. during longish file reads.
  174.  
  175. Embedded 0xFFs
  176. --------------
  177. ME can now read files with imbedded 0xFF bytes.
  178.  
  179. Support for > 32K lines
  180. -----------------------
  181. Buffers can now contain up to 2^31-1 lines. We changed the internal data
  182. type of line numbers from int to long.
  183.  
  184. VGA support added
  185. -----------------
  186. ME will now support VGA cards without the use of external video drivers.
  187.  
  188. Reading Sped Up
  189. ---------------
  190. File reading speed has been improved on the order of 30%.
  191.  
  192. Default Page Size Increased
  193. ---------------------------
  194. The default VM page size has been changed from 4K to 16K.
  195.  
  196.  
  197.                      MACRO LANGUAGE ENHANCEMENTS
  198.                      ---------------------------
  199.  
  200. Macro file extension
  201. --------------------
  202. The macro compiler will now compile files with a .m extension. You just need
  203. to give the root name to the compiler. For instance, if you have a macro
  204. file called linedraw.m, then all you need to do to compile it is give the
  205. DOS command  "maccomp linedraw".
  206.  
  207.  
  208. Init macro for file extensions
  209. ------------------------------
  210. When a buffer is created for the first time, the file extension of the
  211. buffer is examined and a user-defined macro is called. ME looks for
  212. a macro called _ext, where "ext" is the file extension in lower case.
  213. For instance, for "C" files, ME will try to run a macro called _c(), and
  214. for assembler files, ME will try to run _asm().
  215.  
  216. This facility can be used to set up some language-sensitive features, such
  217. as keyword recognition and templeting.
  218.  
  219. If you edit files with different languages simultaneously, you may want
  220. to think about using hook 28 (discussed below). Hook 28 is called when
  221. a buffer becomes the "current" buffer.
  222.  
  223.  
  224. Bit Twiddling Operators Added
  225. -----------------------------
  226. We have added the following operators to the macro language:
  227.  
  228.   >>   right shift
  229.   <<   left shift
  230.   &    logical AND
  231.   |    logical OR
  232.   ^    logical XOR
  233.   ~    logical NOT
  234.  
  235. Please note - we do not have augmented assigment operators which correspond
  236. to these operators yet. In other words, the statement "a |= b" is not yet legal.
  237.  
  238.  
  239. Faster insert() Function
  240. ------------------------
  241. The insert() function really slowed down in 2.1 due to the overhead of the
  242. virtual memory manager and the addition of real tabs. We sped up the
  243. insert() function by shoving the inserted string into the current buffer
  244. without doing any kind of sophisticated checking. For compatability, you
  245. can use the slow_insert() function; slow_insert() should be used only in
  246. the case where you are inserting a tab AND the "rt" variable is set to 0.
  247.  
  248. Slow_insert() takes two arguments. The first arg is the string to insert.
  249. The second arg is non-zero if you want the string inserted in front of
  250. existing characters and zero if you want the string to overwrite existing
  251. characters.
  252.  
  253. For example, you would use 
  254.  
  255.   slow_insert("abc", 1);
  256.  
  257. instead of
  258.  
  259.   insert("abc");
  260.  
  261. The new insert() will really speed some of your macros up, especially if
  262. you are inserting long lines of text. 
  263.  
  264.  
  265. New error message format
  266. ------------------------
  267. In order to conform to Microsoft's format of error messages, the compiler
  268. now puts out error messages in this format :
  269.  
  270.   filename(line) : syntax error ......
  271.  
  272. If you are using the old COMPMAC macro to compile your macros from within ME,
  273. you will need to change the regular expression used to parse errors.
  274.  
  275.  
  276. New Return for Capture_Dos()
  277. ----------------------------
  278. The capture_dos() function now returned the buffer id in which the DOS
  279. output is saved in. You can then display it if you want by issuing a
  280. show_buffer() call.
  281.  
  282.  
  283.  
  284. New Functions
  285. -------------
  286.  
  287. We added a bunch of functions to the macro language. Most of these functions
  288. are implemented using the ME feature of linking to external C routines. In
  289. this case, most of these routines were things from the standard C run-time
  290. library which we use anyway --- we just made them available to the macro
  291. language.
  292.  
  293. ------------------------------------------------------------------
  294.  
  295. string abspath(fname)
  296.   string fname;
  297.  
  298. Returns the absolute path name corresponding to a file. The absolute
  299. path name originates from the root directory.
  300.  
  301. Parameters
  302.   Fname is the name of the file. It may contain a partial path specifier,
  303. and may contain the directories '..' and '.'.
  304.  
  305. Returns
  306.   A string which represent the absolute path name of the file. The first
  307. two characters of the path are the drive specifier.
  308.  
  309. Example
  310.  
  311.   /*
  312.     If the file 'foo' is in the path c:\X\Y\Z\ME and the current directory is
  313.     c:\X\Y\Q\R, then abspath() will return C:\X\Y\Z\ME\FOO
  314.   */
  315.   true_path = abspath("..\\..\\ME\\foo");
  316.  
  317. -----------------------------------------------------------------
  318.  
  319. int access(fname, mode)
  320.   string fname;
  321.   int    mode;
  322.  
  323. If fname is the name of a file, access() checks whether the file exists and
  324. can be accessed in 'mode'. If fname is the name of a directory, access()
  325. only checks whether the directory exists.
  326.  
  327. Parameters
  328.   Fname is the name of a file or directory.
  329.   Mode can be one of the following
  330.     0    checks for existence only
  331.     2    checks for write permission
  332.     4    checks for read permission
  333.     6    checks for read and write permission
  334.  
  335. Returns
  336.   0 is returned if the file can be accessed in the specified mode. -1 is
  337. returned if the file either does not exist or cannot be accessed in that mode.
  338.  
  339. Example
  340.  
  341. /*
  342.   This function will return non-zero if a file exists
  343. */
  344. FileExists(fname)
  345.   string fname;
  346. {
  347.   if (access(fname, 0) == 0)
  348.     return 1;
  349.   else
  350.     return 0;
  351. }
  352.  
  353. ------------------------------------------------------------------
  354.  
  355. autoload(filename, macroname [, keys...])
  356.   string filename, macroname;
  357.   int or string keys;
  358.  
  359. Defers the loading and execution of macro 'macroname' from file 'filename'
  360. only when the macro is accessed for the first time. This allows you to
  361. conserve memory and cut startup time if you want to have access to a number
  362. of infrequently loaded macros.
  363.  
  364. Parameters
  365.   Filename is the name of the file which the macro is located in. The
  366. ME rules for accessing a macro file are followed here.
  367.   Macroname is the name of the macro to load and execute.
  368.   Keys is the sequence of keystrokes which the macro is bound to.
  369.  
  370. Returns
  371.   TRUE
  372.  
  373. Example
  374.  
  375.   /* Help is loaded only if and when the user presses ALT-H */
  376.   autoload("helpme", "help", "<ALT-H>");
  377.  
  378.   /* Compress is loaded and executed only when the user presses ALT-P and
  379.      specifies 'compress' as the macro to execute.
  380.   */
  381.   autoload("compress", "compress");
  382.  
  383. ------------------------------------------------------------------
  384.  
  385. int chdir(dirname)
  386.   string dirname;
  387.  
  388.   Changes the current working directory on any drive.
  389.  
  390. Parameters
  391.   Dirname is the name of the directory to change to. If dirname contains
  392. a drive specifier, the working directory on that drive will be changed,
  393. however, the default drive is NOT changed.
  394.  
  395. Returns
  396.    0 if successful, -1 if not.
  397.  
  398. Example
  399.  
  400.   if (chdir("\\TMP") != 0)
  401.     mkdir("\\TMP");
  402.  
  403. ------------------------------------------------------------------
  404.  
  405. string get_os()
  406.  
  407. This function is used in order to determine which operating system you
  408. are currently running on.
  409.  
  410. Parameters
  411.   None.
  412.  
  413. Returns
  414.   "DOS" if the editor is running on MS-DOS, and "OS2" if the editor is
  415. running under OS/2.
  416.  
  417. Example
  418.  
  419.   if (get_os() == "DOS")
  420.     get_tty_str("You are running under DOS");
  421.  
  422. ---------------------------------------------------------------------
  423.  
  424. int get_shiftstate()
  425.  
  426. Retrieves the current keyboard shift state.
  427.  
  428. Parameters
  429.   None.
  430.  
  431. Returns
  432.   The shift state is as follows :
  433. 0x01 Right SHIFT depressed          0x10 SCROLL LOCK on
  434. 0x02 Left SHIFT depressed           0x20 NUM LOCK on
  435. 0x04 CTRL key depressed             0x40 CAPS LOCK on
  436. 0x08 ALT key depressed              0x80 INSERT on
  437.  
  438. Example
  439.  
  440.   sh = get_shiftstate();
  441.   if (sh & 0x08)
  442.   {
  443.     message("ALT is on");
  444.   }
  445.  
  446. ------------------------------------------------------------------
  447.  
  448. string getcwd()
  449.  
  450.   Gets the name of the current working directory.
  451.  
  452. Parameters
  453.   None.
  454.  
  455. Returns
  456.   The name of the current directory.
  457.  
  458. Example
  459.  
  460.   szCWD = getcwd();
  461.   if (szCWD == "\\TMP")
  462.     chdir("\\ME");
  463.  
  464. ------------------------------------------------------------------
  465.  
  466. int getdrive()
  467.  
  468.   Returns the number of the current disk drive.
  469.  
  470. Parameters
  471.   None.
  472.  
  473. Returns
  474.   1 for drive A, 2 for drive B, 3 for drive C, 4 for drive D, etc.
  475.  
  476. ----------------------------------------------------------------------
  477.  
  478. string int_to_keyname(iKey)
  479.   int iKey;
  480.  
  481. Given a keycode, int_to_keyname() returns the corresponding keystroke
  482. name.
  483.  
  484. Parameters
  485.    iKey is an integer which should be a valid keycode.
  486.  
  487. Returns
  488.   The key name.
  489.  
  490. Example
  491.  
  492.   szName = int_to_keyname(9);
  493.   /* szName will be the string "<TAB>" */
  494.  
  495. ----------------------------------------------------------------------
  496.  
  497. int interrupt(intno, regs);
  498.   int intno;
  499.   unsigned regs[7];
  500.   /*
  501.     'regs' is laid out as follows
  502.     regs[1] = ax     regs[5] = si
  503.     regs[2] = bx     regs[6] = di
  504.     regs[3] = cx     regs[7] = cflag
  505.     regs[4] = dx
  506.   */
  507.  
  508. This function performs one of the interrupt routines. This corresponds to the
  509. int86() functionion most C compilers.
  510.  
  511. Parameters
  512.   Intno is the interrupt number.
  513.   Regs should contain parameters for the interrupt. After the interrupt is
  514. finished, the possibly modified registers will be found in regs[].
  515.  
  516. Returns
  517.   Whatever the interrupt returns.
  518.  
  519. Example
  520.  
  521. /*
  522.  The following function retrieves the cursor position using Int 10H.
  523. */
  524. get_cur()
  525. {
  526.   unsigned regs[8];
  527.  
  528.   regs[1] = 0x0300;
  529.   regs[2] = 0x0000;
  530.   interrupt(0x10, ®s);
  531.   /*
  532.     DH has the row and DL has the column position.
  533.   */
  534.   get_tty_str("The cursor is on row is %d and col is %d", 
  535.                                           regs[4] / 256, regs[4] % 256);
  536. }
  537.  
  538. --------------------------------------------------------------------
  539.  
  540. int keyname_to_int(szName)
  541.   string szName;
  542.  
  543. This function takes a keystroke name and returns the corresponding key code.
  544.  
  545. Parameters
  546.   szName should be a valid keystroke name.
  547.  
  548. Returns
  549.   An integer which represents the key code corresponding to the key name.
  550. If a match is not found, 0 is returned.
  551.  
  552. Eaxample
  553.  
  554.   key = keyname_to_int("<TAB>");
  555.   /* key will be the value 9 */
  556.  
  557. --------------------------------------------------------------------
  558.  
  559. int mkdir(dirname)
  560.   string dirname;
  561.  
  562.   Creates a new directory.
  563.  
  564. Parameters
  565.   Dirname is the name of the directory to create. It may contain a drive
  566. specifier and a full path.
  567.  
  568. Returns
  569.   0 if successful, -1 if not.
  570.  
  571. Example
  572.  
  573.   if (mkdir("\\TMP"))
  574.   {
  575.     get_tty_str("Could not create \\TMP");
  576.     return -1;
  577.   }
  578.  
  579. --------------------------------------------------------------------
  580.  
  581. int peekb(seg, offset)
  582. int peekw(seg, offset)
  583.   Retrieves the word or byte at address segment:offset.
  584.  
  585. Parameters
  586.   Seg is the segment to examine, and offset is the offset from the
  587. beginning of the segment.
  588.  
  589. Returns
  590.   The word (peekw) or byte (peekb) at that memory location.
  591.  
  592. Example
  593.  
  594.   /* Retreive the BIOS video mode */
  595.   video_mode = peekb(0x40, 0x49);
  596.  
  597. ------------------------------------------------------------------
  598.  
  599. int pokeb(seg, offset, byte)
  600. int pokew(seg, offset, word)
  601.   int seg;
  602.   int off;
  603.   int byte, word;
  604.  
  605. Places a byte or word (2 bytes) of data at the specified memory location.
  606.  
  607. Parameters
  608.   Seg is the segment to examine, and offset is the offset from the
  609. beginning of the segment. Byte or Word is the data to put into that
  610. memory location.
  611.  
  612. Returns
  613.   The old word (pokew) or byte (pokeb) at that memory location. This value
  614. can be saved in case you want to restore the original contents of the
  615. memory location at a later time.
  616.  
  617. ------------------------------------------------------------------------
  618.  
  619. int rmdir(dirname)
  620.   string dirname;
  621.  
  622.   Removes the specified directory. The directory is deleted only if it is
  623. empty and if it is not the current working directory.
  624.  
  625. Parameters
  626.   Dirname is the name of the directory to remove. It may contain a drive
  627. specifier and a full path.
  628.  
  629. Returns
  630.   0 if successful, -1 if not.
  631.  
  632. Example
  633.  
  634.   if (rmdir("\\TMP"))
  635.   {
  636.     get_tty_str("Could not remove \\TMP");
  637.     return -1;
  638.   }
  639.  
  640. ---------------------------------------------------------------------
  641.  
  642. setdrive(drive)
  643.   int drive;
  644.  
  645.   Changes the default disk drive to 'drive'.
  646.  
  647. Parameters
  648.   1 for drive A, 2 for drive B, 3 for drive C, 4 for drive D, etc.
  649.  
  650. Returns
  651.   Nothing.
  652.  
  653. ----------------------------------------------------------------------
  654.  
  655. sleep(millisecs)
  656.   int millisecs;
  657.  
  658. Suspends the execution of the editor for the specified number of milliseconds.
  659. While the editor is sleeping, the SLEEP hook (hook number 10) will be called
  660. repeatedly. See the section on hooks for more details.
  661.  
  662. Parameters
  663.   Millisecs is the number of milliseconds to sleep. 1000 milliseconds is
  664. equal to 1 second.
  665.  
  666. Returns
  667.   Nothing.
  668.  
  669. Example
  670.  
  671.   message("You messed up!");
  672.   sleep(2000);  /* suspends ME for 2 seconds to let the message soak in */
  673.  
  674. ------------------------------------------------------------------
  675.  
  676. string strlower(s)
  677. string strupper(s)
  678.   string s;
  679.  
  680. Transforms the passed string to either all upper or all lower case.
  681.  
  682. Parameters
  683.   S is the string to transform. It may contain mixed case letters. Characters
  684. which are non-alphabetic will not be transformed.
  685.  
  686. Returns
  687.   The transformed string.
  688.  
  689. Example
  690.  
  691.   s = strupper("AbcDef");  /* s will be "ABCDEF" */
  692.   s = strlower(s);         /* s will be "abcdef" */
  693.  
  694. ----------------------------------------------------------------
  695.  
  696. int unlink(fname)
  697.   string fname;
  698.  
  699.   Deletes the specified file.
  700.  
  701. Parameters
  702.   Fname is the name of the file to delete. It may contain a drive specifier
  703. and a full path.
  704.  
  705. Returns
  706.   0 if successful, -1 if not.
  707.  
  708. Example
  709.  
  710.   unlink("\\TMP\\ME.TMP");
  711.  
  712. ---------------------------------------------------------------------
  713.  
  714. CTYPE.H macros defined as ME macro functions
  715. --------------------------------------------
  716. isalnum(c)  TRUE if 'c' is alphanumeric, FALSE otherwise   (a-z,A-Z,0-9)
  717. isalpha(c)  TRUE if 'c' is alphabetic, FALSE otherwise     (a-z,A-Z)
  718. isascii(c)  TRUE if 'c' is an ASCII character, FALSE otherwise (c < 128)
  719. iscntrl(c)  TRUE if 'c' is control character, FALSE otherwise
  720. isdigit(c)  TRUE if 'c' is a digit, FALSE otherwise        (0-9)
  721. isgraph(c)  TRUE if 'c' is a graphic character, FALSE otherwise (alnum or punct)
  722. islower(c)  TRUE if 'c' is a lower-case alpha, FALSE otherwise (a-z)
  723. isprint(c)  TRUE if 'c' is a printable character, FALSE otherwise (graph or blank)
  724. ispunct(c)  TRUE if 'c' is a punctuation mark, FALSE otherwise
  725. isspace(c)  TRUE if 'c' is a whitespace character, FALSE otherwise
  726. isupper(c)  TRUE if 'c' is an upper-case alpha, FALSE otherwise     (A-Z)
  727. isxdigit(c) TRUE if 'c' is a hex digit, FALSE otherwise     (0-9,a-f,A-F)
  728.  
  729. toupper(c)  converts character c to upper-case
  730. tolower(c)  converts character c to lower-case
  731.  
  732.  
  733.  
  734. New Hooks
  735. ---------
  736. First, there is a file called event.h which give English names to the
  737. hook numbers. You may want to include this file in any macros which use
  738. hooks.
  739.  
  740. Hook 10 for sleeping.
  741. While the editor is idle because of the sleep() function, event 10 is
  742. continuously generated.
  743.  
  744. Hook 28 for changing to a buffer.
  745. When you set the "input focus" to a buffer (ie - when you make a buffer
  746. the current buffer), hook 28 will be run. This lets you do things like
  747. implement buffer-specific or file-extension-specific macros.
  748.  
  749. For example, you can do the following
  750.  
  751. init()
  752. {
  753.   add_hook(28, "set_buffer_tabs");
  754. }
  755.  
  756. set_buffer_tabs()
  757. {
  758.   if ((iExt = index(filename(), ".")) <= 0)
  759.     return;
  760.   szExt = strlower(substr(filename(), iExt+1, 3));
  761.  
  762.   switch (szExt)
  763.   {
  764.     case "c"   :
  765.       set_tabs("2 4 6 8 10 12 14 16 18 20");
  766.       break;
  767.     case "pas" :
  768.       set_tabs("4 8 12 16 20 24 28 32");
  769.       break;
  770.     case "asm" :
  771.       set_tabs("5 10 15 20 25 30");
  772.       break;
  773.   }
  774. }
  775.  
  776.  
  777. Hook 30 for status help.
  778. If you press ALT-H while responding to a prompt, event 30 will be generated.
  779. You can use this event to implement help for the user while he is responding
  780. to certain commands (like a file-completion or a command-completion utility).
  781.  
  782. Hook 31 for idling.
  783. While you are idle, event 31 will be generated. You can use this to implement
  784. things like real-time clocks which appear on the status line, etc.
  785.  
  786.  
  787. Key Names Now Supported
  788. -----------------------
  789. One of the bigger hassles in writing an ME macro is remembering the key
  790. codes. This problem is particularly acute when you are doing a lot of
  791. assign_key()'s in your macros. One solution is to include the file MEKEYS.H,
  792. and to use the #define'd name as the second argument to assign key.
  793.  
  794. ME now supports keystroke names. If the second argument to assign_key() is
  795. a string, ME will attempt to translate that string into a key code. For
  796. example, you can now have this kind of statement in a macro :
  797.  
  798.   assign_key("myfunc", "<ALT-X>");
  799.  
  800. Here is a list of the key names we now support :
  801.  
  802. <ALT-A> through <ALT-Z>, <ALT-0> through <ALT-9>, <ALT-->, <ALT-+>
  803. <SH-key> and <SHIFT-key>
  804. <CTRL-key> and ^key
  805. <F1> through <F12>
  806.  
  807. The following keys can be stand-along or prefixed with a SHIFT or CTRL.
  808. For example, <PGDN>, <CTRL-PGDN>, <SHIFT-PGDN>. Not all combinations
  809. will produce valid key codes. Use ME's <ALT F10> command to see which
  810. combinations produce valid key codes.
  811.  
  812. BACKSPACE         GREY-MINUS          PGDN 
  813. BACKTAB           GREY-PLUS           PGUP 
  814. DEL               HOME                PLUS 
  815. DOWN              INS                 PRTSCR
  816. END               LEFT                RETURN
  817. ENTER             MINUS               RIGHT 
  818. ESC                                   TAB  
  819. FIVE                                  UP
  820.  
  821. There are two new macro functions related to key names. They are
  822. int_to_keyname() and keyname_to_int(). Please see the above section on
  823. the new macro functions for more details.
  824. ----------------------------------------------------------------------------
  825.  
  826.                   HOW TO COMPILE FROM WITHIN ME
  827.  
  828. The following notes are from the new COMPILE.M macro. This macro is
  829. designed to replace the old MSCCOMP macro, and provides a more general
  830. way to compile. In addition, we think that it provides a more flexible
  831. platform for integrating other compilers.
  832.  
  833. In order to use this macro, dearchive it from the MACROS.ARC file, compile
  834. it with the command MACCOMP COMPILE, and load it in when you start the
  835. editor (the manual discusses several ways to do this. You may want to
  836. put it in your MEMACROS environment variable, since you have to create
  837. an MECOMPILE environment variable anyway.
  838.  
  839. /***************************************************************************/
  840. /*                                                                         */
  841. /*                          COMPILE.M                                      */
  842. /*                                                                         */
  843. /*  FUNCTION DESCRIPTION:                                                  */
  844. /*      This function initializes the hot keys to enable one to compile    */
  845. /*      a file from within ME.  The program does several things you should */
  846. /*      be aware of:                                                       */
  847. /*         1.  It relies on the existance of the environment variable      */
  848. /*             "MECOMPILE".  This variable identifies the various file     */
  849. /*              name extensions supported as well as the instructions for  */
  850. /*              calling the appropriate compiler.                          */
  851. /*              set MECOMPILE=.ccl -c -AL -W3 -H31 ;.asmmasm ;.mmaccomp ;  */
  852. /*              a.  for any file with a ".c" extension, this program will  */
  853. /*                  use the instructions up to the ";" in order to compile */
  854. /*                  the current file being edited.  In this case           */
  855. /*                  "cl -c -AL -W3 ".  In all cases a space and ";" must   */
  856. /*                  follow the command instruction.  The currently         */
  857. /*                  supported extensions are:                              */
  858. /*                  .m - for ME macros (I use .MAC as an extension for     */
  859. /*                       all macros).                                      */
  860. /*                  .c - for the 'C' language.                             */
  861. /*                  .asm - for assembly language (.asm)                    */
  862. /*         2.  The error messages generated by the compiler as assumed to  */
  863. /*             be in the following format:                                 */
  864. /*                  test.asm(124): error A2009: description                */
  865. /*             This is necessary in order to consistently determine the    */
  866. /*             line number on which the error exists.  In the above case   */
  867. /*             the line "124" is being reported as an error.               */
  868. /*         3.  Currently this program is activated with the use of two     */
  869. /*             hot-keys:                                                   */
  870. /*                   CTRL_C - This key causes the current file to be       */
  871. /*                            compiled, and the errors are placed in a     */
  872. /*                            file with the same file name, but with an    */
  873. /*                            extension of ".err".  After the file has     */
  874. /*                            been compiled, the first error, if there     */
  875. /*                            was one, is displayed at the bottom of the   */
  876. /*                            display.  This program automatically places  */
  877. /*                            the cursor on the reported line number to    */
  878. /*                            facilitate quick editing.                    */
  879. /*                   CTRL_N - This key causes all subsequent errors to be  */
  880. /*                            displayed on the screen, and the cursor      */
  881. /*                            moves to the offending line number for your  */
  882. /*                            editing.                                     */
  883. /*                                                                         */
  884. /*                                                                         */
  885. /* Created by Marc Adler of Magma Systems                                  */
  886. /* Modifications and cleanup performed by Marc Adler and Jon Herbold.      */
  887. /*                                                                         */
  888. /***************************************************************************/
  889.  
  890.