home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / e / epmmac2.zip / STDKEYS.E < prev    next >
Text File  |  1993-01-10  |  57KB  |  1,995 lines

  1. define
  2. compile if EVERSION < 5
  3.    NOT_CMD_STATE = '& not command_state()'
  4. compile else
  5.    NOT_CMD_STATE = ' '
  6. compile endif
  7.  
  8. definit
  9.    universal blockreflowflag
  10. compile if defined(HIGHLIGHT_COLOR)
  11.    universal search_len
  12. compile endif
  13. compile if EVERSION < 5
  14.    universal inKstring
  15.    inKstring=0
  16. compile endif
  17.    blockreflowflag=0
  18. compile if defined(HIGHLIGHT_COLOR)
  19.    search_len = 5     -- Initialize to anything, to prevent possible "Invalid number argument"
  20. compile endif
  21.  
  22. compile if WANT_CUA_MARKING & EPM
  23. defkeys edit_keys new clear
  24.  
  25. def otherkeys =
  26.    k = lastkey()
  27.    call process_key(k)
  28.  
  29. defproc process_key(k)
  30.  compile if WANT_CUA_MARKING = 'SWITCH'
  31.    universal CUA_marking_switch
  32.  compile endif
  33.    if length(k)=1 & k<>\0 then
  34.       i_s = insert_state()
  35.  compile if WANT_CUA_MARKING = 'SWITCH'
  36.       if CUA_marking_switch then
  37.  compile endif
  38.          had_mark = process_mark_like_cua()
  39.          if not i_s & had_mark then
  40.             insert_toggle  -- Turn on insert mode because the key should replace
  41.          endif             -- the mark, not the character after the mark.
  42.  compile if WANT_CUA_MARKING = 'SWITCH'
  43.       else
  44.          had_mark = 0  -- set to 0 so we don't toggle insert state later
  45.       endif
  46.  compile endif
  47.       keyin k
  48.       if not i_s & had_mark then
  49.          insert_toggle
  50.       endif
  51.    endif
  52.  
  53. defproc process_mark_like_cua()
  54.    if marktype() then
  55.       getmark firstline,lastline,firstcol,lastcol,markfileid
  56.       getfileid fileid
  57.       if fileid<>markfileid then
  58.          sayerror MARKED_OTHER__MSG
  59.          unmark
  60.       elseif not check_mark_on_screen() then
  61.          sayerror MARKED_OFFSCREEN__MSG
  62.          unmark
  63.       else
  64. compile if WANT_DM_BUFFER
  65.          'Copy2DMBuff'     -- see clipbrd.e for details
  66. compile endif  -- WANT_DM_BUFFER
  67.          firstline; .col=firstcol
  68. compile if EVERSION >= '5.20'
  69.          undoaction 1, junk                -- Create a new state
  70. compile endif
  71.          call pdelete_mark()
  72.          'ClearSharBuff'       /* Remove Content in EPM shared text buffer */
  73.          return 1
  74.       endif
  75.    endif
  76.  
  77. defproc shifted
  78.    ks = getkeystate(VK_SHIFT)
  79.    return ks<>3 & ks<>4
  80.  
  81. compile if EVERSION < 5.50
  82. define CHARG_MARK = 'CHAR'
  83. compile else                -- New mark type
  84. define CHARG_MARK = 'CHARG'
  85. compile endif
  86.  
  87. defproc extend_mark(startline, startcol, forward)
  88. ;compile if WANT_CUA_MARKING = 'SWITCH'
  89. ;  universal CUA_marking_switch
  90. ;  if not CUA_marking_switch then return; endif
  91. ;compile endif
  92.    if marktype()='LINE' | marktype()='BLOCK' then return; endif
  93.    getfileid curfileid
  94.    if not marktype() then
  95. compile if EVERSION < 5.50  -- Forwards and backwards acts differently
  96.       call pset_mark(startline, .line, startcol-(not forward), .col-forward, CHARG_MARK, curfileid)
  97. compile else  -- CHARG handles the differences.
  98.       call pset_mark(startline, .line, startcol, .col, CHARG_MARK, curfileid)
  99. compile endif
  100.       return
  101.    endif
  102. compile if EVERSION < 5.50
  103.    getmark firstline,lastline,firstcol,lastcol,markfileid
  104. compile else
  105.    getmarkg firstline,lastline,firstcol,lastcol,markfileid
  106. compile endif
  107.    if markfileid<>curfileid then  -- If mark was in a different file, treat like no mark was set.
  108. compile if EVERSION < 5.50  -- Forwards and backwards acts differently
  109.       call pset_mark(startline, .line, startcol-(not forward), .col-forward, CHARG_MARK, curfileid)
  110. compile else  -- CHARG handles the differences.
  111.       call pset_mark(startline, .line, startcol, .col, CHARG_MARK, curfileid)
  112. compile endif
  113.       return
  114.    endif
  115.    lk = lastkey(0)
  116.    if (lk=s_up & .line=firstline-1) | (lk=s_down & .line=firstline+1) then
  117.       if length(textline(firstline)) < .col then
  118.          firstcol = .col
  119.       endif
  120.    endif
  121.    if startline>firstline | ((startline=firstline) & (startcol > firstcol)) then  -- at end of mark
  122.       if not forward then
  123.          if firstline=.line & firstcol=.col then unmark; return; endif
  124.       endif
  125. compile if EVERSION < '5.50'
  126.       call pset_mark(firstline, .line, firstcol, .col-1, CHARG_MARK, curfileid)
  127. compile else
  128.       call pset_mark(firstline, .line, firstcol, .col, CHARG_MARK, curfileid)
  129. compile endif
  130.    else                                                         -- at beginning of mark
  131.       if forward then
  132.          if lastline=.line & lastcol=.col-1 then unmark; return; endif
  133.       endif
  134.       call pset_mark(lastline, .line, lastcol, .col, CHARG_MARK, curfileid)
  135.    endif
  136.  
  137. ; c_home, c_end, c_left & c_right do different things if the shift key is depressed.
  138. ; The logic is extracted here mainly due to the complexity of the COMPILE IF's
  139. defproc begin_shift(var startline, var startcol, var shift_flag)
  140.  compile if WANT_CUA_MARKING = 'SWITCH'
  141.    universal CUA_marking_switch
  142.  compile endif
  143.    shift_flag = shifted()
  144.  compile if WANT_CUA_MARKING = 'SWITCH'
  145.    if shift_flag or not CUA_marking_switch then
  146.  compile else
  147.    if shift_flag then
  148.  compile endif
  149.       startline = .line; startcol = .col
  150.    else
  151.       unmark
  152.    endif
  153.  
  154. defproc end_shift(startline, startcol, shift_flag, forward_flag)
  155.  compile if WANT_CUA_MARKING = 'SWITCH'
  156.    universal CUA_marking_switch
  157.    if shift_flag & CUA_marking_switch then
  158.  compile else
  159.    if shift_flag then
  160.  compile endif
  161.       call extend_mark(startline, startcol, forward_flag)
  162.    endif
  163. compile else  -- WANT_CUA_MARKING & EPM
  164. defkeys edit_keys new
  165. compile endif  -- WANT_CUA_MARKING & EPM
  166.  
  167. compile if EVERSION < 5
  168. def entry=
  169. compile endif
  170.  
  171. ; Real keys, in alphabetical order.
  172. ; See end of this file for a list of keys unused in standard E.
  173.  
  174. def a_0=    /* same as Alt-Equal, for sake of German keyboards */
  175.    'dolines'
  176.  
  177. ; We now distribute a standard front end for the DIR command, which redirects
  178. ; the output to a file named ".dos dir <dirspec>".  The third line should be
  179. ; "Directory of <dirname>".  If so, we use it.  If not, we use DIRSPEC from the
  180. ; .filename instead, but note that the latter might contain wildcards.
  181. def a_1= /* edit filename on current text line */
  182.    getline line
  183.    parse value .filename with word1 word2 word3 .
  184.    if upcase(word1 word2) = '.DOS DIR' then
  185.       call psave_pos(save_pos)
  186. compile if EVERSION >= '4.12'
  187.       getsearch oldsearch
  188. compile endif
  189.       'xcom l /'DIRECTORYOF_STRING'/c-'
  190.       if not rc then
  191.          getline word3
  192.          parse value word3 with . . word3 .
  193.       endif
  194. compile if EVERSION >= '4.12'
  195.       setsearch oldsearch
  196. compile endif
  197.       call prestore_pos(save_pos)
  198. compile if not E3  -- DOS (box) doesn't see new-format DIR listing
  199.       filename=substr(line,41)                 -- Support HPFS.  FAT dir's end at 40
  200.       if filename='' then                      -- Must be FAT.
  201. compile endif
  202.          filename=strip(substr(line,1,8))
  203.          word2=strip(substr(line,10,3))
  204.          if word2<>'' then filename=filename'.'word2; endif
  205. compile if not E3  -- DOS (box) doesn't see new-format DIR listing
  206.       endif
  207. compile endif
  208.       name=word3 ||                            -- Start with the path.
  209. compile if EVERSION >= '5.17'
  210.            leftstr('\',                        -- Append a '\', but only if path
  211.                    '\'<>rightstr(word3,1)) ||  -- doesn't end with one.
  212. compile else
  213.            substr('\', 1,                      -- Append a '\', but only if path
  214.                   '\'<>substr(word3,length(word3),1)) ||  -- doesn't end with one.
  215. compile endif
  216.            filename                            -- Finally, the filename
  217.       if pos('<DIR>',line) then
  218.          'dir 'name
  219.       else
  220.          'e 'name
  221.       endif
  222.    else
  223. compile if not E3
  224.       parse value line with filename '(' linenum ':' col ')'
  225.       if col <> '' then  -- CSet/2 error output
  226.          'e 'filename
  227.          if pos(')', linenum) then  -- No, some other compiler
  228.             parse value 1 linenum with col linenum ')'
  229.          endif
  230.          linenum
  231.          .col = col
  232.       else
  233. compile endif
  234.          'e 'line
  235. compile if not E3
  236.       endif
  237. compile endif
  238.    endif
  239.  
  240. compile if WANT_WINDOWS
  241. def a_4=call psplit4()            -- routine defined in WINDOW.E
  242. compile endif
  243.  
  244. def a_a=
  245. compile if WANT_CHAR_OPS
  246.    call pcommon_adjust_overlay('A')
  247. compile else
  248.    adjustblock
  249. compile endif
  250.  
  251. def a_b
  252.    markblock
  253. compile if EVERSION >= 5
  254.    'Copy2SharBuff'       /* Copy mark to shared text buffer */
  255. compile endif
  256.  
  257. def a_c=
  258. compile if EPM
  259.    if marktype() then
  260. compile endif
  261.       call pcopy_mark()
  262. compile if EPM
  263.    else                 /* If no mark, look to in Shared Text buffer */
  264.       'GetSharBuff'     /* see clipbrd.e for details                 */
  265.    endif
  266. compile endif
  267.  
  268. def a_d=
  269. compile if WANT_DM_BUFFER
  270.    'Copy2DMBuff'     -- see clipbrd.e for details
  271. compile endif
  272.    call pdelete_mark()
  273. compile if EVERSION > 5
  274.    'ClearSharBuff'       /* Remove Content in EPM shared text buffer */
  275. compile endif
  276.  
  277. def a_e= call pend_mark()
  278.  
  279. def a_equal=
  280.    'dolines'   -- Code is a separate command in STDCMDS.E.
  281.  
  282. def a_f= /* Now accepts key from macro. */
  283.    call checkmark()
  284. compile if EVERSION < 5
  285.    k=mgetkey("Type a character, or Esc to cancel.")
  286.    if length(k)>1 then           -- Do something with extended keys.
  287.       if     k=esc      then ;   -- Let user abort w/o Ctrl-break.
  288.       elseif k=padstar  then k='*'
  289.       elseif k=padplus  then k='+'
  290.       elseif k=padminus then k='-'
  291.       else   k=substr(k,2,1)      endif
  292.    endif
  293.    if k<>esc then call pfill_mark(k); endif
  294. compile else
  295.    call pfill_mark()
  296. compile endif
  297.  
  298. def a_f1= keyin '║ ╠ ╔ ╚ ╩ ═ ╦ ╝ ╗ ╣ ╬ │ ├ ┌ └ ┴ ─ ┬ ┘ ┐ ┤ ┼ █ ▓ ▒ ░'
  299.  
  300. def a_f7,c_F7=   -- Can't use the old A_F7 in EPM.  PM uses it as an accelerator key.
  301.    shift_left
  302. compile if SHIFT_BLOCK_ONLY
  303.    if marktype()='BLOCK' then  -- code by Bob Langer
  304.       getmark fl,ll,fc,lc,fid
  305.       call pset_mark(fl,ll,lc,MAXCOL,'BLOCK',fid)
  306.       shift_right
  307.       call pset_mark(fl,ll,fc,lc,'BLOCK',fid)
  308.    endif
  309. compile endif
  310.  
  311. def a_f8,c_F8=   -- Can't use the old A_F8 in EPM.  PM uses it as an accelerator key.
  312. compile if SHIFT_BLOCK_ONLY
  313.    if marktype()='BLOCK' then  -- code by Bob Langer
  314.       getmark fl,ll,fc,lc,fid
  315.       call pset_mark(fl,ll,lc,MAXCOL,'BLOCK',fid)
  316.       shift_left
  317.       call pset_mark(fl,ll,fc,lc,'BLOCK',fid)
  318.    endif
  319. compile endif
  320.    shift_right
  321.  
  322. compile if EVERSION < 5
  323.  compile if EVERSION < '4.10'          -- Early E doesn't support enh. kbd.
  324. def a_f10,c_P= call pprevfile()       -- routine defined in WINDOW.E
  325.  compile else
  326. def a_f10,F11,c_P= call pprevfile()       -- routine defined in WINDOW.E
  327.  compile endif
  328. compile else
  329. /* We can't use a_f10 for previous file any more, PM uses that key. */
  330. /* I like F11 and F12 to go back and forth.                         */
  331. def a_f10,F11,c_P=  -- a_F10 is usual E default; F11 for enh. kbd, c_P for EPM.
  332.    prevfile
  333. compile endif
  334.  
  335. def a_j=
  336.    call joinlines()
  337.  
  338. def a_l=
  339.    mark_line
  340. compile if EVERSION >= 5
  341.    'Copy2SharBuff'       /* Copy mark to shared text buffer */
  342. compile endif
  343.  
  344. def a_m=call pmove_mark()
  345.  
  346. def a_minus =
  347.  compile if EOS2
  348.    display 0
  349.  compile endif
  350.  compile if EVERSION < '5.50'
  351.    sayat '', .cursory, .cursorx, WHITE + REDB + BLINK, 1
  352.  compile else
  353.    circleit 2, .line, .col-1, .col+1, WHITE + REDB + BLINK
  354.  compile endif
  355.  compile if EPM & EVERSION < '5.50'
  356.    call dynalink('DOSCALLS', '#32', atol_swap(1000))  -- 1 second DOSSLEEP
  357.    refresh
  358.  compile endif
  359.  compile if EOS2
  360.    k=getkey()
  361.    display 1
  362.    executekey k
  363.  compile endif
  364.  
  365. def a_n=  /* Type the full name of the current file. */
  366.   keyin .filename
  367.  
  368. def a_o=
  369. compile if EPM
  370.    if marktype() then
  371. compile endif
  372. compile if WANT_CHAR_OPS
  373.       call pcommon_adjust_overlay('O')
  374. compile else
  375.       overlay_block
  376. compile endif
  377. compile if EPM
  378.    else                 /* If no mark, look to in Shared Text buffer */
  379.       'GetSharBuff O'   /* see clipbrd.e for details                 */
  380.    endif
  381. compile endif
  382.  
  383. def a_p=
  384.    /* Protect the user from accidentally reflowing a marked  */
  385.    /* area not in the current file, and give a good message. */
  386.    mt = marktype()
  387.    if mt='BLOCK' or mt='LINE' then
  388.       getmark firstline,lastline,firstcol,lastcol,markfileid
  389.       getfileid fileid
  390.       if fileid<>markfileid then
  391.          sayerror CANT_REFLOW__MSG'  'OTHER_FILE_MARKED__MSG
  392.          return
  393.       endif
  394.    endif
  395.  
  396.    if mt then
  397.       if not check_mark_on_screen() then
  398. compile if EVERSION < 5
  399.          do while testkey()/==''; call getkey(); end
  400.          sayerror MARK_OFF_SCRN_YN__MSG
  401.          loop
  402.             ch=upcase(getkey())
  403.             if ch=YES_CHAR then sayerror 0; leave; endif
  404.             if ch=NO_CHAR or ch=esc then sayerror 0; stop; endif
  405.          endloop
  406. compile else
  407.          sayerror MARK_OFF_SCREEN__MSG
  408.          stop
  409. compile endif
  410.       endif
  411.    endif
  412.  
  413.    if mt='BLOCK' then
  414.       'box r'
  415.    elseif mt='CHAR' then
  416.       sayerror WRONG_MARK__MSG
  417.    elseif mt='LINE' then
  418.       reflow
  419.    elseif .line then
  420.       getline line
  421.       if line<>'' then  -- If currently on a blank line, don't reflow.
  422.          oldcursory=.cursory;oldcursorx=.cursorx; oldline=.line;oldcol=.col;
  423.          unmark;mark_line
  424.          call pfind_blank_line()
  425.          -- Ver 3.11:  slightly revised test works better with GML sensitivity.
  426.          if .line<>oldline then
  427.             up
  428.          else
  429.             bottom
  430.          endif
  431.          mark_line
  432.          reflow
  433.  
  434.         compile if REFLOW_LIKE_PE   /* position on next paragraph (like PE) */
  435.          down                       /* Thanks to Doug Short. */
  436.          for i=.line+1 to .last
  437.             getline line,i
  438.             if line<>'' then i; leave; endif
  439.          endfor
  440.         compile else
  441.          /* or like old E */
  442.          getmark firstline,lastline
  443.          firstline
  444.          .cursory=oldcursory;.cursorx=oldcursorx; oldline;.col=oldcol
  445.         compile endif
  446.          unmark
  447.       endif
  448.    endif
  449.  
  450. definit                         -- Variable is null if alt_R is not active.
  451.    universal alt_R_active       -- For E3/EOS2, it's 1 if alt_R is active.
  452.    alt_R_active = ''            -- For EPM, it's set to querycontrol(messageline).
  453.  
  454. def a_r=
  455.    universal alt_R_active,tempofid
  456. compile if EPM
  457.    universal alt_R_space
  458. compile endif
  459.  
  460.    if alt_R_active<>'' then
  461. compile if EPM
  462.       call pblock_reflow(1,alt_R_space,tempofid)     -- Complete the reflow.
  463.  compile if EVERSION < '5.21'
  464.       .messageline=''                        -- Turn off the message.
  465.  compile else
  466.        'setmessageline '\0
  467.  compile endif
  468.       'togglecontrol 8 'alt_R_active         -- Restore status of messageline.
  469.       alt_R_active = ''
  470.       return
  471. compile else
  472.       activatefile tempofid                  -- Release tempo
  473.       .modify=0
  474.       'xcom q'
  475. compile endif
  476.    endif
  477.    if pblock_reflow(0,alt_R_space,tempofid) then
  478.       sayerror PBLOCK_ERROR__MSG      /* HurleyJ */
  479.       return
  480.    endif
  481. ;  if marktype() <> 'BLOCK' then
  482.       unmark
  483. ;  endif
  484. compile if EPM
  485.  compile if EVERSION >= '5.53'
  486.    alt_R_active = queryframecontrol(2)         -- Remember if messageline on or off
  487.    'toggleframe 2 1'                    -- Force it on
  488.  compile else
  489.    alt_R_active = querycontrol(8)         -- Remember if messageline on or off
  490.    'togglecontrol 8 1'                    -- Force it on
  491.  compile endif
  492.  compile if EVERSION < '5.21'
  493.    .messageline = BLOCK_REFLOW__MSG
  494.  compile else
  495.    'setmessageline BlockReflow: Mark the new block size with Alt-B; press Alt-R again (Esc cancels)'
  496.  compile endif
  497. compile else
  498.    alt_R_active = 1
  499.    sayerror BLOCK_REFLOW__MSG
  500.    loop
  501.       k=getkey()
  502.       if k==a_r then  /* Alt-R ? */
  503.          call pblock_reflow(1,alt_R_space,tempofid)
  504.          leave
  505.       endif
  506.       if k==esc then  /* Esc ? */
  507.          /* release tempo */
  508.          activatefile tempofid
  509.          .modify=0
  510.          'xcom q'
  511.          unmark
  512.          sayerror NOFLOW__MSG
  513.          leave
  514.       endif
  515.       executekey k
  516.    endloop
  517.    alt_R_active = ''
  518. compile endif
  519.  
  520. def a_s=
  521.    call splitlines()
  522.  
  523. def a_t = call pcenter_mark()
  524.  
  525. def a_u=
  526.    unmark
  527. compile if EVERSION > 5
  528.    'ClearSharBuff'       /* Remove Content in EPM shared text buffer */
  529. compile endif
  530.  
  531. def a_w = call pmark_word()
  532.  
  533. ;  EPM:  Haven't yet figured out a way to do Alt-X=escape.  It used a getkey().
  534. compile if EVERSION < 5
  535. def a_x=escape
  536. compile endif
  537.  
  538. def a_y= call pbegin_mark()
  539.  
  540. compile if WANT_CHAR_OPS
  541. def a_z=mark_char
  542.  compile if EVERSION > 5
  543.    'Copy2SharBuff'       /* Copy mark to shared text buffer */
  544.  compile endif
  545. compile endif
  546.  
  547. compile if EVERSION < 5
  548. def backspace=
  549. compile else
  550. def backspace, s_backspace =
  551. compile endif
  552.  compile if WANT_STREAM_MODE = 'SWITCH'
  553.    universal stream_mode
  554.  compile endif
  555.  compile if WANT_CUA_MARKING = 'SWITCH'
  556.    universal CUA_marking_switch
  557.    if CUA_marking_switch then
  558.  compile endif
  559.  compile if WANT_CUA_MARKING
  560.   compile if EVERSION < 5
  561.    if command_state() then rubout; return; endif
  562.   compile endif
  563.    if process_mark_like_cua() then return; endif
  564.  compile endif
  565.  compile if WANT_CUA_MARKING = 'SWITCH'
  566.    endif
  567.  compile endif
  568. compile if WANT_STREAM_MODE
  569.  compile if WANT_STREAM_MODE = 'SWITCH'
  570.    if .col=1 & .line>1 & stream_mode $NOT_CMD_STATE then
  571.  compile else
  572.    if .col=1 & .line>1 $NOT_CMD_STATE then
  573.  compile endif
  574.       up
  575.       l=length(textline(.line))
  576.       join
  577.       .col=l+1
  578.    else
  579. compile endif
  580. compile if EVERSION >= '5.50'
  581.       old_level = .levelofattributesupport
  582.       if old_level & not (old_level%2 - 2*(old_level%4)) then
  583.          .levelofattributesupport = .levelofattributesupport + 2
  584.          .cursoroffset = -300
  585.       endif
  586. compile endif
  587.       rubout
  588. compile if EVERSION >= '5.50'
  589.       .levelofattributesupport = old_level
  590. compile endif
  591. compile if WANT_STREAM_MODE
  592.    endif
  593. compile endif
  594.  
  595. def c_2 = keyin \0                  -- C_2 enters a null.
  596. def c_6 = keyin \170                -- C_6 enters a "not" sign
  597. compile if EVERSION >= '5.50'
  598. def c_9 = keyin '{'
  599. def c_0 = keyin '}'
  600. compile endif
  601.  
  602. compile if WANT_WINDOWS
  603. def c_a= call pnextwindowstyle()  -- routine defined in WINDOW.E
  604. compile endif
  605.  
  606. compile if WANT_BOOKMARKS
  607. def c_B = 'listmark'
  608. compile endif
  609.  
  610. def c_backspace=
  611. compile if EVERSION >= '5.20'
  612.    undoaction 1, junk                -- Create a new state
  613. compile endif
  614. compile if EVERSION >= '5.50'
  615.    if .levelofattributesupport then
  616.       if (.line==.last and .line<>1) then       -- this is the last line
  617.          destinationLine=.line-1                -- and there is a previous line to store attributes on
  618.          getline prevline,DestinationLine
  619.          DestinationCol=length(prevline)+1      -- start search parameters
  620.                                                 -- destination of attributes
  621.          findoffset=-300                        -- start at the begin of the attr list
  622.          findline=.line                         -- of the first char on this line
  623.          findcolumn=1
  624.  
  625.          do forever        -- search until no more attr's (since this is last line)
  626.             FINDCLASS=0          -- 0 is anyclass
  627.             Attribute_action FIND_NEXT_ATTR_SUBOP, findclass, findoffset, findcolumn, findline
  628.             if not findclass or (findline<>.line) then  -- No attribute, or not on this line
  629.                leave
  630.             endif
  631.             query_attribute theclass,thevalue, thepush, findoffset, findcolumn, findline   -- push or pop?
  632.             if not thePush then       -- ..if its a pop attr and ..
  633.                matchClass=theClass
  634.                MatchOffset=FindOffset
  635.                MatchLine=FindLine
  636.                MatchColumn=FindColumn  -- ..and if its match is not on this line or at the destination
  637.                Attribute_Action FIND_MATCH_ATTR_SUBOP, MatchClass, MatchOffset, Matchcolumn, MatchLine
  638.                if ((Matchline==DestinationLine) and (Matchcolumn==destinationcol)) then
  639.                   -- then there is a cancellation of attributes
  640.                   Attribute_action Delete_ATTR_SUBOP, theclass, Findoffset, Findcolumn, Findline
  641.                   Attribute_action Delete_ATTR_SUBOP, Matchclass, Matchoffset, Matchcolumn, Matchline
  642.                elseif (MatchLine<>.line)  then
  643.                   -- .. then move attribute to destination (before attributes which have been scanned so its OK.)
  644.                   -- insert attr at the end of the attr list (offset=0)
  645.                   Insert_Attribute theclass, thevalue, 0, 0, DestinationCol, DestinationLine
  646.                   Attribute_action Delete_ATTR_SUBOP, theclass, Findoffset, Findcolumn, Findline
  647.                endif -- end if attr is on line or at destination
  648.             endif -- end if found attr is a pop
  649.          enddo  -- end search for attr's
  650.       elseif .line < .last then  -- put the attributes after the line since there may not
  651.                                  -- be a line before this line (as when .line==1)
  652.          DestinationCol=1
  653.          DestinationLine=.line+1         -- error point since this puts attr's after last line if .line=.last
  654.          findoffset=0                    -- cant make it .line-1 cause then present attributes there become
  655.          findline=.line                  -- after these attributes which is wrong
  656.          findcolumn=MAXCOL
  657.  
  658.          do forever
  659.             FINDCLASS=0
  660.             Attribute_action FIND_PREV_ATTR_SUBOP, findclass, findoffset, findcolumn, findline
  661.             if not findclass or (findline<>.line) then  -- No attribute, or not on this line
  662.                leave
  663.             endif
  664.              /* Move Attribute */
  665.             query_attribute theclass,thevalue, thepush, findoffset, findcolumn, findline
  666.             -- only move push/pop model attributes (tags are just deleted)
  667.             if ((thepush==0) or (thepush==1)) then
  668.                -- move attribute to destination, if cancellation delete both attributes
  669.                FastMoveAttrToBeg(theclass, thevalue, thepush, DestinationCol, DestinationLine, findcolumn, findline, findoffset)
  670.                findoffset=findoffset+1  -- since the attr rec was deleted and all attr rec's were shifted to fill the vacancy
  671.                                         -- and search is exclusive
  672.             endif
  673.          enddo
  674.       endif -- endif .line=.last and .line=1
  675.    endif -- .levelofattributesupport
  676. compile endif
  677.    delete
  678. compile if EVERSION >= '5.20'
  679.    undoaction 1, junk                -- Create a new state
  680. compile endif
  681. compile if EVERSION < 5
  682.    if command_state() then
  683.       begin_line
  684.    endif
  685. compile endif
  686.  
  687. def c_c=
  688. compile if EVERSION < 5
  689.   right
  690. compile else
  691.   'c'    -- EPM c_c is used for change next
  692. compile endif
  693.  
  694. ; Ctrl-D = word delete, thanks to Bill Brantley.
  695. def c_d =  /* delete from cursor until beginning of next word, UNDOable */
  696. compile if EVERSION < 5
  697.    if command_state() then
  698.       getcommand cmdline, begcur, cmdscrPos
  699.       lenCmdLine=length(cmdline)
  700.       if lenCmdLine >= begcur then
  701.          for i = begcur to lenCmdLine /* delete remainder of word */
  702.             if substr(cmdline,i,1)<>' ' then
  703.                deleteChar
  704.             else
  705.                leave
  706.             endif
  707.          endfor
  708.          for j = i to lenCmdLine /* delete delimiters following word */
  709.             if substr(cmdline,j,1)==' ' then
  710.                deleteChar
  711.             else
  712.                leave
  713.             endif
  714.          endfor
  715.       endif
  716.    else
  717. compile endif
  718.       getline line
  719.       begcur=.col
  720.       lenLine=length(line)
  721.       if lenLine >= begcur then
  722.          for i = begcur to lenLine /* delete remainder of word */
  723.             if substr(Line,i,1)<>' ' then
  724.                deleteChar
  725.             else
  726.                leave
  727.             endif
  728.          endfor
  729.          for j = i to lenLine /* delete delimiters following word */
  730.             if substr(Line,j,1)==' ' then
  731.                deleteChar
  732.             else
  733.                leave
  734.             endif
  735.          endfor
  736.       endif
  737. compile if EVERSION < 5
  738.    endif
  739. compile endif
  740.  
  741. compile if EVERSION >= '4.10'
  742. def c_e, c_del=erase_end_line  -- Ctrl-Del is the PM way.
  743. compile else
  744. def c_e=erase_end_line
  745. compile endif
  746.  
  747. compile if WANT_KEYWORD_HELP
  748. def c_h = 'kwhelp'
  749. compile endif
  750.  
  751. def c_end=
  752.  compile if WANT_STREAM_MODE = 'SWITCH'
  753.    universal stream_mode
  754. compile endif
  755. compile if WANT_CUA_MARKING
  756.    call begin_shift(startline, startcol, shift_flag)
  757. compile endif
  758. compile if WANT_STREAM_MODE = 'SWITCH'
  759.    if stream_mode then
  760. compile endif
  761. compile if WANT_STREAM_MODE
  762.       bottom; endline
  763. compile endif
  764. compile if WANT_STREAM_MODE = 'SWITCH'
  765.    else
  766. compile endif
  767. compile if WANT_STREAM_MODE <> 1
  768.       if .line=.last and .line then endline; endif
  769.       bottom
  770. compile endif
  771. compile if WANT_STREAM_MODE = 'SWITCH'
  772.    endif
  773. compile endif
  774. compile if WANT_CUA_MARKING
  775.    call end_shift(startline, startcol, shift_flag, 1)
  776. compile endif
  777.  
  778. compile if ENHANCED_ENTER_KEYS & C_ENTER_ACTION <> ''  -- define each key separately
  779. ; Nothing - defined below along with ENTER
  780. compile else
  781.  compile if EVERSION >= '4.10'
  782. def c_enter, c_pad_enter=     -- 4.10:  new key for enhanced keyboard
  783.  compile else
  784. def c_enter=
  785.  compile endif
  786.    call my_c_enter()
  787.  compile if E3 and SHOW_MODIFY_METHOD
  788.    call show_modify()
  789.  compile endif
  790. compile endif
  791.  
  792. def c_f=
  793. compile if defined(HIGHLIGHT_COLOR)
  794.    universal search_len
  795.  compile if EOS2
  796.    universal inKstring
  797.  compile endif
  798. compile endif
  799. compile if EVERSION > 5
  800.    sayerror 0
  801. compile endif
  802.    repeat_find       /* find next */
  803. compile if EVERSION < 5
  804.    if not rc then
  805.       cursor_data
  806.  compile if defined(HIGHLIGHT_COLOR)
  807.       refresh
  808.       sayat '', .windowy+.cursory-1,.windowx+.cursorx-1,
  809.             HIGHLIGHT_COLOR, min(search_len, .windowwidth - .cursorx + 1)
  810.   compile if EOS2
  811.       if inKstring <=0 then
  812.          k=mgetkey()
  813.          executekey k
  814.       endif
  815.   compile endif
  816.  compile endif
  817.    endif
  818. compile elseif defined(HIGHLIGHT_COLOR)
  819.    if not rc then
  820.  compile if EVERSION < '5.50'
  821.       refresh
  822.       sayat '', .cursory, .cursorx, HIGHLIGHT_COLOR, min(search_len, .windowwidth - .cursorx + 1)
  823.  compile else
  824.       circleit 1, .line, .col, .col+search_len-1, HIGHLIGHT_COLOR
  825. ;     refresh
  826.  compile endif
  827.    endif
  828. compile endif
  829.  
  830. def c_f1=
  831. compile if EVERSION < 5
  832.    call init_operation_on_commandline()
  833. compile endif
  834.    call psave_mark(save_mark)
  835.    call pmark_word()
  836.    call puppercase()
  837.    call prestore_mark(save_mark)
  838. compile if EVERSION < 5
  839.    call move_results_to_commandline()
  840. compile endif
  841.  
  842. def c_f2=
  843. compile if EVERSION < 5
  844.    call init_operation_on_commandline()
  845. compile endif
  846.    call psave_mark(save_mark)
  847.    call pmark_word()
  848.    call plowercase()
  849.    call prestore_mark(save_mark)
  850. compile if EVERSION < 5
  851.    call move_results_to_commandline()
  852. compile endif
  853.  
  854. def c_f3= call puppercase()
  855.  
  856. def c_f4= call plowercase()
  857.  
  858. def c_f5=
  859. compile if EVERSION < 5
  860.    call init_operation_on_commandline()
  861. compile endif
  862.    call pbegin_word()
  863. compile if EVERSION < 5
  864.    call move_results_to_commandline()
  865. compile endif
  866.  
  867. def c_f6=
  868. compile if EVERSION < 5
  869.    call init_operation_on_commandline()
  870. compile endif
  871.    call pend_word()
  872. compile if EVERSION < 5
  873.    call move_results_to_commandline()
  874. compile endif
  875.  
  876. compile if EPM
  877. def c_g='ring_more'
  878. compile endif
  879.  
  880. def c_home=
  881. compile if WANT_STREAM_MODE = 'SWITCH'
  882.    universal stream_mode
  883. compile endif
  884. compile if WANT_CUA_MARKING
  885.    call begin_shift(startline, startcol, shift_flag)
  886. compile endif
  887. compile if WANT_STREAM_MODE = 'SWITCH'
  888.    if stream_mode then
  889. compile endif
  890. compile if WANT_STREAM_MODE
  891.       top; begin_line
  892. compile endif
  893. compile if WANT_STREAM_MODE = 'SWITCH'
  894.    else
  895. compile endif
  896. compile if WANT_STREAM_MODE <> 1
  897.       if .line=1 then begin_line endif
  898.       top
  899. compile endif
  900. compile if WANT_STREAM_MODE = 'SWITCH'
  901.    endif
  902. compile endif
  903. compile if WANT_CUA_MARKING
  904.    call end_shift(startline, startcol, shift_flag, 0)
  905. compile endif
  906.  
  907. compile if WANT_WINDOWS
  908. def c_h=call psplith()            -- routine defined in WINDOW.E
  909. compile endif
  910.  
  911. def c_k=      -- Duplicate a line
  912.   getline line
  913.   insertline line,.line+1
  914.  
  915. def c_l =
  916.    if .line then
  917.       getline line
  918. compile if EPM
  919.       'commandline 'line
  920. compile else
  921.       if not command_state() then
  922.          cursor_command
  923.          begin_line;erase_end_line
  924.       endif
  925.       keyin line
  926. compile endif
  927.    endif
  928.  
  929. def c_left=
  930. compile if WANT_STREAM_MODE = 'SWITCH'
  931.    universal stream_mode
  932. compile endif
  933. compile if EVERSION < 5
  934.    call init_operation_on_commandline()
  935. compile endif
  936. compile if WANT_CUA_MARKING
  937.    call begin_shift(startline, startcol, shift_flag)
  938. compile endif
  939. compile if WANT_STREAM_MODE
  940.    if not .line then
  941.       begin_line
  942.  compile if WANT_STREAM_MODE = 'SWITCH'
  943.    elseif .line>1 & .col=max(1,verify(textline(.line),' ')) & stream_mode $NOT_CMD_STATE then
  944.  compile else
  945.    elseif .line>1 & .col=max(1,verify(textline(.line),' ')) $NOT_CMD_STATE then
  946.  compile endif
  947.       up; end_line
  948.    endif
  949. compile endif
  950.    backtab_word
  951. compile if EVERSION < 5
  952.    call move_results_to_commandline()
  953. compile endif
  954. compile if WANT_CUA_MARKING
  955.    call end_shift(startline, startcol, shift_flag, 0)
  956. compile endif
  957.  
  958. compile if WANT_BOOKMARKS
  959. def c_m = 'setmark'
  960. compile else  -- [The following doesn't apply to EPM.]
  961. ; This C-M definition allows external cut-and-paste utilities to
  962. ; feed text into E via the keyboard stream.  Most such utilities end each line
  963. ; of text with ASCII character 13.  This definition is needed because E
  964. ; distinguishes that as a different key (Ctrl-M) than Enter.
  965. def c_m =
  966.    insert
  967. compile endif
  968.  
  969. def c_pgup=
  970. compile if WANT_CUA_MARKING
  971.  compile if WANT_CUA_MARKING = 'SWITCH'
  972.    universal CUA_marking_switch
  973.    if CUA_marking_switch then
  974.  compile endif
  975.       unmark
  976.  compile if WANT_CUA_MARKING = 'SWITCH'
  977.    endif
  978.  compile endif
  979. compile endif
  980.    .cursory=1
  981.  
  982. def c_pgdn=
  983. compile if WANT_CUA_MARKING
  984.  compile if WANT_CUA_MARKING = 'SWITCH'
  985.    universal CUA_marking_switch
  986.    if CUA_marking_switch then
  987.  compile endif
  988.       unmark
  989.  compile if WANT_CUA_MARKING = 'SWITCH'
  990.    endif
  991.  compile endif
  992. compile endif
  993.    .cursory=.windowheight
  994.  
  995. compile if EVERSION < 5
  996. /************************************************************/
  997. /* Create a string of keys in Kstring variable.             */
  998. /* All control keys have the same character (X'00') as the  */
  999. /* first character of a two-character string.               */
  1000. /*                                                          */
  1001. /* The number of keys that may be stored is given by:       */
  1002. /*           256 > n + 2*e                                  */
  1003. /* where:                                                   */
  1004. /*       n are normal data keys (one byte from BIOS)        */
  1005. /*       e are extended code keys (two bytes from BIOS)     */
  1006. /************************************************************/
  1007. def c_r=
  1008.    universal Kstring,Kins_state,Kcom_state,inKstring
  1009.  
  1010.    inKstring=-1      /* Set recording flag; see defproc mgetkey(). */
  1011.    sayerror CTRL_R__MSG
  1012.    oldKins_state=Kins_state
  1013.    oldKstring   =Kstring
  1014.    oldKcom_state=Kcom_state
  1015.    Kins_state   =insert_state()
  1016.    Kstring      =''
  1017.    Kcom_state   =command_state()
  1018.    Kct=0
  1019.    loop
  1020.       k=getkey()
  1021.       if k==c_r then  /* Ctrl-R ? */
  1022.          sayerror REMEMBERED__MSG
  1023.          leave
  1024.       endif
  1025.       if k==c_t then  /* Ctrl-T ? */
  1026.          leave
  1027.       endif
  1028.       if k==c_c then  /* cancel? */
  1029.          Kstring   =oldKstring
  1030.          Kins_state=oldKins_state
  1031.          Kcom_state=oldKcom_state
  1032.          sayerror CANCELLED__MSG'  'OLD_KEPT__MSG
  1033.          leave
  1034.       endif
  1035.       Kstring=Kstring||k
  1036.       Kct=length(Kstring)
  1037.       executekey k         /* execute AFTER adding to string */
  1038.       if Kct > MAXCOL then
  1039.          sayerror CTRL_R_ABORT__MSG
  1040.          Kstring=oldKstring
  1041.          Kins_state=oldKins_state
  1042.          Kcom_state=oldKcom_state
  1043.          loop
  1044.             k=getkey()
  1045.             if k==esc or k==c_c then leave endif   /* accept either */
  1046.          endloop
  1047.          sayerror OLD_KEPT__MSG
  1048.          leave
  1049.       endif
  1050.    endloop
  1051.    inKstring=0       /* lower state flag */
  1052.    if k==c_t then    /* Was it Ctrl-T? */
  1053.       sayerror 0     /* refresh the function keys */
  1054.       executekey k
  1055.    endif
  1056. compile endif
  1057.  
  1058. compile if EPM
  1059. def c_r
  1060.    -- Query to see if we are already in recording
  1061.    if windowmessage(1,  getpminfo(EPMINFO_EDITCLIENT),
  1062.                     5393,
  1063.                     0,
  1064.                     0)
  1065.    then
  1066.       call windowmessage(0,  getpminfo(EPMINFO_EDITCLIENT),
  1067.                          5392,
  1068.                          0,
  1069.                          0)
  1070.       sayerror REMEMBERED__MSG
  1071.    else
  1072.       sayerror CTRL_R__MSG
  1073.       call windowmessage(0,  getpminfo(EPMINFO_EDITCLIENT),
  1074.                          5390,
  1075.                          0,
  1076.                          0)
  1077.    endif
  1078. compile endif
  1079.  
  1080. def c_right=
  1081. compile if WANT_STREAM_MODE = 'SWITCH'
  1082.    universal stream_mode
  1083. compile endif
  1084. compile if EVERSION < 5
  1085.    call init_operation_on_commandline()
  1086. compile endif
  1087. compile if WANT_CUA_MARKING
  1088.    call begin_shift(startline, startcol, shift_flag)
  1089. compile endif
  1090. compile if WANT_STREAM_MODE
  1091.    getline line
  1092.  compile if WANT_STREAM_MODE = 'SWITCH'
  1093.    if not .line | lastpos(' ',line)<.col & .line<.last & stream_mode $NOT_CMD_STATE then
  1094.  compile else
  1095.    if not .line | lastpos(' ',line)<.col & .line<.last $NOT_CMD_STATE then
  1096.  compile endif
  1097.       down
  1098.       call pfirst_nonblank()
  1099.    else
  1100. compile endif
  1101.       tab_word
  1102. compile if WANT_STREAM_MODE
  1103.    endif
  1104. compile endif
  1105. compile if EVERSION < 5
  1106.    call move_results_to_commandline()
  1107. compile endif
  1108. compile if WANT_CUA_MARKING
  1109.    call end_shift(startline, startcol, shift_flag, 1)
  1110. compile endif
  1111.  
  1112. -- Pop up Search dialog
  1113. compile if EVERSION > 5
  1114. def c_s=
  1115.    'searchdlg'
  1116. compile endif
  1117.  
  1118. compile if EVERSION < 5
  1119. /************************************************************/
  1120. /* Execute the string of keys in Kstring variable.          */
  1121. /* All control keys have the same character (X'00') as the  */
  1122. /* first character of a two-character string                */
  1123. /*                                                          */
  1124. /* The number of keys that may be stored is given by:       */
  1125. /*           256 > n + 2*e                                  */
  1126. /* where:                                                   */
  1127. /*       n are normal data keys (one byte from BIOS)        */
  1128. /*       c are extended code keys (two bytes from BIOS)     */
  1129. /************************************************************/
  1130. def c_t=
  1131.    universal Kstring,Kins_state,Kcom_state,inKstring
  1132.  
  1133.    if Kstring=='' then
  1134.       sayerror NO_CTRL_R__MSG              /* HurleyJ */
  1135.       return
  1136.    endif   /* Has a string been recorded? */
  1137.    if Kins_state/==insert_state()   then  insert_toggle endif
  1138.    if Kcom_state/==command_state() then command_toggle endif
  1139.  
  1140.    inKstring=1    /* Set replaying flag; see defproc mgetkey(). */
  1141.    loop
  1142.       k=substr(Kstring,inKstring,1)
  1143.       ksize=1
  1144.       if k==substr(esc,1,1) then       /* extended key ? */
  1145.          k=substr(Kstring,inKstring,2) /* Yes, 2 bytes for extended key. */
  1146.          ksize=2
  1147.       endif
  1148.       inKstring=inKstring+ksize        /* bump index AFTER execution */
  1149.       executekey k
  1150.       if inKstring > length(Kstring) then leave endif
  1151.    endloop
  1152.    inKstring=0
  1153. compile endif
  1154.  
  1155. compile if EPM
  1156. def c_t
  1157.    call windowmessage(0,  getpminfo(EPMINFO_EDITCLIENT),
  1158.                       5392,
  1159.                       0,
  1160.                       0)
  1161.    call windowmessage(0,  getpminfo(EPMINFO_EDITCLIENT),
  1162.                       5391,
  1163.                       0,
  1164.                       0)
  1165. compile endif
  1166.  
  1167. compile if EVERSION >= 4
  1168. def c_tab = keyin \9
  1169. compile endif
  1170.  
  1171. compile if WANT_WINDOWS
  1172. def c_v= call psplitv()           -- routine defined in WINDOW.E
  1173. def c_w= call pnextwindow()       -- routine defined in WINDOW.E
  1174. def c_z= call pzoom()             -- routine defined in WINDOW.E
  1175. compile endif
  1176.  
  1177. compile if EPM
  1178. def c_W=
  1179.    if marktype()<>'' then
  1180.       sayerror -279  -- 'Text already marked'
  1181.       return
  1182.    endif
  1183.    if find_token(startcol, endcol) then
  1184.       getfileid fid
  1185.       call pset_mark(.line, .line, startcol, endcol, 'BLOCK', fid)
  1186.    endif
  1187. compile endif
  1188.  
  1189. compile if EVERSION >= '5.50'
  1190. def c_Y = 'fontlist'
  1191. compile endif
  1192.  
  1193. def del=
  1194. compile if WANT_STREAM_MODE = 'SWITCH'
  1195.    universal stream_mode
  1196. compile endif
  1197. compile if WANT_CUA_MARKING & EPM
  1198.  compile if WANT_CUA_MARKING = 'SWITCH'
  1199.    universal CUA_marking_switch
  1200.    if marktype() & CUA_marking_switch then    -- If there's a mark, then
  1201.  compile else
  1202.    if marktype() then    -- If there's a mark, then
  1203.  compile endif
  1204.       if process_mark_like_cua() then return; endif
  1205.    endif
  1206. compile endif
  1207. compile if WANT_STREAM_MODE
  1208.    if .line then
  1209.       l=length(textline(.line))
  1210.    else
  1211.       l=.col    -- make the following IF fail
  1212.    endif
  1213.  compile if WANT_STREAM_MODE = 'SWITCH'
  1214.    if .col>l & stream_mode $NOT_CMD_STATE then
  1215.  compile else
  1216.    if .col>l $NOT_CMD_STATE then
  1217.  compile endif
  1218.       join
  1219.       .col=l+1
  1220.    else
  1221. compile endif  -- WANT_STREAM_MODE
  1222. compile if EVERSION >= '5.50'
  1223.       old_level = .levelofattributesupport
  1224.       if old_level & not (old_level%2 - 2*(old_level%4)) then
  1225.          .levelofattributesupport = .levelofattributesupport + 2
  1226.          .cursoroffset = 0
  1227.       endif
  1228. compile endif
  1229.       delete_char
  1230. compile if EVERSION >= '5.50'
  1231.       .levelofattributesupport = old_level
  1232. compile endif
  1233. compile if WANT_STREAM_MODE
  1234.    endif
  1235. compile endif
  1236.  
  1237. def down=
  1238. compile if WANT_CUA_MARKING
  1239.  compile if WANT_CUA_MARKING = 'SWITCH'
  1240.    universal CUA_marking_switch
  1241.    if CUA_marking_switch then
  1242.  compile endif
  1243.       unmark
  1244.  compile if WANT_CUA_MARKING = 'SWITCH'
  1245.    endif
  1246.  compile endif
  1247. compile endif
  1248. compile if WANT_STREAM_MODE
  1249.    call updownkey(1)
  1250. compile else
  1251.    down
  1252. compile endif
  1253.  
  1254. compile if WANT_CUA_MARKING & EPM
  1255. def s_down=
  1256.  compile if WANT_CUA_MARKING = 'SWITCH'
  1257.    universal CUA_marking_switch
  1258.  compile endif
  1259.    startline = .line; startcol = .col
  1260. compile if WANT_STREAM_MODE
  1261.    call updownkey(1)
  1262. compile else
  1263.    down
  1264. compile endif
  1265. ;compile if WANT_CUA_MARKING = 'SWITCH'
  1266. ;  if CUA_marking_switch then
  1267. ;compile endif
  1268.    if startline then call extend_mark(startline, startcol, 1); endif
  1269. ;compile if WANT_CUA_MARKING = 'SWITCH'
  1270. ;  endif
  1271. ;compile endif
  1272. compile endif
  1273.  
  1274. def end=
  1275. compile if WANT_CUA_MARKING
  1276.  compile if WANT_CUA_MARKING = 'SWITCH'
  1277.    universal CUA_marking_switch
  1278.    if CUA_marking_switch then
  1279.  compile endif
  1280.       unmark
  1281.  compile if WANT_CUA_MARKING = 'SWITCH'
  1282.    endif
  1283.  compile endif
  1284. compile endif
  1285.    end_line
  1286.  
  1287. compile if WANT_CUA_MARKING & EPM
  1288. def s_end =
  1289.    startline = .line; startcol = .col
  1290.    end_line
  1291.    call extend_mark(startline, startcol, 1)
  1292. compile endif
  1293.  
  1294. compile if ENHANCED_ENTER_KEYS & ENTER_ACTION <> ''  -- define each key separately
  1295. def enter =
  1296.    universal enterkey
  1297.  compile if WANT_EPM_SHELL & EPM_SHELL_PROMPT = '@prompt epm: $p $g'
  1298.    if leftstr(.filename, 15) = ".command_shell_" then
  1299.       shellnum=substr(.filename,16)
  1300.       getline line
  1301.       x = pos('>',line)
  1302.       text = substr(line,x+1)
  1303.       if leftstr(line,5)='epm: ' & x & shellnum & text<>'' then
  1304.          if .line=.last then .col=x+1; erase_end_line; endif
  1305.          'shell_write' shellnum text
  1306.       else
  1307.          call enter_common(enterkey)
  1308.       endif
  1309.    else
  1310.  compile endif
  1311.       call enter_common(enterkey)
  1312.  compile if WANT_EPM_SHELL & EPM_SHELL_PROMPT = '@prompt epm: $p $g'
  1313.   endif
  1314.  compile endif
  1315. def a_enter =
  1316.    universal a_enterkey
  1317.    call enter_common(a_enterkey)
  1318. def c_enter =
  1319.    universal c_enterkey
  1320.    call enter_common(c_enterkey)
  1321. def s_enter =
  1322.    universal s_enterkey
  1323.    call enter_common(s_enterkey)
  1324. def padenter =
  1325.    universal padenterkey
  1326.    call enter_common(padenterkey)
  1327. def a_padenter =
  1328.    universal a_padenterkey
  1329.    call enter_common(a_padenterkey)
  1330. def c_padenter =
  1331.    universal c_padenterkey
  1332.    call enter_common(c_padenterkey)
  1333. def s_padenter =
  1334.    universal s_padenterkey
  1335.    call enter_common(s_padenterkey)
  1336. compile else
  1337.  compile if EVERSION >= '4.10'
  1338.   compile if EVERSION < 5
  1339. def enter, pad_enter, a_enter, a_pad_enter=  --4.10: new enhanced keyboard keys
  1340.   compile else
  1341. def enter, pad_enter, a_enter, a_pad_enter, s_enter, s_padenter=
  1342.   compile endif
  1343.  compile else
  1344. def enter=
  1345.  compile endif
  1346.  compile if WANT_EPM_SHELL & EPM_SHELL_PROMPT = '@prompt epm: $p $g'
  1347.    if leftstr(.filename, 15) = ".command_shell_" then
  1348.       shellnum=substr(.filename,16)
  1349.       getline line
  1350.       x = pos('>',line)
  1351.       text = substr(line,x+1)
  1352.       if leftstr(line,5)='epm: ' & x & shellnum & text<>'' then
  1353.          if .line=.last then .col=x+1; erase_end_line; endif
  1354.          'shell_write' shellnum text
  1355.       else
  1356.          call my_enter()
  1357.       endif
  1358.    else
  1359.  compile endif
  1360.    call my_enter()
  1361.  compile if E3 and SHOW_MODIFY_METHOD
  1362.    call show_modify()
  1363.  compile endif
  1364.  compile if WANT_EPM_SHELL & EPM_SHELL_PROMPT = '@prompt epm: $p $g'
  1365.   endif
  1366.  compile endif
  1367. compile endif  -- ENHANCED_ENTER_KEYS & ENTER_ACTION <> ''
  1368.  
  1369. compile if not defined(NO_ESCAPE)
  1370.    const NO_ESCAPE = 0
  1371. compile endif
  1372.  
  1373. compile if EVERSION < 5
  1374. def esc=
  1375.    command_toggle
  1376.  compile if E3 and SHOW_MODIFY_METHOD
  1377.    call show_modify()
  1378.  compile endif
  1379. compile else  -- else EPM
  1380.  compile if NO_ESCAPE  -- Blame CUA  :-(
  1381. def esc=
  1382.   compile if TOGGLE_ESCAPE
  1383.    universal ESCAPE_KEY
  1384.   compile endif
  1385.  compile else
  1386. def esc, C_I=
  1387.  compile endif
  1388.    universal alt_R_active
  1389.  
  1390.    sayerror 0
  1391.    if alt_R_active<>'' then
  1392.  compile if EVERSION < '5.21'
  1393.       .messageline=''                        -- Turn off the message.
  1394.  compile else
  1395.        'setmessageline '\0
  1396.  compile endif
  1397.  compile if EVERSION >= '5.53'
  1398.       'toggleframe 2 'alt_R_active         -- Restore status of messageline.
  1399.  compile else
  1400.       'togglecontrol 8 'alt_R_active         -- Restore status of messageline.
  1401.  compile endif
  1402.       alt_R_active = ''
  1403.  compile if NO_ESCAPE
  1404.   compile if TOGGLE_ESCAPE
  1405.    elseif ESCAPE_KEY then
  1406.       'commandline'
  1407.   compile endif
  1408.    endif
  1409. def c_I='commandline'
  1410.  compile else
  1411.    else
  1412.       'commandline'
  1413.    endif
  1414.  compile endif  -- no Escape
  1415. compile endif  -- EPM
  1416.  
  1417. def f1= 'help'
  1418.  
  1419. def f2=
  1420. compile if SMARTSAVE
  1421.    if .modify then           -- Modified since last Save?
  1422.       'Save'                 --   Yes - save it
  1423.    else
  1424.  compile if EPM
  1425.       'commandline Save '
  1426.  compile else
  1427.       if not command_state() then
  1428.          cursor_command
  1429.       endif
  1430.       begin_line;erase_end_line
  1431.       keyin 'Save '
  1432.  compile endif
  1433.       sayerror 'No changes.  Press Enter to Save anyway.'
  1434.    endif
  1435. compile else
  1436.    'Save'
  1437. compile endif
  1438.  
  1439. def f3= 'quit'
  1440.  
  1441. def f4=
  1442. compile if SMARTFILE
  1443.    if .modify then           -- Modified since last Save?
  1444.       'File'                 --   Yes - save it and quit.
  1445.    else
  1446.       'Quit'                 --   No - just quit.
  1447.    endif
  1448. compile else
  1449.    'File'
  1450. compile endif
  1451.  
  1452. compile if EVERSION < 5
  1453. def f7=cursor_command; delete; begin_line; keyin 'Name '
  1454. def f8=cursor_command; delete; begin_line; keyin 'Edit '
  1455. compile else
  1456.                     /* keys by EPM */
  1457. def f5, c_O='OPENDLG'
  1458. def f7='rename'
  1459. def f8=
  1460.  compile if RING_OPTIONAL
  1461.    universal ring_enabled
  1462.    if not ring_enabled then
  1463.       sayerror NO_RING__MSG
  1464.       return
  1465.    endif
  1466.  compile endif
  1467.    'OPENDLG EDIT'
  1468. compile endif
  1469.  
  1470. compile if EVERSION < 5
  1471. def f9=undo
  1472. compile else
  1473. def f9, a_backspace = undo
  1474. compile endif
  1475.  
  1476.  
  1477. compile if EVERSION < 5
  1478.  compile if EVERSION < '4.10'          -- Early E doesn't support enh. kbd.
  1479. def f10,c_N= call pnextfile()             -- routine defined in WINDOW.E
  1480.  compile else
  1481. def f10,f12,c_N= call pnextfile()         -- routine defined in WINDOW.E
  1482.  compile endif
  1483. compile else
  1484. def f10,f12,c_N=   -- F10 is usual E default; F12 for enhanced kbd, c_N for EPM.
  1485.    nextfile
  1486. compile endif
  1487.  
  1488.  
  1489. def home =
  1490. compile if WANT_CUA_MARKING
  1491.  compile if WANT_CUA_MARKING = 'SWITCH'
  1492.    universal CUA_marking_switch
  1493.    if CUA_marking_switch then
  1494.  compile endif
  1495.       unmark
  1496.  compile if WANT_CUA_MARKING = 'SWITCH'
  1497.    endif
  1498.  compile endif
  1499. compile endif
  1500.    begin_line
  1501.  
  1502. compile if WANT_CUA_MARKING & EPM
  1503. def s_home =
  1504.    startline = .line; startcol = .col
  1505.    begin_line
  1506.    call extend_mark(startline, startcol, 0)
  1507. compile endif
  1508.  
  1509. def ins=insert_toggle
  1510. compile if EVERSION >='5.50'
  1511.    call fixup_cursor()
  1512. compile endif
  1513.  
  1514. def left=
  1515. compile if WANT_CUA_MARKING = 'SWITCH'
  1516.    universal CUA_marking_switch
  1517. compile endif
  1518. compile if WANT_STREAM_MODE = 'SWITCH'
  1519.    universal stream_mode
  1520.    if .line>1 & .col=1 & stream_mode $NOT_CMD_STATE then up; end_line; else left; endif
  1521. compile elseif WANT_STREAM_MODE
  1522.    if .line>1 & .col=1 $NOT_CMD_STATE then up; end_line; else left; endif
  1523. compile else
  1524.    left
  1525. compile endif
  1526. compile if WANT_CUA_MARKING
  1527.  compile if WANT_CUA_MARKING = 'SWITCH'
  1528.    if CUA_marking_switch then
  1529.  compile endif
  1530.       unmark
  1531.  compile if WANT_CUA_MARKING = 'SWITCH'
  1532.    endif
  1533.  compile endif
  1534. compile endif
  1535.  
  1536. compile if WANT_CUA_MARKING & EPM
  1537. def s_left =
  1538.    startline = .line; startcol = .col
  1539.    if .line>1 & .col=1 then up; end_line; else left; endif
  1540.    call extend_mark(startline, startcol, 0)
  1541. compile endif
  1542.  
  1543. compile if EVERSION < 5
  1544. def padminus=keyin '-'
  1545. def padplus=keyin '+'
  1546.  compile if EVERSION >= '4.10'
  1547. def padslash, c_padslash =keyin '/'     -- 4.10 for enhanced keyboard
  1548.  compile endif
  1549. def padstar=keyin '*'
  1550. compile endif
  1551. def pgup =
  1552. compile if WANT_CUA_MARKING
  1553.  compile if WANT_CUA_MARKING = 'SWITCH'
  1554.    universal CUA_marking_switch
  1555.    if CUA_marking_switch then
  1556.  compile endif
  1557.       unmark
  1558.  compile if WANT_CUA_MARKING = 'SWITCH'
  1559.    endif
  1560.  compile endif
  1561. compile endif
  1562.    page_up
  1563.  
  1564. def pgdn =
  1565. compile if WANT_CUA_MARKING
  1566.  compile if WANT_CUA_MARKING = 'SWITCH'
  1567.    universal CUA_marking_switch
  1568.    if CUA_marking_switch then
  1569.  compile endif
  1570.       unmark
  1571.  compile if WANT_CUA_MARKING = 'SWITCH'
  1572.    endif
  1573.  compile endif
  1574. compile endif
  1575.    page_down
  1576.  
  1577. def right=
  1578. compile if WANT_STREAM_MODE = 'SWITCH'
  1579.    universal stream_mode
  1580. compile endif
  1581. compile if WANT_CUA_MARKING
  1582.  compile if WANT_CUA_MARKING = 'SWITCH'
  1583.    universal CUA_marking_switch
  1584.    if CUA_marking_switch then
  1585.  compile endif
  1586.       unmark
  1587.  compile if WANT_CUA_MARKING = 'SWITCH'
  1588.    endif
  1589.  compile endif
  1590. compile endif
  1591. compile if WANT_STREAM_MODE
  1592.    if .line then l=length(textline(.line)); else l=.col; endif
  1593.  compile if WANT_STREAM_MODE = 'SWITCH'
  1594.    if .line<.last & .col>l & stream_mode $NOT_CMD_STATE then
  1595.  compile else
  1596.    if .line<.last & .col>l $NOT_CMD_STATE then
  1597.  compile endif
  1598.       down; begin_line
  1599.  compile if WANT_STREAM_MODE = 'SWITCH'
  1600.    elseif .line=.last & .col>l & stream_mode $NOT_CMD_STATE then   -- nop
  1601.  compile else
  1602.    elseif .line=.last & .col>l $NOT_CMD_STATE then  -- nop
  1603.  compile endif
  1604.    else
  1605.       right
  1606.    endif
  1607. compile else
  1608.    right
  1609. compile endif
  1610.  
  1611. compile if WANT_CUA_MARKING & EPM
  1612. def s_right =
  1613.    startline = .line; startcol = .col
  1614.    if .line then l=length(textline(.line)); else l=.col; endif
  1615.    if .line<.last & .col>l then
  1616.       down; begin_line
  1617.    elseif .line<>.last | .col<=l then
  1618.       right
  1619.    endif
  1620.    call extend_mark(startline, startcol, 1)
  1621. compile endif
  1622.  
  1623.  
  1624. def s_f1= /* scroll left */
  1625. compile if WANT_CUA_MARKING
  1626.  compile if WANT_CUA_MARKING = 'SWITCH'
  1627.    universal CUA_marking_switch
  1628.    if CUA_marking_switch then
  1629.  compile endif
  1630.       unmark
  1631.  compile if WANT_CUA_MARKING = 'SWITCH'
  1632.    endif
  1633.  compile endif
  1634. compile endif
  1635.    oldcursorx=.cursorx
  1636.    if .col-.cursorx then
  1637.       .col=.col-.cursorx
  1638.       .cursorx=oldcursorx
  1639.    elseif .cursorx>1 then
  1640.       left
  1641.    endif
  1642.  
  1643. def s_f2= /* scroll right */
  1644. compile if WANT_CUA_MARKING
  1645.  compile if WANT_CUA_MARKING = 'SWITCH'
  1646.    universal CUA_marking_switch
  1647.    if CUA_marking_switch then
  1648.  compile endif
  1649.       unmark
  1650.  compile if WANT_CUA_MARKING = 'SWITCH'
  1651.    endif
  1652.  compile endif
  1653. compile endif
  1654.   oldcursorx=.cursorx
  1655.   a=.col+.windowwidth-.cursorx+1
  1656.   if a<=MAXCOL then
  1657.      .col=a
  1658.      .cursorx=oldcursorx
  1659.   elseif .col<MAXCOL then
  1660.      right
  1661.   endif
  1662.  
  1663. def s_f3= /* scroll up */
  1664. compile if WANT_CUA_MARKING
  1665.  compile if WANT_CUA_MARKING = 'SWITCH'
  1666.    universal CUA_marking_switch
  1667.    if CUA_marking_switch then
  1668.  compile endif
  1669.       unmark
  1670.  compile if WANT_CUA_MARKING = 'SWITCH'
  1671.    endif
  1672.  compile endif
  1673. compile endif
  1674.   oldcursory=.cursory
  1675.   if .line-.cursory>-1 then
  1676.      .cursory=1
  1677.      up
  1678.      .cursory=oldcursory
  1679.   elseif .line then
  1680.      up
  1681.   endif
  1682.  
  1683. def s_f4= /* scroll down */
  1684. compile if WANT_CUA_MARKING
  1685.  compile if WANT_CUA_MARKING = 'SWITCH'
  1686.    universal CUA_marking_switch
  1687.    if CUA_marking_switch then
  1688.  compile endif
  1689.       unmark
  1690.  compile if WANT_CUA_MARKING = 'SWITCH'
  1691.    endif
  1692.  compile endif
  1693. compile endif
  1694.    oldcursory=.cursory
  1695.    if .line -.cursory+.windowheight<.last then
  1696.       .cursory=.windowheight
  1697.       down
  1698.       .cursory=oldcursory
  1699.    elseif .line<.last then
  1700.       down
  1701.    endif
  1702.  
  1703. def s_f5= /* center current line */
  1704. compile if WANT_CUA_MARKING
  1705.  compile if WANT_CUA_MARKING = 'SWITCH'
  1706.    universal CUA_marking_switch
  1707.    if CUA_marking_switch then
  1708.  compile endif
  1709.       unmark
  1710.  compile if WANT_CUA_MARKING = 'SWITCH'
  1711.    endif
  1712.  compile endif
  1713. compile endif
  1714.    oldline=.line
  1715.    .cursory=.windowheight%2
  1716.    oldline
  1717.  
  1718. compile if EVERSION < 5
  1719. def s_pad5=keyin '5'
  1720. compile endif
  1721.  
  1722. def s_tab=
  1723.    universal matchtab_on
  1724. compile if WANT_CUA_MARKING
  1725.  compile if WANT_CUA_MARKING = 'SWITCH'
  1726.    universal CUA_marking_switch
  1727.    if CUA_marking_switch then
  1728.  compile endif
  1729.       unmark
  1730.  compile if WANT_CUA_MARKING = 'SWITCH'
  1731.    endif
  1732.  compile endif
  1733. compile endif
  1734. compile if EVERSION < 5
  1735.    call init_operation_on_commandline()
  1736. compile endif
  1737.    if matchtab_on & .line>1 $NOT_CMD_STATE then
  1738.       up
  1739.       backtab_word
  1740.       down
  1741.    else
  1742.       backtab
  1743.    endif
  1744. compile if EVERSION < 5
  1745.    call move_results_to_commandline()
  1746. compile endif
  1747.  
  1748. compile if EPM
  1749. def space, s_space, c_space  /* New in EPM.  Space is a virtual key under PM.*/
  1750.  compile if WANT_CUA_MARKING
  1751.   compile if WANT_CUA_MARKING = 'SWITCH'
  1752.    universal CUA_marking_switch
  1753.    if CUA_marking_switch then
  1754.   compile endif
  1755.       call process_mark_like_cua()
  1756.   compile if WANT_CUA_MARKING = 'SWITCH'
  1757.    endif
  1758.   compile endif
  1759.  compile endif
  1760.  compile if EVERSION >= '5.20'
  1761.    k=lastkey(1)
  1762.  compile endif
  1763.    keyin ' '
  1764.  compile if EVERSION >= '5.20'
  1765.    if k<>' ' then
  1766.       undoaction 1, junk                -- Create a new state
  1767.    endif
  1768.  compile endif
  1769. compile endif
  1770.  
  1771. def tab=
  1772. compile if WANT_STREAM_MODE = 'SWITCH'
  1773.    universal stream_mode
  1774. compile endif
  1775.    universal matchtab_on
  1776. compile if TOGGLE_TAB
  1777.    universal TAB_KEY
  1778. compile endif
  1779. compile if WANT_CUA_MARKING = 'SWITCH'
  1780.    universal CUA_marking_switch
  1781. compile endif     -------Start of logic:
  1782. compile if TOGGLE_TAB
  1783.    if TAB_KEY then
  1784.  compile if WANT_CUA_MARKING
  1785.   compile if WANT_CUA_MARKING = 'SWITCH'
  1786.       if CUA_marking_switch then
  1787.   compile endif
  1788.           process_key(\9)
  1789.   compile if WANT_CUA_MARKING = 'SWITCH'
  1790.       else
  1791.   compile endif
  1792.  compile endif  -- WANT_CUA_MARKING
  1793.          keyin \9
  1794.  compile if WANT_CUA_MARKING = 'SWITCH'
  1795.       endif
  1796.  compile endif
  1797.    else
  1798. compile endif  -- TOGGLE_TAB
  1799. compile if WANT_CUA_MARKING
  1800.  compile if WANT_CUA_MARKING = 'SWITCH'
  1801.    if CUA_marking_switch then
  1802.  compile endif
  1803.       unmark
  1804.  compile if WANT_CUA_MARKING = 'SWITCH'
  1805.    endif
  1806.  compile endif
  1807. compile endif
  1808. compile if EVERSION < 5
  1809.    call init_operation_on_commandline()
  1810. compile endif
  1811.    oldcol=.col
  1812.    if matchtab_on and .line>1 $NOT_CMD_STATE then
  1813.       up
  1814.       c=.col
  1815.       tab_word
  1816.       if oldcol>=.col then
  1817.          .col=oldcol
  1818.          tab
  1819.       endif
  1820.       down
  1821.    else
  1822.       tab
  1823.    endif
  1824. compile if WANT_STREAM_MODE
  1825.  compile if WANT_STREAM_MODE = 'SWITCH'
  1826.    if insertstate() & stream_mode $NOT_CMD_STATE then
  1827.  compile else
  1828.    if insertstate() $NOT_CMD_STATE then
  1829.  compile endif
  1830.       numspc=.col-oldcol
  1831.       if numspc>0 then
  1832.          .col=oldcol
  1833.          keyin substr('',1,numspc)
  1834.       endif
  1835.    endif
  1836. compile endif
  1837. compile if EVERSION < 5
  1838.    call move_results_to_commandline()
  1839. compile endif
  1840. compile if TOGGLE_TAB
  1841.    endif
  1842. compile endif  -- TOGGLE_TAB
  1843.  
  1844.  
  1845. def up=
  1846. compile if WANT_CUA_MARKING
  1847.  compile if WANT_CUA_MARKING = 'SWITCH'
  1848.    universal CUA_marking_switch
  1849.    if CUA_marking_switch then
  1850.  compile endif
  1851.       unmark
  1852.  compile if WANT_CUA_MARKING = 'SWITCH'
  1853.    endif
  1854.  compile endif
  1855. compile endif
  1856. compile if WANT_STREAM_MODE
  1857.    call updownkey(0)
  1858. compile else
  1859.    up
  1860. compile endif
  1861. compile if not TOP_OF_FILE_VALID
  1862.    if not .line then '+1'; endif
  1863. compile endif
  1864.  
  1865. compile if WANT_CUA_MARKING & EPM
  1866. def s_up=
  1867.  compile if WANT_CUA_MARKING = 'SWITCH'
  1868.    universal CUA_marking_switch
  1869.  compile endif
  1870.    startline = .line; startcol = .col
  1871.  compile if WANT_STREAM_MODE
  1872.    call updownkey(0)
  1873.  compile else
  1874.    up
  1875.  compile endif
  1876. ;compile if WANT_CUA_MARKING = 'SWITCH'
  1877. ;  if CUA_marking_switch then
  1878. ;compile endif
  1879.    if .line then call extend_mark(startline, startcol, 0); endif
  1880. ;compile if WANT_CUA_MARKING = 'SWITCH'
  1881. ;  endif
  1882. ;compile endif
  1883.  compile if not TOP_OF_FILE_VALID
  1884.    if not .line then '+1'; endif
  1885.  compile endif
  1886. compile endif
  1887.  
  1888. compile if EPM  -- Standard PM clipboard functions.
  1889. def s_del = 'cut'
  1890.  
  1891. def s_ins =
  1892.  compile if WANT_CUA_MARKING = 'SWITCH'
  1893.    universal CUA_marking_switch
  1894.    if CUA_marking_switch then
  1895.  compile endif
  1896.  compile if WANT_CUA_MARKING
  1897.       call process_mark_like_cua()
  1898.  compile endif
  1899.  compile if WANT_CUA_MARKING = 'SWITCH'
  1900.    endif
  1901.  compile endif
  1902.    'paste' DEFAULT_PASTE
  1903.  
  1904. def c_ins = 'copy2clip'
  1905. compile endif
  1906.  
  1907. compile if WANT_STREAM_MODE
  1908. defproc updownkey(down_flag)
  1909.    universal save_cursor_column
  1910.  compile if WANT_STREAM_MODE = 'SWITCH'
  1911.    universal stream_mode
  1912.    if stream_mode then
  1913.  compile endif
  1914.       lk = lastkey(1)
  1915.  compile if EPM
  1916.       updn = pos(leftstr(lk,1),\x18\x16) & pos(substr(lk,2,1),\x02\x0A\x12)   -- VK_DOWN or VK_UP, plain or Shift or Ctrl
  1917.  compile else
  1918.       updn = substr(lk,1,1)=\0 & pos(substr(lk,2,1),\x48\x50\x98\xA0\x8d\x91) -- Up, down, a_up, a_down, c_up, c_down
  1919.  compile endif
  1920.       if not updn then save_cursor_column = .col; endif
  1921.  compile if WANT_STREAM_MODE = 'SWITCH'
  1922.    endif
  1923.  compile endif
  1924.  
  1925.    if down_flag then down else up endif
  1926.  
  1927.  compile if WANT_STREAM_MODE = 'SWITCH'
  1928.    if .line & stream_mode then
  1929.  compile else
  1930.    if .line then
  1931.  compile endif
  1932.       l = length(textline(.line))
  1933.       if updn & l>=save_cursor_column then
  1934.          .col = save_cursor_column
  1935.       elseif updn | l<.col then
  1936.          end_line
  1937.       endif
  1938.    endif
  1939. compile endif  -- WANT_STREAM_MODE
  1940.  
  1941. /* ------ Keys unused in standard E ------------------------------------------
  1942.  
  1943. a_2, a_3, a_5, a_6, a_7, a_8, a_9
  1944.  
  1945. a_f2, a_f3, a_f4, a_f5, a_f6, a_f9
  1946.  
  1947. a_g, a_h, a_i, a_k, a_q, a_v
  1948.  
  1949. c_6, c_minus, c_backslash
  1950.  
  1951. c_leftbracket, c_rightbracket, (EOS2 only:) a_leftbracket, a_rightbracket
  1952.  
  1953. c_f9, c_f10
  1954.  
  1955. c_g, c_i, c_j, c_prtsc, c_q, c_u
  1956.  
  1957. f5
  1958.  
  1959. s_f6, s_f7, s_f8, s_f9, s_f10
  1960.  
  1961. -----  The following is for EOS2 4.10 or above only.  -----
  1962.  
  1963. New keys that work on even older unenhanced AT keyboards:
  1964.    c_up, c_down
  1965.    pad5, c_pad5
  1966.    c_padminus, c_padplus, c_padstar
  1967.    c_ins, c_del
  1968.    c_tab, a_tab
  1969.    a_leftbracket, a_rightbracket
  1970.  
  1971. On an enhanced keyboard only:
  1972.    f11, f12, and c_,s_,a_
  1973.    pad_enter               is defined the same as enter
  1974.    a_enter and a_padenter are defined the same as enter
  1975.    c_pad_enter             is defined the same as c_enter
  1976.    pad_slash               is defined the same as '/'
  1977.    c_padslash              is defined the same as '/'
  1978.  
  1979. -----  The following is for EPM only.  -----
  1980.   * Since we are using only keys defined by PM (and not looking at
  1981.     scan codes), we no longer have the keys:
  1982.       padplus, c_padplus, c_padstar
  1983.       pad_slash, c_padslash
  1984.       pad5, c_pad5
  1985.    * We gained the new keys:
  1986.     - space, s_space, c_space, and a_space
  1987.          (The space bar is a virtual key to PM, not a character key.  If you
  1988.          want to bind an action to the space key, write  def space=  instead of
  1989.          the old  def ' '= .  The good news is that you get all the shift
  1990.          states of the space bar, although alt_space is preempted by PM.)
  1991.     - c_1 through c_0
  1992.          (So now we have a complete set of alt- and ctrl-digits.)
  1993. ---------------------------------------------------------------------------- */
  1994.  
  1995.