home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmtfe30.zip / source.zip / source / texfed.e < prev    next >
Text File  |  2000-04-19  |  5KB  |  193 lines

  1. /*********************************************/
  2. /*   this is texfed.e 2000-04-19 (WaS)       */
  3. /*                                           */
  4. /*   the keysets for texfe.e v3.0            */
  5. /*********************************************/
  6.  
  7. compile if TEXCOMPL =1 
  8.  
  9. /*
  10. ┌────────────────────────────────────────────────────────────────────────────┐
  11. │  Define the action for the spacebar                                        │
  12. │    The spacebar initiates the expansion of keywords                        │
  13. └────────────────────────────────────────────────────────────────────────────┘
  14. */
  15.   compile if EVERSION >= 5
  16.     def space=
  17.   compile else
  18.     def ' '=
  19.   compile endif
  20.  
  21. -- Note: expand_on is set dynamically by user to turn on syntax assist in EPM
  22.   universal expand_on
  23.   if expand_on then
  24.     if not tex_first_expansion() then  -- search for keywords and expand 
  25.       keyin ' '  -- default to a space if unable to expand word
  26.     endif
  27.   else
  28.     keyin ' '  -- default is just a space with syntax assist disabled
  29.   endif
  30.  
  31.   compile if EVERSION >= '5.20'
  32.     undoaction 1, junk                -- Create a new state
  33.   compile endif
  34.  
  35. /*
  36. ┌────────────────────────────────────────────────────────────────────────────┐
  37. │  Define the action for the enter (or ctrl-enter) key                       │
  38. │    The enter key terminates the expansion of a keyword started with        │
  39. │    the spacebar.                                                           │
  40. └────────────────────────────────────────────────────────────────────────────┘
  41. */
  42. -- global ASSIST_TRIGGER defines the key that starts syntax assist
  43.   compile if not defined (ASSIST_TRIGGER)
  44.     const ASSIST_TRIGGER = 'ENTER'  -- enter key is the default trigger
  45.   compile endif
  46.  
  47.   compile if ASSIST_TRIGGER = 'ENTER'
  48.     def enter=
  49.     compile if ENHANCED_ENTER_KEYS & ENTER_ACTION <> ''
  50.       universal enterkey
  51.     compile endif
  52.   compile else
  53.     def c_enter=
  54.     compile if ENHANCED_ENTER_KEYS & c_ENTER_ACTION <> ''
  55.       universal c_enterkey
  56.     compile endif
  57.   compile endif
  58.  
  59.   universal expand_on
  60.   compile if EVERSION >= 5
  61.     if expand_on then
  62.   compile else
  63.     if expand_on & not command_state() then
  64.   compile endif -- EVERSION >= 5
  65.     compile if EVERSION <= '4.12'
  66.       if tex_second_expansion() then
  67.         call maybe_autosave()
  68.       else
  69.     compile else
  70.       if not tex_second_expansion() then  -- call the expansion procedure
  71.     compile endif  -- EVERSION <= 4.12       and if no expansion possible then...
  72.     compile if ASSIST_TRIGGER = 'ENTER'
  73.       compile if ENHANCED_ENTER_KEYS & ENTER_ACTION <> ''
  74.         call enter_common(enterkey)
  75.       compile else
  76.         call my_enter()
  77.       compile endif
  78.     compile else  -- ASSIST_TRIGGER
  79.       compile if ENHANCED_ENTER_KEYS & c_ENTER_ACTION <> ''
  80.         call enter_common(c_enterkey)
  81.       compile else
  82.         call my_c_enter()
  83.       compile endif
  84.     compile endif -- ASSIST_TRIGGER
  85.       endif  -- not tex_second_expansion
  86.  
  87.     else  -- expand_on is off so enter does default actions only
  88.     compile if ASSIST_TRIGGER = 'ENTER'
  89.       compile if ENHANCED_ENTER_KEYS & ENTER_ACTION <> ''
  90.         call enter_common(enterkey)
  91.       compile else
  92.         call my_enter()
  93.       compile endif
  94.     compile else  -- ASSIST_TRIGGER
  95.       compile if ENHANCED_ENTER_KEYS & c_ENTER_ACTION <> ''
  96.         call enter_common(c_enterkey)
  97.       compile else
  98.         call my_c_enter()
  99.       compile endif
  100.     compile endif -- ASSIST_TRIGGER
  101.     endif  -- expand_on
  102.  
  103.     def c_x=       /* Force expansion if we don't have it turned on automatic */
  104.         if not tex_first_expansion() then
  105.           call tex_second_expansion()
  106.         endif
  107.  
  108. /*******************************/
  109. /*                             */
  110. /* the accelerator keys        */
  111. /* (changed v2.2)              */
  112. /*******************************/
  113.  
  114.  compile if TEXACCEL
  115.  
  116.     def '{'=
  117.        keyin '{}'
  118.        .col = .col - 1
  119.  
  120.     def '$'=
  121.        keyin '$$'
  122.        .col = .col - 1
  123.  
  124.     def a_a=
  125.        keyin 'eqnarray'
  126.  
  127.     def a_b =
  128.        keyin '\begin{}'
  129.        .col = .col - 1
  130.  
  131.     def a_c =
  132.        keyin '\cite{}'
  133.        .col = .col - 1
  134.  
  135.     def a_d=
  136.        keyin 'description'
  137.  
  138.     def a_e = 
  139.        keyin 'equation'
  140.  
  141.     def a_f =
  142.        keyin '\frac{}{}'
  143.        .col = .col - 3
  144.  
  145.     def a_h = 
  146.        keyin '\hspace*{}'
  147.        .col=.col - 1
  148.  
  149.     def a_i =
  150.        keyin '\item'
  151.  
  152.     def a_j = 
  153.        keyin 'itemize'
  154.  
  155.     def a_k = 
  156.        keyin 'tabular'
  157.  
  158.     def a_l =
  159.        keyin '\label{}'
  160.        .col = .col - 1
  161.  
  162.     def a_m =
  163.        keyin '\mbox{}'
  164.        .col = .col - 1
  165.  
  166.     def a_n = 
  167.        keyin 'enumerate'
  168.  
  169.     def a_q =
  170.        keyin 'equation'
  171.  
  172.     def a_r=
  173.        keyin '\ref{}'
  174.        .col = .col - 1
  175.  
  176.     def a_s = 
  177.        keyin '\sqrt{}'
  178.        .col = .col - 1
  179.  
  180.     def a_v=
  181.        keyin '\vspace*{}'
  182.        .col = .col - 1
  183.  
  184.     def a_w = 
  185.        keyin 'verbatim'
  186.  
  187.  compile endif /* TEXACCEL */
  188.  
  189.  
  190. compile endif /* TEXCOMPL */
  191.  
  192. /* Finis */
  193.