home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PRINT / PRNF245.ZIP / TERS143B.EXE / TERSE.DOC < prev    next >
Text File  |  1993-07-29  |  42KB  |  935 lines

  1.                                 "You can never be too rich, too thin, or
  2.                                     have too much RAM and Disk  storage."
  3.  
  4.                                       Ancient American proverb, ca. 1980
  5.                                         (As quoted by the QEDIT manual.)
  6.  
  7.          /--------------------\
  8.          | TERSE Version 1.43 |
  9.          \--------------------/
  10.  
  11.           Tiny ``BRIEF''-like editor by
  12.           Joseph (Yossi) Gil.
  13.  
  14. TERSE is a tiny (only 4096 bytes) but amazingly powerful full-screen
  15. editor for files of up to 64K in length.  TERSE runs on all PC compatible
  16. machines.  Its command keys are very similar to those of the famous
  17. BRIEF editor (by UnderWare Inc.).  TERSE can edit both UNIX and MS-DOS
  18. style text files as well as binary files.  No hacker's disk is complete
  19. without it.  No disk, be it hard or floppy, is too full to include it.
  20.  
  21. TERSE is free (but copyrighted) to private users.  If you are a private
  22. user who uses TERSE "for pleasure", you are not required to register.
  23. However, if you use TERSE for any commercial application, i.e., in
  24. your company, at work, etc., or make money from selling software or
  25. distributing shareware, you are *required* to register your copy of TERSE.
  26. Registration cost is only $15 and buys you a personalized version, and
  27. grant your institution a site license.  Yes, this is correct, the whole
  28. site such as a university with all its PCs, need only register once.
  29. For an additional payment of only $5, you get the source code of TERSE.
  30.  
  31.  
  32. Highlights
  33. ==========
  34.  
  35.  o  Very small: fits in 4096 bytes = 4 clusters on 5.25"/3.5" floppies.
  36.  o  Minimal free memory requirements: 137KB.
  37.  o  Uses current screen size, including the most common 80x25 screen
  38.     dimensions but also unusual sizes such as 40x16, 40x25, 40x40,
  39.     40x50, 132x25, 132x43, 96x33, 80x30, 80x33, etc.
  40.  o  Fully DESQview (version 2.0 and above) aware.
  41.  o  Edit binary files. TERSE is ideal for a quick and dirty job
  42.     of editing and patching strings in small programs. 
  43.  o  Supports editing of UNIX style files (lines terminated with '\n').
  44.  o  Supports both '/' and '\' as directory separator.
  45.  o  Edit lines of unlimited length (limited only by file size).
  46.  o  Automatic unlimited horizontal scrolling.
  47.  o  BRIEF-like keyboard configuration.
  48.  o  Support for TABS, and configurable tab positions.
  49.  o  Prevents snow when run on a CGA screen.
  50.  o  CUT, COPY and PASTE
  51.  o  SEARCH, SEARCH again, and TRANSLATE commands.
  52.  o  Safe: confirm exits when text is not saved.
  53.  o  Edit files whose name contains spaces and other weird names.
  54.  o  Extended version (the SLIM editor) of size ~5k with many more
  55.     features, including support (via external filters) for word count, 
  56.     sorting, charcter codes translations, quoting, tab expansion and
  57.     unexapnsion, and other complex editing tasks.
  58.  o  Status line indicating: current column, current line, horizontal
  59.     scrolling, total number of lines, file name, modified status,
  60.     insert/overwrite status, the current offset in file and total file size 
  61.     in bytes are dispalyed in the status line. The extended version 
  62.     also displays the HeX value of the current char.
  63.  
  64.  
  65. Requirements
  66. =============
  67.  
  68.  o  PC-DOS/MS-DOS version 2.0 or higher
  69.  o  137KB free memory
  70.  o  64KB free disk space
  71.  
  72.  
  73.  
  74.  
  75. Problems, Questions, Suggestions?
  76. =================================
  77.  
  78. Please do not hesitate to communicate all your thoughts and comments.
  79. I answer all my E-mail usually in less than 24 hours.  If you do not
  80. get a response within a reasonable time, it is probably because I didn't
  81. get your message, or because I wasn't able to reply.  Kindly try sending
  82. again using another route, and include more alternate return paths.
  83.  
  84. Any comments you may care to make are valuable to me.  The editors and
  85. the included software would not have been what they are today without
  86. all of the generous aid users provided: requests, complaints, thoughts
  87. and even gripe are always welcomed.
  88.  
  89.  
  90. Compatibility
  91. =============
  92.  
  93. TERSE uses only pure 8088 instructions and assumes the bare minimum
  94. of the underlying operating system.  It should run on your good
  95. old original 4Mhz IBM-PC running under DOS 2.0 as well as on a fast
  96. 80486 50Mhz machines running DR DOS 6.0 + 4DOS 4.0, or OS/2 in DOS
  97. compatibility mode.  More than once during the development, I had a
  98. chance to save a few bytes by using a more advanced instruction, or
  99. by assuming a more advanced operating system version.  I managed to
  100. resist this temptation.  Other than that every dirty assembly trick I
  101. could think of was used.  It is conceivable that some of the tricks
  102. could prevent TERSE from running on some DOS-like environments and
  103. simulators, although I don't know of any concrete example.
  104.  
  105.  
  106. UNIX style files
  107. ================
  108.  
  109. TERSE edits UNIX style files directly.  That is, TERSE uses
  110. both '\n' (aka LF, aka Line-Feed) and a '\r\n' (aka CRLF, aka
  111. Carriage-return + Line-feed) combo for line ends.  Hitting ENTER
  112. puts '\r\n' into the file, and Ctrl-ENTER puts '\n'.  (Configuration 
  113. utilities allow swapping these 2 keys.)  Thus, you can transfer UNIX 
  114. text files to your PC, edit them on the PC, and then transfer them 
  115. back without need for file conversion.
  116.  
  117.  
  118. Binary files editing
  119. ====================
  120.  
  121. TERSE can edit binary files as well.  To aid in this task, the
  122. status line displays the file size in bytes and the current offset
  123. in bytes in the file. The status line of the SLIM editor displays
  124. the hexadecimal value of the current char.  (This feature may be
  125. added in the future, space permitting to TERSE.)  A difficulty in
  126. editing binary files is that the following characters: space (ASCII 32), 
  127. Null (ASCII 0), and Meta-Del (ASCII 255) all look the same.  If you have
  128. an EGA or VGA screen you may want to use the font loaders WITHFONT or 
  129. LOADFONT together with the binary editing font and circumvent
  130. this difficulty.
  131.  
  132.  
  133. Configuration Utilities
  134. =======================
  135.  
  136. The configuration utilities allow you to: swap the Enter and
  137. Ctrl-Enter keys, change the tab size to 2/4/8/16 (I personally prefer
  138. tabs set every 4 characters), and modify the key assignments (with
  139. some minor restrictions).  In addition, you can eliminate the snow
  140. check done automatically on CGA screens, and you get better support
  141. (as described above) for editing binary files on EGA/VGA screens.
  142.  
  143.  
  144. Future
  145. ======
  146.  
  147. The main constraint in adding features to TERSE is that its total
  148. size must be exactly 4096 bytes.  All additions are dependent on my
  149. ability to squeeze the current code further.  I usually work several
  150. hours, and sometimes days, for each byte squeezed.  And this task is
  151. getting harder and harder all the time.  (A few versions had a slack
  152. of very few bytes.  In these versions, a few dummy bytes were appended
  153. to the program to keep its size 4096 bytes exactly.)
  154.  
  155. I have several other possible directions for the development of TERSE.
  156. These directions are: ``the TERSE family'' and ``the TERSE library''.
  157. I am looking forward to hearing from _you_, the user, about what you
  158. think of these ideas.
  159.  
  160. The TERSE library is an object code library which could be invoked
  161. from a C program. The members of the TERSE family are:
  162.  
  163.     LEAN    A 3K file viewer.  This is basically TERSE without the
  164.             editing code.  Naturally, LEAN could never compete with the
  165.             excellent LIST utility of Vernon D. Buerg, and other
  166.             fine tiny file-listers.
  167.  
  168.     SLIM    An extended  TERSE version (at the 5K level) with some extra
  169.             features.  Some features for which I have received requests
  170.             and which have not yet been implemented are:
  171.  
  172.             o  Backward search.
  173.             o  Edit next file in command line.
  174.  
  175.  
  176. Files
  177. =====
  178. TERSE is distributed in two forms: the full distribution and an
  179. abridged version.  The full distribution consists of the following
  180. files: (files marked with * are missing in the abridged version.)
  181.  
  182. T.COM           The actual TERSE editor program.  No other files are
  183.                 necessary for proper operation of TERSE.
  184.  
  185. VER-HIST.DOC    Versions history.
  186.  
  187. DISCLAIM.DOC    Disclaimer of warranties.
  188.  
  189. TERSE.DOC       This file.  The documentation for the program. All the
  190.                 above .DOC files may be printed by:
  191.  
  192. PRINTDOC.BAT    A  batch file for printing the documentation of TERSE.
  193.  
  194. _DESC.BTM       A 4dos batch file for creating file name description
  195.                 for the above files.
  196.  
  197. L.COM*          A pre-release of the LEAN file lister.
  198.  
  199. S.COM*          A pre-release of the SLIM editor, an extended version of
  200.                 TERSE.
  201.  
  202. H.COM*          A pre-release of SLIM built especially for the HP 95lx
  203.                 palmtop computer.  You can use the configuration
  204.                 utilities to limit the file size to 32KB, thus reducing
  205.                 the memory requirements.  The help screen is minimized to
  206.                 16x40 chars.  The program has special code for detecting
  207.                 the  HP9LX,  and if one is detected, only the top left
  208.                 16x40 part of the virtual screen is used.
  209.  
  210. TCONFIG.COM*    Configuration program for T.COM.
  211.  
  212. SCONFIG.COM*    Configuration program for S.COM.
  213.  
  214. LCONFIG.COM*    Configuration program for L.COM.
  215.  
  216. HCONFIG.COM*    Configuration program for H.COM.
  217.  
  218. TKEYS.COM*      Keyboard configuration program for T.COM.
  219.  
  220. SKEYS.COM*      Keyboard configuration program for S.COM.
  221.  
  222. SKEYS.COM*      Keyboard configuration program for H.COM.
  223.  
  224. MXIFY.COM*      A pre-release of a program which gives TERSE and its
  225.                 partners an EMACS style. Usage is:
  226.  
  227.                     MXIFY T filename
  228.  
  229. BIGC.COM*       A program to set a big cursor (Useful on PALMTOPS.)
  230.  
  231. LITC.COM*       A program to set a little cursor (Useful on PALMTOPS.)
  232.  
  233. ESC.COM*        A program to send ESCAPE characters.  Examples of usage
  234.                 are:
  235.  
  236.                  ESC [7m
  237.                  ESC 0 > prn
  238.  
  239. ROT13.COM*      A "rotate 13" filter.
  240.  
  241. LF.COM*         Filter.  DOS to UNIX text file translation program.
  242.                 Run 'lf -h' to see a manual page.
  243.  
  244. CRLF.COM*       Filter.  UNIX to DOS text file translation program.
  245.                 Run 'crlf -h' to see a manual page.
  246.  
  247. CAT.COM*        Filter.  Concatenate files. Like UNIX cat.
  248.  
  249. QUOTE.COM*      Filter.  Quote text by prepending '> ' to lines
  250.  
  251. WC.COM*         Filter.  Count lines, words, chars.  Like UNIX wc.
  252.  
  253. UUDECODE.COM*   Filter. A program to convert uudecoded files back 
  254.                 to binary. Like UNIX uuedecode
  255.  
  256. EXPAND.COM*     UNIX-like filter. Expand tabs into spaces. 
  257.                 Run 'expand -h' to see a manual page.
  258.  
  259. UNEXPAND.COM*   UNIX-like filter. Compress spaces into tabs
  260.                 Run 'unexpand -h' to see a manual page.
  261.  
  262. FOLD.COM*       UNIX-like filter. Fold long lines for finite width 
  263.                 output device. Run 'fold -h' to see a manual page.
  264.  
  265. TT.BAT*         Call terse on multiple files/wildecards
  266.  
  267. TTALIAS.BTM*    Demo: make 4DOS aliases for terse
  268.  
  269. NFMT.EXE*       UNIX fmt-like formatter. NFMT is a simple text 
  270.                 formatter, which is very similar to the BSD program
  271.                 fmt(1).  However NFMT uses a best-fit line breaking
  272.                 algorithm, by a simple version of "Breaking Paragraphs
  273.                 into Lines", Donald E. Knuth and Michael F. Plass,
  274.                 "Software--Practice and Experience" 11 (1981)
  275.                 1119-1184.  Author: Ross Paterson <rap@doc.ic.ac.uk>,
  276.                 porting to Turbo-C by Yossi Gil <yogi@cs.ubc.ca>.
  277.                 Run nfmt -h to get it help screen.
  278.  
  279. NFMT.HLP*       Help screen extracted from NFMT.EXE
  280.  
  281. How to obtain TERSE
  282. ===================
  283.  
  284. TERSE is available from Simtel, Garbo, Wustl, their mirrors and from
  285. other fine ftp archive sites.  Some of these sites have mail-servers
  286. for those who do not have access to ftp.  Some of these sites carry
  287. only the abridged distribution.
  288.  
  289. In addition, the latest version of TERSE is regularly deposited in
  290.  
  291.     cs.ubc.ca: /pub/pickup/terse/trsXXX[af].zip
  292.     wuarchive.wustl.edu: /pub/MSDOS_UPLOADS/trsXXX[af].zip
  293.  
  294. Where XXX denotes the three digit version number. For example,
  295. the full distribution of version 1.42 should be in a file named
  296. trs142f.zip.
  297.  
  298. If you are experiencing problems downloading these files (cs.ubc.ca is
  299. picky for no real reason sometimes), or if you don't have FTP access,
  300. please drop me a line and I will e-mail to you whichever distribution
  301. you are interested in.  The full distribution is sent out in 6 parts of
  302. about 1000 uuencoded lines each.  The abridged distribution (basically
  303. just the TERSE editor and the manual) goes in one part of about 600
  304. uuencoded lines.  You can use the UUDECODE.COM program enclosed with
  305. this archive to decode this mail.
  306.  
  307.  
  308. License (copying policy)
  309. ========================
  310.  
  311. The following policy is intended to promote free private use and
  312. distribution, and to collect money from those who can afford to pay
  313. for this software.  In particular, those institutions which make money
  314. from private users are requested to pass on part of their income to
  315. whoever is responsible for generating it.
  316.  
  317. PRIVATE USERS:  You are free to use, copy and distribute TERSE for
  318. noncommercial private use provided that:
  319.  
  320.    A) No fee is charged for use, copying or distribution.
  321.  
  322.    B) It is not modified in any way.
  323.  
  324.    C) It is distributed as a package.  All files in this package must be
  325.    included, none should be added, and none should be changed.
  326.  
  327. Thus if you are a private user, you can *use* TERSE freely, and you
  328. are under no obligation to register.  (The only restriction is on its
  329. further distribution.)
  330.  
  331.  
  332.  
  333. Registration (Private users)
  334. ============================
  335.  
  336. If you find TERSE a useful, easy, and nifty editor please show your
  337. appreciation:-
  338.  
  339.       Send the author the $15 US dollars registration fee.
  340.       Upon receiving your payment, I will send you
  341.       TERSE, the configuration utilities and, if you wish, a per-
  342.       sonalized version, and the author will do his best to update
  343.       them as soon as a new version comes out.
  344.  
  345.       Please, do register if you can afford it, and if you would
  346.       like to support financially the production of this high quality
  347.       software.
  348.  
  349.  
  350. NON_PRIVATE USE:  Institutions and companies MUST register this package
  351. after an evaluation period of 21 days.  Registration of one copy per
  352. company site is sufficient.
  353.  
  354. NON-PRIVATE DISTRIBUTION (Shareware distributors):  You may distribute
  355. this package as long as no more than a nominal fee (up to $10) per
  356. disk is collected per disk.
  357.  
  358. NON-FEE DISTRIBUTION: Simtel/ Garbo/ other FTP collections: Obviously,
  359. you may store this package and offer it to your users free of any
  360. restrictions.
  361.  
  362.  
  363. Author's Address
  364. ================
  365. E-mail: (try addresses in this order)
  366.  
  367.     yogi@cs.ubc.ca          (University of British Columbia, Vancouver, 
  368.                              British Columbia, Canada),
  369.     yogi@umiacs.umd.edu     (University of Maryland, Maryland, USA)
  370.     yogi@cs.technion.ac.il  (Technion -- Israel's institute of technology, 
  371.                              Haifa, Israel),
  372.  
  373. North  America mailing address (until October 1st 1992):
  374.     1418 Park Drive, Vancouver,  B.C. V6P  2K7,  Canada.
  375.  
  376. Permanent mailing address  is:
  377.     Joseph  Gil,
  378.     P.O. Box 3148,
  379.     Jerusalem,
  380.     Israel.
  381.  
  382. Hebrew mailing address (you cannot read the following unless your
  383. screen adapter can display Hebrew characters):
  384.                                                              îëé ëæàë
  385.                                                             3148 .â.Ü
  386.                                                               ìëîÖàÿë
  387.  
  388.  
  389. Genealogy
  390. =========
  391.  
  392. TERSE is an exercise of editor writing inspired by TED, the famous
  393. Tiny EDitor (written by Tom Kihlken and published November 1988 in PC
  394. Magazine, Copyright 1988 Ziff Communications Co.).  Some features of
  395. TERSE are borrowed from the fine descendants of TED called TEDPLUS
  396. (apparently also written by Tom Kihlken in November 1988) and TED2
  397. (written by James E. Galbraith, 1201 Chase St., Novato CA, 94945, USA).
  398.  
  399. There is not a single piece of code in TERSE which is the same as in
  400. TED, TEDPLUS or TED2.  TERSE represents almost three years of work on
  401. space optimization of the code, and on added functionality.  Some of the
  402. newly added features include help screen, unlimited line length, space
  403. optimization of the code, and on added functionality.  Some of the newly
  404. added features include the help screen, unlimited line length, status
  405. line, smooth horizontal scrolling, previous and next word, UNIX files
  406. editing, search and replace, safety features and support for insertion
  407. of all 256 characters of the IBM-PC extended ASCII set (including <Nul>,
  408. <BS>, <CR>, and <LF>).  Some old features include scrolling, cut, copy,
  409. paste, and printing operations.
  410.  
  411. Some of the documentation for TERSE is based on the documentation
  412. provided with TED2.  See the article "The tiniest editor you'll ever
  413. need" by Tom Kihlken, in the November 15, 1988 issue of PC Magazine
  414. for further details concerning TED. TED, TEDPLUS and TED2 are
  415. available from SIMTEL20:
  416.  
  417.     TED         PD1:<MSDOS.PCMAG>VOL7N19.ARC
  418.     TEDPLUS     PD1:<MSDOS.EDITOR>TEDPLUS.ARC
  419.     TED2        PD1:<MSDOS.EDITOR>TED2.ZIP
  420.  
  421. TERSE is not related in any way to TED3.
  422.  
  423.  
  424.  
  425. DESCRIPTION
  426. ===========
  427.  
  428. Synopsis
  429.                                t [filename]
  430.  
  431. To invoke  TERSE, just type  "T" from the  DOS command line,  optionally
  432. followed by a filename.
  433.  
  434. File
  435. ----
  436. TERSE opens and reads a file whose name (and path, if required) is
  437. initially supplied on the command line.  If no file name is provided,
  438. TERSE opens a new file.  A name may be supplied later during the
  439. editing session using the "Output" command invoked by <Alt-O>.
  440. TERSE expects a legal DOS filename, which may include a path name.
  441. TERSE can also edit files whose names contain spaces.  These names
  442. are legal, although most DOS commands cannot manipulate them.
  443.  
  444. While editing, you can save your work by pressing <Alt-W>.  Upon save, 
  445. the original of the modified file is saved with the extension .BAK. 
  446. To exit the editor and save your work press <Alt-X>.  
  447.  
  448. To exit the editor without saving changes made to the file press 
  449. <Alt-Q>. Hitting <Alt-Q> causes the TERSE to exit immediately
  450. if the file was not modified since last saved. Otherwise, TERSE
  451. presents the following prompt:
  452.  
  453.     Lose changes (Y/N)?_
  454.  
  455. Hit 'Y' only if you are certain that you don't want recent changes to
  456. be saved.
  457.  
  458.  
  459. Basic Editing
  460. -------------
  461. A help screen is available upon pressing <F1> or <Alt-H>.  When the help
  462. screen is displayed, pressing any key returns you to the text.
  463.  
  464. In TERSE, the cursor movement keys (Left, Right, Up, Down, PgUp, PgDn,
  465. etc.) allow you to move around in the text.  Text is entered in insert
  466. mode by default.  Text can be deleted using the <Del> and <BackSpace>
  467. keys.
  468.  
  469. Pressing the <Alt-I> key will toggle between Insert and Overstrike mode.
  470. The Insert/Overwrite state is displayed by an 'Ins' or 'Ovr' in the
  471. status line.
  472.  
  473. Text can be deleted using the <Del> and <BackSpace> keys.
  474.  
  475. The <Alt-U> key restores up to 255 characters deleted by the <Del> key or
  476. overwritten while in the Overwrite mode.  The <Alt-U> key only restores
  477. the last character deleted with the <Backspace> key.
  478.  
  479. TERSE text buffer is limited to 65535 characters.  An attempt to extend
  480. the buffer beyond that results in a short beep.
  481.  
  482.  
  483. Lines
  484. -----
  485. Lines may be of any length.  TERSE recognizes both the UNIX and DOS
  486. conventions for line termination, i.e., both the <CR><LF> pair and a
  487. single <LF> denote end of line.  Off screen characters may be viewed by
  488. moving the cursor toward them.  Lines may be broken by pressing <Enter>
  489. (insert <CR><LF> pair) or <Ctrl Enter> (insert <LF> character) at
  490. any point, in either Insert or Overstrike mode.  Lines may be joined
  491. by pressing <Del> at the line end or <Backspace> at the beginning.
  492. Pressing <Alt-D> deletes the entire line and closes the gap.  Pressing
  493. <Alt-K> deletes from the cursor position to the end of the present
  494. line.  Pressing <Alt-G> restores the most recent line deletion.
  495. The line delete buffer remains intact until another line is deleted.
  496. The line delete buffer has room for 255 characters.
  497.  
  498. Block
  499. -----
  500. A Block is some portion of the text file which has been specifically
  501. delineated for later manipulation.  One end of a "block" of text is
  502. defined by hitting <Alt-A> key (anchor drop/raise).  The other end of
  503. the block is where the cursor is located.  Move the cursor with the
  504. cursor control keys to the block end.  As you move the cursor, note
  505. that the blocked area is shown in reverse video.  The <Alt-A> is a
  506. toggle key, so hitting it again raises the anchor dropped at the
  507. block end, and thus cancel the blocking operation.
  508.  
  509. Pressing the <Keypad-> key (keypad grey minus key) removes the block
  510. to a paste buffer; this operation is known as "Cut". The <Keypad+>
  511. key (keypad grey plus) copies the block to the paste buffer without
  512. removing it from the text; this operation is known as "Copy". The <Ins>
  513. key copies the text stored in the paste buffer at any point where the
  514. cursor is located; this operation is known a "Paste". The paste buffer
  515. remains intact until another section is marked and cut or copied.
  516. The paste buffer has room for 64K bytes.
  517.  
  518. When a block is marked, pressing <Alt-P> prints the marked text (directly
  519. from the file buffer).  After the print, the block remains marked.
  520.  
  521.  
  522. Search and Replace
  523. ------------------
  524. TERSE has a string "Search" and "Next" functions.  When the <Alt-S>
  525. key is pressed, the prompt "Search for: " appears on the bottom line.
  526. Enter the desired text string and press the <ENTER> key.  If the
  527. string is found, it appears blinking in inverse video on the screen.
  528. The blinking inverse video is extinguished when any key is pressed.
  529. If the string is not found in the area following the cursor, a short
  530. beep sounds. To search for the next occurrence of the string,
  531. press <Alt-N>.  TERSE cannot search backward, and it doesn't recognize
  532. regular expressions.
  533.  
  534. TERSE also has a "Translate" function which is invoked by pressing
  535. the <Alt-T> key.  You are prompted for the string to search for,
  536. and then for the replacement string.  The "translate" function is
  537. best explained by an example.  To change all occurrences of the simple
  538. "wrong" in your file into something more institutionally acceptable,
  539. you would move to the beginning of the file (Press <Ctrl-PgUp>) and
  540. then press <Alt-T>.  TERSE erases the status line (the last screen
  541. line) and displays in its place a prompt:
  542.  
  543.             Search for: _
  544.  
  545. (The underscore in the above indicates the cursor position).  Type in
  546. the word: "wrong".  The <BackSpace> key can be used for erasing the
  547. previous character.  The last line should now read:
  548.  
  549.             Search for: wrong_
  550.  
  551. Hit <Enter>.  (Hitting <ESC> at this stage ends the translate 
  552. operation.) TERSE now prompts you for the replacement string in the
  553. last screen line:
  554.  
  555.             Replace with: _
  556.  
  557. Type in, say, "policy directive inconsistent".  (You can use up to 30 
  558. characters.)  The last screen line now reads:
  559.  
  560.             Replace with: policy directive inconsistent_
  561.  
  562. Hit <Enter>. (Again, hitting <ESC> at this stage ends the translate 
  563. operation.)  TERSE searches for the first occurrence of "wrong" in your
  564. file, moves the cursor to this point, displays "wrong" in blinking
  565. inverse video, and then prompts you in the last screen line:
  566.  
  567.             Replace with: policy directive inconsistent [Yes/No/All]?
  568.  
  569. Your response could be to hit 'Y' or 'y', which means Yes, make this 
  570. replacement; or 'N' or 'n' which means No, do not make this replacement. 
  571. In both cases, TERSE continues by moving to the next occurrence of the 
  572. string "wrong" and prompts you again. You may also answer the prompt by 
  573. hitting <Esc>, which aborts the translate operation. If you wish to 
  574. replace unconditionally all occurrences of the string "wrong" with "policy 
  575. directive inconsistent" (be warned that it may take a considerable time 
  576. for a long file), respond with 'A' or 'a'. TERSE marches through the 
  577. file and makes these replacements for you. 
  578.  
  579. Search and Search - Replace are by default case insensitive.  This means
  580. that the search catches all of the following strings: wrong, Wrong, WRONG
  581. wrOng, etc.  Pressing <Alt-C> changes both Search and Search - Replace
  582. to be case sensitive. Pressing <Alt-C> again returns you to the case
  583. insensitive Search and Search - Replace.  Note that a short message
  584. appears in the status line whenever case sensitivity is toggled.  This
  585. message is erased, and the normal status line reappears, when you go on
  586. with your work.
  587.  
  588. Character Set and Binary file editing
  589. --------------------------------------
  590. Any of the characters in the IBM extended ASCII set can be entered
  591. and manipulated by TERSE.  To enter control characters (ASCII 00-31
  592. and 127), use <Ctrl-@>, <Ctrl-A>, ... , <Ctrl-Z>, <Ctrl-[>, <Ctrl-\>,
  593. <Ctrl-]>, <Ctrl-^>, <Ctrl-_> and <Ctrl-Backspace>.  A more general
  594. method is to press the Alt key and, without releasing it, type a
  595. character ASCII decimal value on the numeric keypad.  The PC-BIOS
  596. does not support entry of the <Nul> character (00h) in this fashion.
  597. Instead, you may enter the <Nul> character by hitting the <Ctrl @> key.
  598.  
  599. The ASCII Backspace (BS) code can be entered as <Ctrl-H>, and the
  600. <Backspace> key deletes the character to the left of the cursor.
  601. Similarly, ASCII Carriage-Return (CR) and Line-Feed (LF) character
  602. codes can be entered directly as <Ctrl-M> and <Ctrl-J>.  TERSE
  603. interprets the <LF> character as an end-of-line.  A <CR> is considered
  604. an ordinary text character except when it is immediately followed by
  605. an <LF>, in which case it is considered part of the end-of-line marker.
  606. If <CR><LF> are entered together, or ever become adjacent, they cannot
  607. be separated.  The <Enter> key inserts an end-of-line marker (CR)(LF).
  608.  
  609. TERSE does not use the CP/M style End-of-file marker, <Ctrl-Z>, to
  610. indicate the last character in a text file.  If a <Ctrl-Z> character
  611. appears in the file, it is shown as is.
  612.  
  613. The Screen
  614. -----------
  615. TERSE configures itself to the display adapter in use, and supports
  616. text modes other than the standard 80 columns by 25 rows, e.g., EGA
  617. 43 lines and CGA 40 columns mode.  <PgUp> and <PgDn> scroll the file
  618. by the number of rows displayed.  TERSE does not work properly if the
  619. screen is initially in a graphics mode.
  620.  
  621. TERSE does not alter screen attributes or colors.  Inverse video is used
  622. in the status line and to indicate a MARKed block.  TERSE uses blinking
  623. inverse video to indicate that the search string has been found.
  624. It automatically handles "de-snow" on a CGA display.
  625.  
  626. Because TERSE makes BIOS calls and writes directly to the screen
  627. buffer, it would probably not work properly on MS-DOS computers that
  628. are not sufficiently IBM-PC compatible.
  629.  
  630. The Status Line
  631. ---------------
  632. At the bottom of the editing screen is the Status Line.  The Status
  633. Line constantly displays information regarding the file you are
  634. currently editing.  The Status Line is shown below with a description
  635. of the information displayed.
  636.  
  637. +--------------------------------------------------------------------------+
  638. :F1 Help | Line 137  Col 25    =282  +0  @893  #10324 Ins letter.doc*      :
  639. +---+----------+--------+-------+-----+---+------+-----+-----+------+------+
  640.     :          :        :       :     :   :      :     :     : File modified
  641.     :          :        :       :     :   :      :     :     : since last
  642.     :          :  The current   :     :   :      :     :     : written
  643.     :          :  cursor column :     :   :      :     :     :
  644.     :          :  number        :     :   :      :     : The name of file
  645.     :          :                :     :   :      :     : you are editing
  646.     :     The current           :     :   :      :     :
  647.     :     cursor line           :     :   :      :     +Insert mode is ON
  648.     :     number                :     :   :      :
  649.     :                           :     :   :      +File length in characters
  650.  A reminder that                :     :   :
  651.  Help screen is                 :     :   +Current offset in file
  652.  available upon                 :     :
  653.  pressing the                   :     +The number of columns scrolled off
  654.  <F1> key                       :       to the left of the screen
  655.                                 :
  656.                                 +The total number of lines in the file
  657.  
  658.  
  659. ┌──────────────────────────────────────────────────────────────────────────────┐
  660. │F1 Help | Line 137   Col 25    =282  +0    @893   #10324 Ins letter.doc*      │
  661. └───┬──────────┬─────────┬───────┬─────┬─────┬───────┬─────┬─────┬──────┬──────┘
  662.     │          │         │       │     │     │       │     │     │ File modified
  663.     │          │         │       │     │     │       │     │     │ since last
  664.     │          │   The current   │     │     │       │     │     │ written
  665.     │          │   cursor column │     │     │       │     │     │
  666.     │          │   number        │     │     │       │     │ The name of file
  667.     │          │                 │     │     │       │     │ you are editing
  668.     │     The current            │     │     │       │     │
  669.     │     cursor line            │     │     │       │     └Insert mode is ON
  670.     │     number                 │     │     │       │
  671.     │                            │     │     │       └File length in characters
  672.  A reminder that                 │     │     │
  673.  Help screen is                  │     │     └Current offset in file
  674.  available upon                  │     │
  675.  pressing the                    │     └The number of columns scrolled off to
  676.  <F1> key                        │       to the left of the screen
  677.                                  │
  678.                                  └The total number of lines in the file
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685. ADVANCED FEATURES
  686. =================
  687.  
  688.  
  689. Word wrap
  690. ---------
  691. SLIM can do automatic word wrap as you type.  Upon pressing <Alt-M>,
  692. SLIM prompts you for a right margin:
  693.  
  694.       Margin:_ 
  695.  
  696. Type in your preferred right margin setting (72 is pretty common and
  697. useful selection).  If a right margin is set, then whenever you finish
  698. typing a word (i.e., when you hit a <Space> or <Tab> key) SLIM checks
  699. if this margin was exceeded, and if so, the last word typed is wrapped
  700. to the next line.
  701.  
  702. If the right margin is set to 0, then word wrapping is disabled will
  703. occur.  By default, the right margin is 0. This default can be changed 
  704. with the SCONFIG configuration program.
  705.  
  706.  
  707. Swap Cursor and Mark
  708. --------------------
  709. An easy way to go to the begining or the end of a marked block the "Swap
  710. Cursor and Mark" command.  Upon pressing <Shift-Tab>, the cursor position
  711. is swapped with mark position.
  712.  
  713.  
  714. Exchange Marked Block with Paste Buffer
  715. ---------------------------------------
  716. Many users are familiar with the CUT/COPY/PASTE paradigm for manipulating
  717. chunks of texts.  In TERSE you block a piece of text by dropping a mark
  718. (<Alt-A> key) at its beginning and then moving the cursor to its end.
  719. You can then COPY (keypad +> key) the blocked text to a paste buffer,
  720. or CUT (<Keypad+> key) it to the paste buffer.  Later, you can move to
  721. a different location and PASTE the text, i.e., insert the text in the
  722. paste buffer.
  723.  
  724. SLIM adds to these three basic operations yet another one: "Exchange
  725. Marked Block with Paste Buffer", or for short EXCHANGE.  By default, this
  726. command is bound to <Keypad*> key (keypad grey asterisk).  Upon pressing
  727. this key, the contents of the currently marked block is exchanged with
  728. the current contents of the paste buffer.  Hitting <Keypad*> again
  729. effectively undoes this operation.
  730.  
  731. The EXCHANGE operation should come in handy in situations where you
  732. need to shuffle a lot text around.  An important application of this
  733. operation is discussed next.
  734.  
  735.  
  736. Pump Block Through Filter
  737. -------------------------
  738. The term "filter" is borrowed from UNIX.  It refers to a program, which
  739. takes input from the standard input, processes it, and then produces
  740. output to the standard output.  Several filters are supplied with the
  741. full distribution.  For example, the WC filter produces to the standard
  742. ouptut a count of the number of lines, words and characters in the
  743. standard input.
  744.  
  745. The "pump block through filter" command, by default bound to the
  746. <Alt-F> key, runs a filter while supplying the currently marked block
  747. as input to the block and capturing the filter's output.  When the
  748. filter finishes, its output will show as the currently marked block.
  749. The previous contents of the marked block are moved to the paste buffer.
  750. By pressing <Keypad*> you can exchange the contents of the block and of
  751. the paste buffer, effectively undoing the filter operation.
  752.  
  753. Thus, to count the number of words in a document, follow these
  754. easy steps:
  755.  
  756.       1. Hit <Ctrl-PgUp> to move to the top of the file.
  757.       2. Hit <Alt-A> to drop an anchor.
  758.       3. Hit <Ctrl-PgDn> to go to the end of the file. The whole
  759.          file should be marked now.
  760.       4. Hit <Alt-F> to invoke the "pump block through filter" command.
  761.          Upon doing so, SLIM prompts you for the name of the filter
  762.  
  763.              Filter: _
  764.  
  765.       5. Type in 'wc -w' and hit <Enter>. (The -w flag tells WC.COM
  766.          to produce word count only)
  767.       6. The number of words in the document now shows, while the document
  768.          itself is erased.
  769.       7. Hit <Keypad*> to restore the documents contents, and erase the
  770.          word count. Later you can hit <Ins> to paste the word count
  771.          wherever you may need it.
  772.  
  773. The full distribution includes also the nfmt filter, which reformats
  774. text using smart line breaking algorithm.  All of TERSE documentation
  775. was formatted using this filter.  To reformat a piece of text, I simply
  776. mark it (usually the whole paragraph), and invoke the nfmt filter.  Some
  777. other filter included with the full distribution are the DOS equivalents
  778. of the some famous UNIX filters: EXPAND, UNEXPAND, UUDECODE, and CAT.
  779. The QUOTE filter is useful in composing e-mail messages.  The ROT13
  780. filter allows you to decrypt and encrypt spoilers etc.
  781.  
  782. Many more new features can be easily added to SLIM by virtue of this
  783. command.  A few examples are: date and time stamping, sorting, column
  784. summation, character sets conversions, directory contents listings etc.
  785. Sophisticated users should probably get copy of a DOS port of the famous
  786. UNIX 'sed' and 'awk' filters, and harness their power to enhance SLIM.
  787.  
  788. The "pump block thru filter" command does not use temporary files,
  789. and can be run with even when the disk is full.  Programmers may enjoy
  790. contemplating how this little wonder was implemented.  (If you really
  791. cannot figure this out, write to me and ask for a clue...)
  792.  
  793. The "pump block thru filter" command does captures also the standard
  794. error of the executed filter.  You can thus run your favourite compiler
  795. from within SLIM.
  796.  
  797. Go to Line
  798. ----------
  799. If you use the "pump block thru filter" to invoke a compiler, you may
  800. find it useful to be able to find a line by its number.  To invoke the
  801. "go to line" command press <Alt-G>.  Upond doing so, SLIM presents the
  802. following prompt:
  803.  
  804.     Go to line: _
  805.  
  806. Type in the desired line number and hit <Enter>. 
  807.  
  808.  
  809. KEYBOARD SUMMARY
  810. =================
  811. The following is a description of all TERSE commands and their key
  812. binding.  To get a help screen with keyboard usage summary, hit <F1> or
  813. <Alt-H>.
  814.  
  815. Cursor movements
  816. -----------------
  817.  <Left Arrow>            Moves cursor left one column
  818.  <Right Arrow>           Moves cursor right one column
  819.  <Ctrl Left Arrow>       Moves cursor to the beginning of the next word.
  820.  <Ctrl Right Arrow>      Moves cursor to the beginning of previous word.
  821.  <Home>                  Moves cursor to start of line
  822.  <End>                   Moves cursor to end of line
  823.  <Up Arrow>              Moves cursor up one row
  824.  <Down Arrow>            Moves cursor down one row
  825.  <PgUp>                  Moves text window up one page
  826.  <PgDn>                  Moves text window down one page
  827.  <Ctrl PgUp>             Moves cursor to top of file
  828.  <Ctrl PgDn>             Moves cursor to bottom of file
  829.  
  830. Basic editing operations
  831. ------------------------
  832.  Any keyboard char       Insert/Overwrite character into file
  833.  <Tab>                   Insert tab character
  834.  <Enter>                 Start new line, add <CR><LF> pair to file.
  835.  <Backspace>             Delete character to left of cursor
  836.  <Del>                   Delete character under cursor (to right)
  837.  <Alt-U>                 Undo recent <Del> operation/Overwritten
  838.                          characters.
  839.  <Alt-I>                 Toggle between Insert/Overwrite mode (Ins/Ovr)
  840.  <Alt-K>                 Delete to end of line
  841.  <Alt-D>                 Delete current line
  842.  <Alt-Y>                 Restore deleted line (up to 255 characters)
  843.  
  844. Block Operations
  845. ----------------
  846.  <Alt-A>                 drop/raise Anchor.  Block is between anchor and
  847.                          cursor.
  848.  <Keypad-Plus>           Copy block to clipboard buffer
  849.  <Keypad-Minus>          Delete block to clipboard buffer
  850.  <Ins>                   Paste from clipboard buffer
  851.  <Alt-P>                 Print block.
  852.  
  853. Search
  854. ------
  855.  <Alt-S>                 Search for string
  856.  <Alt-C>                 Toggle search case sensitivity.
  857.  <Alt-N>                 Find next occurrence of string
  858.  <Alt-T>                 Search and Translate
  859.  
  860. File Operations
  861. ---------------
  862.  <Alt-Q>                 Quit edit: no-save exit (asks for confirmation)
  863.  <Alt-X>                 eXit and save: same as Quit if file name is unknown
  864.  <Alt-O>                 Change output file name.  Supply name if not given.
  865.  <Alt-W>                 Write  the  current  buffer  into  its  file  (if
  866.                          filename known)
  867.  <Alt-R>                 (in SLIM only) Read a file to buffer.
  868.  <Alt-E>                 (in SLIM only) Edit another file.
  869.  
  870. Scrolling
  871. ---------
  872.  <Alt-->                 Scroll window horizontally to the left
  873.  <Alt-+>                 Scroll window horizontally to the right
  874.  <Ctrl Home>             Scroll window up
  875.  <Ctrl End>              Scroll window down
  876.  
  877. Misc
  878. ----
  879.   <Alt-I>                Insert/Overwrite toggle.
  880.   <Alt-Z>                Push to dos.
  881.   F1                     Display the help screen.
  882.   <Alt-H>                Display the help screen.
  883.   <Alt-M>                (in SLIM only) Set right margin for word wrap.
  884.   <Alt-G>                (in SLIM only) Goto line.
  885.  
  886. Entering Special Characters
  887. ---------------------------
  888.  <Ctrl @>                Enter the [NUL] character
  889.  <Ctrl A>                Enter the [SOH] character
  890.  ...                     All ctrl characters can be inserted this way
  891.  ...                     Special control characters are described  below
  892.  <Ctrl C>                Enter the [ETX] character  (DOS abort disabled)
  893.  ...                     ...
  894.  <Ctrl H>                Enter the [BS] character
  895.  <Ctrl I>                Enter the [TAB] character
  896.  <Ctrl J>                Enter the [LF] character
  897.  ...                     ...
  898.  <Ctrl M>                Enter the [CR] character
  899.  ...                     ...
  900.  <Ctrl Z>                Enter the [SUB] character (No CP/M style EOF)
  901.  <Ctrl [>                Enter the [ESC] character
  902.  <Esc>                   Enter the [ESC] character
  903.  <Ctrl \>                Enter the [FS] character
  904.  <Ctrl ]>                Enter the [GS] character
  905.  <Ctrl ^>                Enter the [RS] character
  906.  <Ctrl _>                Enter the [US] character
  907.  <Ctrl Backspace>        Enter the [DEL] character
  908.  
  909.  
  910.  
  911. KNOWN BUGS AND FUTURE DIRECTIONS
  912. =================================
  913.     o     Horizontal scrolling does not move the cursor position, so by
  914.           pressing <Alt-+> and <Alt--> you can scroll to the right
  915.           or to the left but only to the extent which leaves
  916.           the current cursor position visible.  For example when the
  917.           cursor is in the left most column, no horizontal scrolling
  918.           is possible.  There are no plans for modifying this behavior
  919.           as the author feels that it is very reasonable.  Strong user
  920.           pressure may change this.
  921.  
  922.     o     <Alt-U> only restores the last character erased by
  923.           <Backspace>.  (Future plan is to push deleted characters (by
  924.           <DEL>, <Backspace> and overwritten characters) to a stack.
  925.           The stack will have limited depth, and as characters
  926.           are pushed in, old characters stored deeply in the stack
  927.           disappear.  The <Alt-U> will pop characters from the stack
  928.           and insert/append them.)
  929.  
  930.     o     Editing can get extremely slow if lines are excessively long.
  931.           Lines longer than 20,000 characters cause a noticeable
  932.           delay after every editing operation on these lines.
  933.  
  934.  
  935.