home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Pascal / BPASCAL.700 / D10 / UTILS.ZIP / EPSILON.TEM < prev    next >
Encoding:
Text File  |  1992-10-01  |  9.5 KB  |  492 lines

  1. Script  EPSILON;
  2.  
  3.  
  4. /***********************************************************************
  5.  
  6.       Epsilon editor emulation for Borland/Turbo Pascal IDE.
  7.  
  8.     This file contains a Turbo Editor Macro Language (TEML)
  9. script which emulates the Epsilon programmer's editor in the Borland/Turbo
  10. Pascal IDE.  A complete description of the TEML language and the Turbo
  11. Editor Macro Compiler (TEMC) can be found in the file "UTIL.DOC".
  12.  
  13.     The TEMC compiler can be invoked from the DOS command line at
  14. follows:
  15.  
  16.       temc [-c] epsilon.tem <IDE configuration file><.CMD><.TP>
  17.  
  18. The optional -c switch can also be specified as /c, and can appear in
  19. any argument position on the command line. If you use this option,
  20. any existing command table in your configuration file is thrown away
  21. before the script file is merged with those already defined. The
  22. configuration file extension must be specified as TEMC will modify both DOS
  23. and Windows IDEs config files.  Specify .CMD or .TP extentions for Windows
  24. or DOS IDE, respectively. If the .CMD file does not exist, it will be 
  25. created. The .TP file must exist, or an error is displayed.
  26.  
  27. Most of the simple Epsilon commands have been fully implemented.  Most
  28. of the complex command have been either partially implemented or not
  29. implemented at all.  The TEML macros names correspond to the names in
  30. the Espilon default macro set.  Below is a list of the commands that
  31. have been fully or partially implemented.
  32.  
  33. IDE Binding   Epsilon Command            Comments
  34. -----------   ---------------            -------------------------
  35. Ctrl-B        backward_character         
  36. Ctrl-H        backward_delete_character  
  37. Alt-B         backward_word      
  38. Ctrl-A        beginning_of_line      
  39. Home          beginning_of_window    
  40. Ctrl-L        center_window      
  41. Alt-W         copy_region        
  42. Esc+@w        copy_region        
  43. Ctrl-D        delete_character
  44. Ctrl-N        down_line
  45. Tab           do_c_indent
  46. Ctrl-E        end_of_line
  47. End           end_of_window
  48. Ctrl-X+Ctrl-X exchange_point_and_mark
  49. Ctrl-X+Ctrl-C Quit;
  50. Ctrl-X+Ctrl-Z exit_level                 Leaves editor - Enables Menus
  51. Ctrl-X+Ctrl-F find_file
  52. Ctrl-F        forward_character
  53. Alt-F         forward_word
  54. Esc+@f        forward_word
  55. Ctrl-Home     goto_beginning
  56. Esc+<         goto_beginning
  57. Ctrl-End      goto_end
  58. Esc+>         goto_end
  59. Ctrl-X+@i     insert_file
  60. Ctrl-K        kill_line                  Uses Block-copy - Allowing yanking
  61. Ctrl-W        kill_region
  62. Ctrl-X+0      kill_window
  63. Alt-D         kill_word                  Does not allow for yanking
  64. Esc+d         kill_word
  65. Esc+D         kill_word
  66. Ctrl-X+@m     make
  67. Alt-X         named_command
  68. Ctrl-X+Ctrl-N next_error                
  69. Ctrl-V        next_page
  70. Ctrl-O        open_line
  71. Alt-V         previous_page
  72. Esc+@v        previous_page
  73. Ctrl-Q        quoted_insert
  74. Ctrl-X+@r     redo
  75. F10           redo
  76. Ctrl-S+Ctrl-S RepeatSearch
  77. Ctrl-X+@u     undo
  78. F9            undo
  79. Ctrl-X+Ctrl-S save_file
  80. Alt-Z         scroll_down
  81. Esc+@z        scroll_down
  82. Ctrl-Z        scroll_up
  83. Ctrl-X+Ctrl-M set_mark
  84. Ctrl-S        string_search
  85. Ctrl-P        up_line
  86. Ctrl-X+@w     write_region
  87. Ctrl-Y        yank
  88. Alt-Y         yank_pop                   Displays the Clipboard
  89.  
  90. ********************************************************************/
  91.  
  92. /*******************************************************************
  93.         TEML SCRIPTS TO EMULATE EPSILON FROM THE BORLAND C++ IDE     
  94.  *******************************************************************/
  95.  
  96.  
  97. macro   backward_character
  98.     CursorSwitchedLeft;
  99. end;
  100.  
  101.  
  102. macro   backward_delete_character
  103.     BackSpaceDelete;
  104. end;
  105.  
  106.  
  107. macro   backward_word
  108.     WordLeft;
  109. end;
  110.  
  111.  
  112. macro   beginning_of_line
  113.     LeftOfLine;
  114. end;
  115.  
  116.  
  117. macro   beginning_of_window
  118.     TopOfScreen;
  119. end;
  120.  
  121.  
  122. macro   center_window
  123.     SetTempPos;
  124.     ScrollScreenUp;
  125.     CenterFixScreenPos;
  126.     ScrollScreenDown;
  127.     CenterFixScreenPos;
  128.     PageScreenUp;
  129.     CenterFixScreenPos;
  130.     PageScreenDown;
  131.     CenterFixScreenPos;
  132.     MoveToTempPos;
  133. end;
  134.  
  135.  
  136. macro   copy_region
  137.     HideBlock;
  138.     SwapPrevPos;
  139.     SetBlockBeg;
  140.     SwapPrevPos;
  141.     SetBlockEnd;
  142.     HighlightBlock;
  143.     ClipCopy;
  144. end;
  145.  
  146.  
  147. macro   delete_character
  148.     DeleteChar;
  149. end;
  150.  
  151.  
  152. macro   do_c_indent
  153.     LiteralChar( 9 );
  154. end;
  155.  
  156.  
  157. macro   down_line
  158.     CursorDown;
  159. end;
  160.  
  161.  
  162. macro   end_of_line
  163.     RightOfLine;
  164. end;
  165.  
  166.  
  167. macro   end_of_window
  168.     BottomOfScreen;
  169. end;
  170.  
  171.  
  172. macro   exchange_point_and_mark
  173.     SwapPrevPos;
  174.     CenterFixScreenPos;
  175. end;
  176.  
  177.  
  178. macro   exit_level
  179.     Quit;
  180. end;
  181.  
  182.  
  183. macro   find_delimiter
  184.     MatchPairForward;
  185. end;
  186.  
  187.  
  188. macro   find_file
  189.     OpenFile;
  190. end;
  191.  
  192.  
  193. macro   forward_character
  194.     CursorSwitchedRight;
  195. end;
  196.  
  197.  
  198. macro   forward_level
  199.     MatchPairForward;
  200. end;
  201.  
  202.  
  203. macro   forward_word
  204.     WordRight;
  205. end;
  206.  
  207.  
  208. macro   goto_beginning
  209.     HomeCursor;
  210. end;
  211.  
  212.  
  213. macro   goto_end
  214.     EndCursor;
  215. end;
  216.  
  217.  
  218. macro   insert_file
  219.     SetPrevPos;
  220.     HideBlock;
  221.     ReadBlock;
  222. end;
  223.  
  224.  
  225. /*  The kill_line Macro does not use the built-in DeleteToEOL TEML macro    */
  226. /*  but rather makes a highlighted block out the line, cuts the block into  */
  227. /*  the clipboard, thereby allowing 'yank'ing of deleted lines.  This method*/
  228. /*  however, requires that delete_character be used when empty lines ( lines*/
  229. /*  containing only a LineFeed character ) are to be deleted...             */
  230. macro   kill_line
  231.     SetTempPos;
  232.     SetBlockBeg;
  233.     end_of_line;
  234.     SetBlockEnd;
  235.     MoveToTempPos;
  236.     HighlightBlock;
  237.     ClipCut;
  238. end;
  239.  
  240.  
  241. macro   kill_region
  242.     SwapPrevPos;
  243.     SetBlockBeg;
  244.     SwapPrevPos;
  245.     SetBlockEnd;
  246.     HighlightBlock;
  247.     ClipCut;
  248. end;
  249.  
  250.  
  251. macro   kill_window
  252.     CloseWindow;
  253. end;
  254.  
  255.  
  256. macro   kill_word
  257.     DeleteWord;
  258. end;
  259.  
  260.  
  261. macro   make
  262.     MakeProject;
  263. end;
  264.  
  265.  
  266. macro   named_command
  267.     Menu;
  268. end;
  269.  
  270.  
  271. macro   next_error
  272.     NextError;
  273. end;
  274.  
  275.  
  276. macro   next_page
  277.     PageDown;
  278. end;
  279.  
  280.  
  281. macro   next_window
  282.     NextWindow;
  283. end;
  284.  
  285.  
  286. macro   open_line
  287.     LiteralChar( 13 );
  288.     CursorSwitchedLeft;
  289. end;
  290.  
  291.  
  292. macro   previous_page
  293.     PageUp;
  294. end;
  295.  
  296.  
  297. macro   query_replace
  298.     Replace;
  299. end;
  300.  
  301.  
  302. macro   quoted_insert
  303.     LiteralChar;
  304. end;
  305.  
  306.  
  307. macro   save_file
  308.     SaveFile;
  309. end;
  310.  
  311.  
  312. macro   scroll_down
  313.     ScrollScreenDown;
  314.     FixCursorPos;
  315. end;
  316.  
  317.  
  318. macro   scroll_up
  319.     ScrollScreenUp;
  320.     FixCursorPos;
  321. end;
  322.  
  323.  
  324. macro   set_mark
  325.     HideBlock;
  326.     SetPrevPos;
  327. end;
  328.  
  329.  
  330. macro   string_search
  331.     SearchMenu;
  332. end;
  333.  
  334.  
  335. macro   up_line
  336.     CursorUp;
  337. end;
  338.  
  339.  
  340. macro   write_region
  341.     HideBlock;
  342.     SwapPrevPos;
  343.     SetBlockBeg;
  344.     SwapPrevPos;
  345.     SetBlockEnd;
  346.     HighlightBlock;
  347.     WriteBlock;
  348. end;
  349.  
  350.  
  351. macro   yank
  352.     HideBlock;
  353.     ClipPaste;
  354. end;
  355.  
  356.  
  357. macro   yank_pop
  358.     ClipShow;
  359. end;
  360.  
  361.  
  362.  
  363. Ctrl-B          :backward_character;
  364.  
  365. Ctrl-H          :backward_delete_character;
  366.  
  367. Alt-B           :backward_word;
  368.  
  369. Ctrl-A          :beginning_of_line;
  370.  
  371. Home            :beginning_of_window;
  372.  
  373. Ctrl-L          :center_window;
  374.  
  375. Alt-W           :copy_region;
  376. Esc+@w          :copy_region;
  377.  
  378. Ctrl-D          :delete_character;
  379.  
  380. Ctrl-N          :down_line;
  381.  
  382. Tab             :do_c_indent;
  383.  
  384. Ctrl-E          :end_of_line;
  385.  
  386. End             :end_of_window;
  387.  
  388. Ctrl-X+Ctrl-X   :exchange_point_and_mark;
  389.  
  390. Ctrl-X+Ctrl-C   :Quit;
  391.  
  392. Ctrl-X+Ctrl-Z   :exit_level;
  393.  
  394. Ctrl-X+Ctrl-F   :find_file;
  395.  
  396. Ctrl-F          :forward_character;
  397.  
  398. Alt-F           :forward_word;
  399. Esc+@f          :forward_word;
  400.  
  401. Ctrl-Home       :goto_beginning;
  402. Esc+<           :goto_beginning;
  403.  
  404.  
  405. Ctrl-End        :goto_end;
  406. Esc+>           :goto_end;
  407.  
  408.  
  409. Ctrl-X+@i       :insert_file;
  410.  
  411. Ctrl-K          :kill_line;
  412.  
  413. Ctrl-W          :kill_region;
  414.  
  415.  
  416. Ctrl-X+0        :kill_window;
  417.  
  418. Alt-D           :kill_word;
  419. Esc+d           :kill_word;
  420. Esc+D           :kill_word;
  421.  
  422. Ctrl-X+@m       :make;
  423.  
  424.  
  425. /* The following is a non-Epsilon MACRO which can be usefully combined with */
  426. /* the insert_file macro to compensate for the fact that TEML's ReadBlock   */
  427. /* internal MACRO leaves point at the beginning of the block just read.     */
  428. /* Epsilon leaves point at the end of the block inserted.  This MACRO allows*/
  429. /* one to quickly move to the end of the block inserted...                  */
  430. Ctrl-X+Ctrl-K   :Begin
  431.                     MoveToBlockEnd;
  432.                     center_window;
  433.                     HideBlock;
  434.                  End;
  435.  
  436. Alt-X           :named_command;
  437.  
  438. Ctrl-X+Ctrl-N   :next_error;
  439.  
  440. Ctrl-V          :next_page;
  441.  
  442. Ctrl-O          :open_line;
  443.  
  444. Alt-V           :previous_page;
  445. Esc+@v          :previous_page;
  446.  
  447. Ctrl-Q          :quoted_insert;
  448.  
  449. Ctrl-X+@r       :redo;
  450. F10             :redo;
  451.  
  452. Ctrl-S+Ctrl-S   :RepeatSearch;
  453.  
  454. Ctrl-X+@u       :undo;
  455. F9              :undo;
  456.  
  457. Ctrl-X+Ctrl-S   :save_file;
  458.  
  459. Alt-Z           :scroll_down;
  460. Esc+@z          :scroll_down;
  461.  
  462. Ctrl-Z          :scroll_up;
  463.  
  464. Ctrl-X+Ctrl-M   :set_mark;
  465.  
  466. Ctrl-S          :string_search;
  467.  
  468. Ctrl-P          :up_line;
  469.  
  470. Ctrl-X+@w       :write_region;
  471.  
  472. Ctrl-Y          :yank;
  473.  
  474. Alt-Y           :yank_pop;
  475.  
  476. /* These need to be redefined or TEMC needs to be changed to accept them
  477. Alt-,           :beginning_of_window
  478. Alt-.           :end_of_window;
  479. Alt-)           :find_delimiter;
  480. Ctrl-Alt-F      :forward_level;
  481. Alt-<           :goto_beginning;
  482. Alt->           :goto_end;
  483. Alt-End         :next_window;
  484. Esc+End         :next_window;
  485. Alt-%           :query_replace;
  486. Esc+%           :query_replace;
  487. Ctrl-@          :set_mark;
  488. */
  489.  
  490.  
  491.  
  492.