home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Pascal / TP.7_1 / TP / DOC / TEMC.DOC < prev    next >
Encoding:
Text File  |  1992-10-05  |  30.3 KB  |  702 lines

  1. ===========================================================================
  2. ===========================================================================
  3.  
  4.                              TEMC.DOC
  5.  
  6. ===========================================================================
  7. Turbo Editor macros
  8. ===========================================================================
  9.  
  10.           TEMC.EXE is an editor macro compiler for the IDE. It
  11.           processes a script file that defines editor macros and
  12.           key bindings, and produces a configuration file that is
  13.           read by the IDE to define the effects of keyboard
  14.           commands in the editor.
  15.  
  16.           The file DEFAULTS.TEM contains the default macro
  17.           definitions and key bindings built into the IDE editor.
  18.           It serves as an example script, as well as a base from
  19.           which to customize the editor. Several other .TEM files
  20.           are also provided for your convenience.
  21.  
  22. ===========================================================================
  23. TEMC command line
  24. ===========================================================================
  25.  
  26.           TEMC is invoked from the DOS command line. Type
  27.  
  28.               temc [-c] <script file>[.TEM] <config file><.TP>
  29.  
  30.           The script file extension is assumed to be .TEM if not
  31.           otherwise specified. The configuration file extension
  32.           must be .TP.
  33.  
  34.           The configuration file need not exist. If it does not
  35.           exist, it is created. The optional -c switch can also
  36.           be specified as /c, and can appear in any argument
  37.           position on the command line. If you use this option,
  38.           any existing command table in your configuration file
  39.           is thrown away before TEMC processes the script file.
  40.           When -c is not used, the key bindings in the script
  41.           file are merged with those already defined in the
  42.           configuration file.
  43.  
  44.           You can use DEFAULTS.TEM to re-create exactly the
  45.           default settings of the editor command set. This
  46.           file is included as both a sample script file and as
  47.           the default command table. You can copy it and modify
  48.           it for your own use.
  49.  
  50. ===========================================================================
  51. Syntax
  52. ===========================================================================
  53.  
  54.           The syntax to define a macro is
  55.  
  56.               MACRO <macroname>
  57.                 <command1>;
  58.                 [ <command2>; ... ]
  59.               END;
  60.  
  61.           <macroname> can consist of anything that is a legal C
  62.           symbol, and <command> can be either the name of another
  63.           predefined macro or a predefined TEMC editor command. A
  64.           list of editor commands and what they do follows.
  65.  
  66.           When you define your macro, the following points are
  67.           valid:
  68.  
  69.           1. A statement defines either a named macro or a key
  70.              binding.
  71.  
  72.           2. Spaces and new lines are optional.
  73.  
  74.           3. Comments are in C-style /* ... */ pairs.
  75.  
  76.           4. Unlike C, TEMC's language is case insensitive.
  77.  
  78.           5. Some of the predefined editor commands have a syntax
  79.              that looks like a C function call with one argument.
  80.              For example,
  81.  
  82.                  SetMark(5);
  83.  
  84.              Depending on the command, the argument is either a
  85.              decimal integer constant, a character constant, or a
  86.              string literal. All are specified using C syntax.
  87.  
  88.           Here's an example of a macro definition from
  89.           DEFAULTS.TEM:
  90.  
  91.               MACRO MacScrollUp
  92.                 ScrollScreenUp; FixCursorPos;
  93.               END;
  94.  
  95.           The syntax to define a key binding is
  96.  
  97.               <key-sequence>: <command>;
  98.  
  99.              or
  100.  
  101.               <key-sequence>: BEGIN <command1>; [ <command2>; ... ]
  102.               END;
  103.  
  104.           The <key-sequence> is either a key (a character
  105.           optionally preceded by Ctrl or Alt), or a series of
  106.           keys separated by a plus sign (+). Note that the
  107.           specification of the key characters themselves is case
  108.           sensitive. For example, Ctrl+k B is different than
  109.           Ctrl+k b, even though the latter is the same as Ctrl+K b.
  110.  
  111.           White space is allowed between the key-sequence and the
  112.           colon, and each <command> can be either the name of a
  113.           previously defined macro, or one of the predefined
  114.           editor commands listed in Table 1.1.
  115.  
  116. ===========================================================================
  117. Key codes
  118. ===========================================================================
  119.  
  120.           The IDE editor makes use of an extended character set
  121.           that includes key combinations not normally available
  122.           to DOS programs. Key codes can be specified in a script
  123.           through any combination of the symbols "Ctrl+", "Shift+",
  124.           "Alt+" and a character.
  125.  
  126.           Some keys cannot be entered directly into a TEMC
  127.           script. Those keys can be referred to by their names,
  128.           as described in the following table.
  129.  
  130.           Any key in a sequence--except the first key--can be
  131.           preceded by one of the characters ^ or @. The caret (^)
  132.           indicates that any combination of case and "Ctrl" can
  133.           be used to type the key; that is, lowercase, uppercase,
  134.           or control characters. The @ sign is used to indicate
  135.           that case is insignificant for the following character,
  136.           although "Ctrl" is not accepted. For example,
  137.  
  138.           * Ctrl+k b specifies a Ctrl+K followed by a lowercase b.
  139.  
  140.           * Ctrl+k ^b specifies a Ctrl+K followed by any of b, B,
  141.             or Ctrl+B.
  142.  
  143.           * Ctrl+k @B specifies Ctrl+K followed by either b or B.
  144.  
  145.      Named keys
  146.  
  147.           Key are specified as letters, numbers, or characters,
  148.           optionally preceded by one or more of Ctrl+, Alt+ or
  149.           Shift+. The following names specify keys that cannot be
  150.           typed as themselves in the TEMC syntax.
  151.  
  152.           -------------------------------------------------------
  153.              Key name    Notes
  154.           -------------------------------------------------------
  155.              Home
  156.              End
  157.              PgUp
  158.              PgDn
  159.              LfAr        Left arrow
  160.              RgAr        Right arrow
  161.              UpAr        Up arrow
  162.              DnAr        Down arrow
  163.              Ins
  164.              Del
  165.              Enter
  166.              Return      Same as Enter
  167.              BkSp        Backspace
  168.              Tab
  169.              BkTab       No longer available, use Shift+Tab
  170.              Esc
  171.              Star        * key on the numeric keypad
  172.              Minus       - key on the numeric keypad
  173.              Plus        + key on the numeric keypad
  174.              Space       Spacebar
  175.              PrtSc
  176.              F1 to F10   Function keys
  177.  
  178. ===========================================================================
  179. Predefined editor commands
  180. ===========================================================================
  181.  
  182.           TEMC lets you use built-in editor commands and user-
  183.           defined macros as commands within macros interchangeably
  184.           as long as you don't create any loops by having two
  185.           macros calling each other, even via intermediate macros.
  186.           Note that some commands cause an escape from the editor
  187.           to the surrounding IDE, for example, by bringing up a
  188.           dialog box. Your macro will "pause" until control returns
  189.           to the editor.
  190.  
  191.           A list of all predefined TEMC editor commands is shown
  192.           next. Commands that cause an escape from the editor
  193.           follow.
  194.  
  195.      TEMC editor commands
  196.  
  197.           -------------------------------------------------------
  198.           Command name                What the editor does
  199.           -------------------------------------------------------
  200.  
  201.           BackspaceDelete             Deletes character before
  202.                                       the cursor.
  203.  
  204.           BottomOfScreen              Moves cursor to the bottom
  205.                                       line of the current window,
  206.                                       leaving column unchanged.
  207.  
  208.           CenterFixScreenPos          Adjusts the screen display
  209.                                       to ensure the cursor is
  210.                                       visible. If any adjustment
  211.                                       is necessary, adjust the
  212.                                       display so the cursor is
  213.                                       close to being centered in
  214.                                       the window.
  215.  
  216.           CopyBlock                   If there is a valid and
  217.                                       highlighted (selected)
  218.                                       text block, then at the
  219.                                       cursor location, inserts a
  220.                                       copy of the characters that
  221.                                       are selected and makes that
  222.                                       the new selected text
  223.                                       location.
  224.  
  225.           CursorCharLeft              Moves cursor left over one
  226.                                       character. This command
  227.                                       will skip over tab
  228.                                       characters and move to the
  229.                                       end of the previous line.
  230.  
  231.           CursorCharRight             Moves cursor right over one
  232.                                       character. This  command
  233.                                       will skip over tab
  234.                                       characters and advance to
  235.                                       the beginning of the next
  236.                                       line.
  237.  
  238.           CursorDown                  Moves cursor down one row.
  239.  
  240.           CursorLeft                  Moves cursor left one
  241.                                       screen column.
  242.  
  243.           CursorRight                 Moves cursor right one
  244.                                       screen column.
  245.  
  246.           CursorSwitchedLeft          Like CursorLeft, but pays
  247.                                       attention to cursor through
  248.                                       tab option setting (see
  249.                                       SetCursorThroughTabMode).
  250.  
  251.           CursorSwitchedRight         Like CursorRight, but pays
  252.                                       attention to cursor
  253.                                       through tab option setting
  254.                                       (see SetCursorThroughTabMode).
  255.  
  256.           CursorUp                    Moves cursor up one row.
  257.  
  258.           DeleteBlock                 If there is a valid and
  259.                                       highlighted (selected) text
  260.                                       block, deletes the
  261.                                       characters that are in it.
  262.  
  263.           DeleteChar                  Deletes the character at
  264.                                       the current cursor
  265.                                       location.
  266.  
  267.           DeleteLine                  Deletes the current line.
  268.  
  269.           DeleteToEOL                 Deletes all characters in
  270.                                       the current line, leaving a
  271.                                       zero-length line.
  272.  
  273.           DeleteWord                  Deletes from cursor to
  274.                                       beginning of next word.
  275.  
  276.           EndCursor                   Moves cursor to end of file
  277.                                       buffer.
  278.  
  279.           ExtendBlockBeg              Initiates a series of
  280.                                       commands that will select a
  281.                                       block of text between the
  282.                                       initial and ending
  283.                                       positions of the cursor.
  284.  
  285.           ExtendBlockEnd              Ends a series of commands
  286.                                       begun by ExtendBlockBeg.
  287.  
  288.           FixCursorPos                Ensures that the cursor
  289.                                       value specifies a row
  290.                                       between 1 and the number of
  291.                                       lines in the buffer, a
  292.                                       column greater than 0. If
  293.                                       the cursor through tab
  294.                                       option is not set, the
  295.                                       cursor is not placed in the
  296.                                       middle of a tab character
  297.                                       (see SetCursorThroughTabMode).
  298.  
  299.           FixScreenPos                Adjusts the screen display
  300.                                       to ensure the cursor is
  301.                                       visible.
  302.  
  303.           FullPaintScreen             Redraws the entire window,
  304.                                       making no assumptions about
  305.                                       what is onscreen.
  306.  
  307.           HideBlock                   Sets a flag indicating that
  308.                                       the selected text should
  309.                                       not be highlighted.
  310.  
  311.           HighlightBlock              Sets a flag indicating that
  312.                                       if the beginning and end
  313.                                       selected text markers are
  314.                                       valid, the selected text
  315.                                       should be highlighted.
  316.  
  317.           HomeCursor                  Moves cursor to beginning
  318.                                       of the file buffer.
  319.  
  320.           IndentBlock                 Inserts a space at the
  321.                                       beginning of each line in
  322.                                       the highlighted (selected)
  323.                                       text.
  324.  
  325.           InsertText                  Inserts the literal
  326.                                       "string" in the buffer at
  327.                                       the current cursor
  328.                                       location. Use the syntax
  329.                                       InsertText(string) to call
  330.                                       this command.
  331.  
  332.           LeftOfLine                  Moves cursor to beginning
  333.                                       of the current line.
  334.  
  335.           LiteralChar                 Inserts the character at
  336.                                       the current cursor
  337.                                       location, without doing any
  338.                                       special processing for
  339.                                       newline, tab characters,
  340.                                       etc. Use the syntax
  341.                                       LiteralChar(c), where c is
  342.                                       a character or integer
  343.                                       value.
  344.  
  345.           MarkBufModified             Sets a flag indicating that
  346.                                       the contents of the buffer
  347.                                       are different than what is
  348.                                       in the corresponding disk
  349.                                       file.
  350.  
  351.           MarkBufUnModified           Clears a flag, thus
  352.                                       indicating that the
  353.                                       contents of the buffer can
  354.                                       be assumed to be identical
  355.                                       to what is in the disk
  356.                                       file.
  357.  
  358.           MatchPairBackward           Same as MatchPairForward
  359.                                       except if the cursor is on
  360.                                       a ' or ", searches backward
  361.                                       for the matching character.
  362.  
  363.           MatchPairForward            If the cursor is on one of
  364.                                       the characters (, ), {, },
  365.                                       [, ], or on the first
  366.                                       character of one of the
  367.                                       pairs /* or */, searches in
  368.                                       the appropriate direction
  369.                                       for the closest instance of
  370.                                       the matching delimiter. If
  371.                                       the cursor is on the
  372.                                       character ' or ", searches
  373.                                       forward for the matching
  374.                                       character. If a match is
  375.                                       found, places the cursor
  376.                                       there.
  377.  
  378.           MoveBlock                   Like CopyBlock, but also
  379.                                       deletes the original
  380.                                       selected text.
  381.  
  382.           MoveToBlockBeg              Moves cursor to the
  383.                                       location marked as the
  384.                                       beginning of the selected
  385.                                       text.
  386.  
  387.           MoveToBlockEnd              Moves cursor to the
  388.                                       location marked as the end
  389.                                       of the selected text.
  390.  
  391.           MoveToMark                  Moves the cursor to the
  392.                                       location saved with
  393.                                       SetMark(n) command. Use the
  394.                                       syntax MoveToMark(n), where
  395.                                       n is a one-digit number, 0-9.
  396.  
  397.           MoveToPrevPos               Moves the cursor to the
  398.                                       location specified by the
  399.                                       "previous position marker."
  400.  
  401.           MoveToTempPos               Moves the cursor to the
  402.                                       saved temporary marker.
  403.  
  404.           NullCmd                     No operation. Calls the
  405.                                       editor, but performs no
  406.                                       function. Can be used to
  407.                                       cause a keystroke to have
  408.                                       no effect.
  409.  
  410.           OutdentBlock                Deletes a leading space, if
  411.                                       any, from the beginning of
  412.                                       each line in the
  413.                                       highlighted (selected)
  414.                                       text.
  415.  
  416.           PageDown                    Moves cursor down by number
  417.                                       of lines in the window.
  418.  
  419.           PageScreenDown              Scrolls screen down by
  420.                                       numer of lines in the
  421.                                       window, leaving cursor
  422.                                       position unchanged.
  423.  
  424.           PageScreenUp                Scrolls screen up by numer
  425.                                       of lines in the window,
  426.                                       leaving cursor position
  427.                                       unchanged.
  428.  
  429.           PageUp                      Moves cursor up by number
  430.                                       of lines in the window.
  431.  
  432.           PaintScreen                 Redraws the entire window,
  433.                                       assuming that the screen
  434.                                       still correctly displays
  435.                                       what the editor last drew
  436.                                       on it.
  437.  
  438.           ReDo                        Performs an Redo operation.
  439.                                       Exactly what happens
  440.                                       depends on the option
  441.                                       settings.
  442.  
  443.           RightOfLine                 Moves cursor to end of
  444.                                       current line.
  445.  
  446.           RightOfWord                 Moves cursor to the next
  447.                                       column that follows the end
  448.                                       of a word.
  449.  
  450.           ScrollScreenDown            Scrolls screen down one
  451.                                       line, leaving cursor
  452.                                       position unchanged.
  453.  
  454.           ScrollScreenUp              Scrolls screen up one line,
  455.                                       leaving cursor position
  456.                                       unchanged.
  457.  
  458.           SetAutoIndent               Sets the Auto Indent option
  459.                                       On.
  460.  
  461.           SetAutoOutdent              Sets the Backspace
  462.                                       Unindents option On.
  463.  
  464.           SetBlockBeg                 Sets the beginning of the
  465.                                       selected text to be the
  466.                                       character at the current
  467.                                       cursor location.
  468.  
  469.           SetBlockEnd                 Sets the end of the
  470.                                       selected text to be the
  471.                                       character at the current
  472.                                       cursor location.
  473.  
  474.           SetCursorThroughTabMode     Sets the Cursor Through
  475.                                       Tabs option On.
  476.  
  477.           SetInsertMode               Sets Insert/Overwrite
  478.                                       option to Insert.
  479.  
  480.           SetMark                     Sets a marker to point to
  481.                                       the character at the
  482.                                       current cursor location, so
  483.                                       a later MoveToMark(n)
  484.                                       command can restore the
  485.                                       cursor. Use the syntax
  486.                                       SetMark(n), where n is a
  487.                                       one digit number, 0-9.
  488.  
  489.           SetOptimalFillMode          Sets Optimal Fill option On.
  490.  
  491.           SetPrevPos                  Sets a marker (the previous
  492.                                       position marker) to point
  493.                                       to the character at the
  494.                                       current cursor location.
  495.                                       This marker location
  496.                                       changes only by a call to
  497.                                       SetPrevPos or SwapPrevPos.
  498.  
  499.           SetTabbingMode              Sets Use Tab Char option On.
  500.  
  501.           SetTempPos                  Saves the cursor location
  502.                                       in a temporary marker that
  503.                                       can be used by some
  504.                                       internal editor commands.
  505.                                       This is not a practical
  506.                                       application in user-defined
  507.                                       macros. Use SetMark instead.
  508.  
  509.           SmartRefreshScreen          Redraws the window,
  510.                                       skipping any portions that
  511.                                       the editor is sure are
  512.                                       unmodified since the last
  513.                                       redraw.
  514.  
  515.           SmartTab                    Inserts space or tab
  516.                                       characters in accordance
  517.                                       with the current settings
  518.                                       of the Use Tab Char option,
  519.                                       Tab Width.
  520.  
  521.           SwapPrevPos                 Exchanges the values of the
  522.                                       cursor and the "previous
  523.                                       position marker."
  524.  
  525.           ToggleAutoIndent            Toggles the state of the
  526.                                       Auto Indent option.
  527.  
  528.           ToggleAutoOutdent           Toggles the state of the
  529.                                       Backspace Unindents option.
  530.  
  531.           ToggleCursorThroughTabMode  Toggles the state of the
  532.                                       Cursor Through Tabs option.
  533.  
  534.           ToggleHideBlock             Toggles the state of the
  535.                                       highlight (selected) text
  536.                                       flag (see HighlightBlock).
  537.  
  538.           ToggleInsert                Toggles state of
  539.                                       Insert/Overwrite option.
  540.  
  541.           ToggleOptimalFillMode       Toggles state of Optimal
  542.                                       Fill option.
  543.  
  544.           ToggleTabbingMode           Toggles state of Use Tab
  545.                                       Char option.
  546.  
  547.           TopOfScreen                 Moves cursor to the top
  548.                                       line currently displayed in
  549.                                       the window, leaving column
  550.                                       unchanged.
  551.  
  552.           UnDo                        Performs an Undo operation.
  553.                                       Exactly what happens
  554.                                       depends on the option
  555.                                       settings.
  556.  
  557.           WordLeft                    Moves cursor to beginning
  558.                                       of previous word, or to end
  559.                                       of previous line, whichever
  560.                                       is first.
  561.  
  562.           WordRight                   Moves cursor to beginning
  563.                                       of next word, or to the end
  564.                                       of a line, whichever is
  565.                                       first.
  566.  
  567.           -------------------------------------------------------
  568.  
  569.           The following commands cause an exit from the editor,
  570.           for example, by bringing up a dialog box. The macro
  571.           resumes when the editor window regains the focus.
  572.  
  573.           The keys listed next to some of the commands below are
  574.           the ones used by default.
  575.  
  576.           -------------------------------------------------------
  577.  
  578.           ChangeDirectory     Opens a dialog box for changing the
  579.                               current directory.
  580.  
  581.           ChangeModeFlags     Used after a command such as
  582.                               ToggleInsert which changes the
  583.                               state of an editor option switch.
  584.                               Causes the IDE to update various
  585.                               menu items and/or icons.
  586.  
  587.           ClipCopy            Copys selected text to Clipboard
  588.                               (Ctrl+Ins).
  589.  
  590.           ClipCut             Cuts selected text to Clipboard
  591.                               (Shift+Del).
  592.  
  593.           ClipPaste           Pastes Clipboard into buffer at
  594.                               cursor (Shift+Ins).
  595.  
  596.           ClipShow            Shows Clipboard (no hot key
  597.                               defined).
  598.  
  599.           CloseWindow         Closes editor window (Alt+F3).
  600.  
  601.           CompileFile         Compiles current buffer (Alt+F9).
  602.  
  603.           CompileMenu         Selects Compile menu (Alt+C).
  604.  
  605.           CompilerOptions     Inserts compiler options string
  606.                               at the top of file (Ctrl+O O).
  607.  
  608.           EditMenu            Selects Edit menu (Alt+E).
  609.  
  610.           FileMenu            Selects File menu (Alt+F).
  611.  
  612.           GetFindString       Opens a dialog box for the Search
  613.                               operation. (Alt+S F)
  614.  
  615.           GotoWindow1         Selects window #1 (Alt+1).
  616.  
  617.           GotoWindow2         Selects window #2 (Alt+2).
  618.  
  619.           GotoWindow3         Selects window #3 (Alt+3).
  620.  
  621.           GotoWindow4         Selects window #4 (Alt+4).
  622.  
  623.           GotoWindow5         Selects window #5 (Alt+5).
  624.  
  625.           GotoWindow6         Selects window #6 (Alt+6).
  626.  
  627.           GotoWindow7         Selects window #7 (Alt+7).
  628.  
  629.           GotoWindow8         Selects window #8 (Alt+8).
  630.  
  631.           GotoWindow9         Selects window #9 (Alt+9).
  632.  
  633.           Help                Opens the Help window (F1).
  634.  
  635.           HelpMenu            Selects Help menu (Alt+H).
  636.  
  637.           HelpIndex           Display the Help system's index
  638.                               (Shift+F1).
  639.  
  640.           LastHelp            Opens previous help window (Alt+F1).
  641.  
  642.           MakeProject         Makes project (F9).
  643.  
  644.           Menu                Highlights top menu bar.
  645.  
  646.           Modify              Evaluates expression/modify
  647.                               variable (Ctrl+F4).
  648.  
  649.           NextWindow          Selects next window in IDE (F6).
  650.  
  651.           OpenFile            Opens dialog box for File Open (F3).
  652.  
  653.           OptionsMenu         Selects Options menu (Alt+O).
  654.  
  655.           PrintBlock          Writes selected text to the
  656.                               printer.
  657.  
  658.           Quit                Exits the IDE (Alt+X).
  659.  
  660.           ReadBlock           Opens dialog box requesting a file
  661.                               name to be read into the buffer at
  662.                               the cursor location and marked as
  663.                               selected text.
  664.  
  665.           RepeatSearch        Searches again, using previous
  666.                               parameters.
  667.  
  668.           Replace             Opens an dialog box for the Replace
  669.                               operation.
  670.  
  671.           RunMenu             Selects Run menu (Alt+R).
  672.  
  673.           RunProgram          Makes and runs current executable
  674.                               (Ctrl+F9).
  675.  
  676.           SaveFile            Saves current editor buffer (F2).
  677.  
  678.           SaveFileAs          Opens dialog for File SaveAs.
  679.  
  680.           SearchMenu          Selects Search menu (Alt+S).
  681.  
  682.           SystemMenu          Selects System menu (Alt+Spacebar).
  683.  
  684.           WindowList          Displays window list (Alt+0).
  685.  
  686.           WindowMenu          Selects Window menu (Alt+W).
  687.  
  688.           WindowCascade       Cascades windows (Shift+F5).
  689.  
  690.           WindowTile          Tiles windows (Shift+F4).
  691.  
  692.           WordHelp            Context sensitive help (Ctrl+F1).
  693.  
  694.           WriteBlock          Opens dialog box requesting a file
  695.                               name to which the selected text
  696.                               will be written.
  697.  
  698.           ZoomWindow          Zooms/unzooms current window (F5).
  699.  
  700. ===========================================================================
  701. ===========================================================================
  702.