home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / AP / JED / JED097-1.TAR / jed / lib / dcl.sl < prev    next >
Encoding:
Text File  |  1994-12-12  |  2.5 KB  |  113 lines

  1. % dcl mode--  Special mode to facilitate editing of DCL files on VMS systems.
  2. %
  3.  
  4. . ( [goal] 3 =goal
  5.  
  6. .   push_spot
  7. .   {1 up}
  8. .    {
  9. .       eol trim
  10. .       bol skip_white 
  11. .       '$' looking_at_char
  12. .          { "$\t " skip_chars
  13. .        '!' looking_at_char {what_column =goal break} !if
  14. .      } 
  15. .      {
  16. .        '!' looking_at_char 
  17. .           {
  18.              % This takes care of running text following something
  19.          % like type sys$input
  20. .              push_spot
  21. .              1 up eol bolp not and
  22. .            {trim 1 left pop 
  23. .             '-' looking_at_char 
  24. .               { pop_spot what_column =goal break} !if
  25. .            } if
  26. .          pop_spot
  27. .           } !if
  28. .      } else
  29. .    }
  30. .   while
  31.   
  32. .   {"then" looking_at {2 +=goal 1} {0} else}
  33. .   {"else" looking_at {2 +=goal 1} {0} else}
  34. .   orelse pop  % orelse puts final value on stack
  35. .   pop_spot
  36.   
  37. .   bol "$\t " skip_chars
  38. .   {"else" looking_at {2 -=goal 1} {0} else}
  39. .   {"endif" looking_at {2 -=goal 1} {0} else}
  40. .   orelse pop
  41. .   goal 1 > {goal}{3} else
  42. . ) dcl_get_ind
  43.  
  44.  
  45. . (
  46. .    [goal]  
  47. .    push_spot
  48. .    dcl_get_ind =goal
  49.    
  50. .    push_spot
  51. .    1 up {eol trim bolp {1 left pop '-' looking_at_char {2 +=goal} if} !if} if
  52. .    pop_spot
  53.    
  54. .    bol "\t $" skip_chars
  55. .    '!' looking_at_char 
  56. .      { "\t " bskip_chars trim goal what_column - whitespace} 
  57. .    !if 
  58. .    pop_spot
  59. .    skip_white
  60. . )  dcl_indent
  61.  
  62.  
  63. . ( [cont p] 0 =cont
  64. .   bobp bolp '$' looking_at_char and or {"$ \n" insert 1 left pop return} if
  65. .   trim
  66. .   push_spot 
  67.   % If line does not start with '$', assume something like 
  68.   % type sys$input going on and do not give dollar
  69. .   push_spot bol
  70. .   '$' looking_at_char not 1 up and
  71. .     {
  72. .        bolp eol trim
  73. .        1 left pop 
  74. .        what_char '-' != =cont
  75. .     } 
  76. .   if
  77. .   pop_spot
  78.   
  79. .   cont {
  80. .     POINT =p "sys$input" bfind 
  81. .       { 9 right pop 
  82. .         ':' what_char == {1 right pop} if 
  83. .     POINT p == =cont
  84. .       } if
  85. .     p =POINT
  86. .   } !if
  87.   
  88. .   bolp {1 left pop 
  89. .         '-' looking_at_char { 1 =cont} if
  90. .        } 
  91. .       !if
  92. .   pop_spot
  93. .   newline
  94. .   cont {'$' insert_char} !if
  95. .   dcl_indent
  96. . ) dcl_newline
  97.         
  98.  
  99. . "DCL_Mode" is_defined 
  100. .    {  
  101. .       [DCL_Mode] "DCL" =DCL_Mode
  102. .       DCL_Mode make_keymap
  103. .       "dcl_newline" "^M" DCL_Mode definekey
  104. .       "newline_and_indent"  "^[^M" DCL_Mode definekey
  105. .       "dcl_indent" "^I"  DCL_Mode definekey
  106. .       "self_insert_cmd" "\"" DCL_Mode definekey
  107. .       "self_insert_cmd" "'" DCL_Mode definekey
  108. .    }
  109. .   !if
  110.  
  111. . ( "DCL" use_keymap "dcl" 4 setmode ) dcl_mode
  112.  
  113.