From:	CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 15-AUG-1988 07:44
To:	ARISIA::EVERHART
Subj:	No Subject


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Fri, 12 AUG 88 18:23:52 PDT
Received: from hac2arpa.hac.com by KL.SRI.COM with TCP; Fri, 12 Aug 88 14:23:03 PDT
Received: by hac2arpa.hac.com (3.2/SMI-DDN)
	id AA10324; Fri, 12 Aug 88 14:28:23 PDT
Date: Fri, 12 Aug 88 14:28:23 PDT
From: prshao@hac2arpa.hac.com (Portia R. Shao)
Message-Id: <8808122128.AA10324@hac2arpa.hac.com>
To: info-vax@kl.sri.com

$Part2:
$ File_is="EDTPLUS.2"
$ Check_Sum_is=1090720410
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X!
XProcedure overlay_rect
XLOCAL col,counter,end_ins,extract_buff,ins_mark,linelen,llen,numlines,
X  numlines_added,start_ins,tabs,tabsearch,temp,temp_range,tflag;
X  on_error
X  endon_error
X  set (bell,all,on);
X  extract_buff:=eve$find_buffer("EXTRACT");
X  if (extract_buff<>0) then 
X    numlines:=get_info(extract_buff,"record_count");
X    if (numlines<>0) then 
X      col:=current_offset+1;
X      move_horizontal(1-col);
X      tflag:=0;
X      if (mark(none)=end_of(current_buffer)) then
X        tflag:=1;
X        split_line;
X        move_vertical(-1);
X      endif;
X      start_ins:=mark(none);
X      counter:=0;
X      numlines_added:=0;
X      loop
X        exitif (counter=numlines);
X        if (mark(none)=end_of(current_buffer)) then
X          split_line;
X          numlines_added:=numlines_added+1;
X        else
X          move_vertical(+1);
X        endif;
X        counter:=counter+1;
X      endloop;
X      end_ins:=mark(none);
X      if tflag=1 then
X        move_vertical(-1);
X        erase_line;
X      endif;
X      position(beginning_of(extract_buff));
X      linelen:=length(current_line);
X      position(start_ins);
X      tabsearch:=search(ascii(9),forward);
X      if tabsearch=0 then 
X        tabs:=0;
X      else
X        if beginning_of(tabsearch)>=end_ins then
X          tabs:=0;
X        else
X          tabs:=1;
X        endif;
X      endif;
X      if (tabs=0) then !no tabs in inserting range
X        counter:=0;
X        loop
X          exitif (counter=numlines);
X          llen:=length(current_line);
X          if ((llen-col+1)<linelen) then !extend line with blanks if necessary
X            move_horizontal(llen-get_info(current_buffer,"offset_column")+1);
X            nb:=(linelen+col-llen-1);
X            pad_w_nb_blanks;
X          endif;
X          move_horizontal(col-get_info(current_buffer,"offset_column"));
X          temp:=mark(none);
X          move_horizontal(linelen-1);
X          temp_range:=create_range(temp,mark(none),none);
X          erase(temp_range);
X          ins_mark:=mark(none);
X          position(extract_buff);
X          temp:=mark(none);
X          move_vertical(+1);
X          move_horizontal(-2);
X          ins_range:=create_range(temp,mark(none),none);
X          move_horizontal(+2);
X          position(ins_mark);
X          copy_text(ins_range);
X          move_vertical(+1);
X          counter:=counter+1;
X        endloop;
X      else
X        message('cannot overlay because tabs are imbedded in the text');
X        position(end_ins);
X        counter:=0;
X        loop  ! delete extra lines added
X          exitif (counter=numlines_added);
X          move_vertical(-1);
X          erase_line;
X          counter:=counter+1;
X        endloop;
X      endif;
X      position(start_ins);
X      move_horizontal(col-1);
X    else
X      message("EXTRACT buffer empty");
X    endif;
X  else
X    message("no data to insert");
X  endif;
X  set (bell,all,off);
X  set (bell,broadcast,on);
XendProcedure;  !overlay_rect
X!
XProcedure extract_rect
XLOCAL col_2,dummy_buff,dumb,end_ext,ext_range,extract_buff,flag,last_line,
X  leftcolm,llen,rect_width,ret_mark,tabs,temp,numlines; 
X  on_error  !suppress WARNING error messages
X  endon_error
X  mark_2:=mark(none);
X  set (bell,all,on);
X  col_2:=current_offset+1;
X  if (get_info(mark_1,"buffer") <> current_buffer) then 
X    message("no marker set in current buffer");
X  else
X    if (mark_1<>mark_2) then
X      if (mark_1<mark_2) then 
X        flag:=1; !flag used for cursor placement after extract
X        position(mark_1);
X        move_horizontal(1-col_1); !beginning of line
X        start_ext:=mark(none);
X        position(mark_2);
X        move_horizontal(length(current_line)-col_2+1); !end of line 
X        end_ext:=mark(none);
X      else
X        position(mark_2);
X        move_horizontal(1-col_2); !beginning of line
X        start_ext:=mark(none);
X        if (start_ext=beginning_of(current_buffer)) then
X          flag:=2;
X        else
X          flag:=3;
X          move_horizontal(-1);
X          ret_mark:=mark(none);
X        endif;
X        position(mark_1);
X        move_horizontal(length(current_line)-col_1+1); !end of line
X        end_ext:=mark(none);
X      endif;
X      position(end_ext);
X      ext_range:=create_range(start_ext,end_ext,none);
X      dummy_buff:=create_buffer('DUMMY');
X      set(no_write,dummy_buff,on);
X      set(system,dummy_buff);
X      position(dummy_buff);
X      copy_text(ext_range);
X      tabs:=search(ascii(9),REVERSE);
X      if tabs=0 then 
X        extract_buff:=eve$find_buffer('EXTRACT');
X        if extract_buff=0 then 
X          extract_buff:=create_buffer('EXTRACT');
X          set(no_write,extract_buff,on);
X          set(eob_text,extract_buff,'[End of Extract]');
X          set(system,extract_buff);
X        else
X          erase(extract_buff);
X        endif;
X        erase(ext_range);
X        leftcolm:=col_1;
X        if col_1>col_2 then 
X          leftcolm:=col_2;
X          col_2:=col_1;
X          col_1:=leftcolm;
X        endif;
X        rect_width:=col_2-col_1+1;
X        position(beginning_of(dummy_buff));
X        numlines:=get_info(current_buffer,"record_count");
X        dumb:=1;
X        loop
X          llen:=length(current_line);
X          if llen<col_2 then 
X            move_horizontal(llen-get_info(current_buffer,"offset_column")+1);
X            nb:=(col_2-llen);
X            pad_w_nb_blanks;
X          endif;
X          exitif (dumb=numlines);
X          dumb:=dumb+1;
X          move_vertical(1);
X        endloop;      
X        dumb:=1;
X        position(beginning_of(dummy_buff));
X        loop
X          move_horizontal(col_1-get_info(current_buffer,"offset_column"));
X          temp:=mark(none);
X          move_horizontal(rect_width-1);
X          ext_range:=create_range(temp,mark(none),none);
X          position(extract_buff);
X          move_text(ext_range);
X          split_line;
X          position(dummy_buff);
X          exitif (dumb=numlines);
X          dumb:=dumb+1;
X          move_vertical(1);
X        endloop;
X        position(extract_buff);
X        erase_line;
X        position(start_ext);
X        move_text(dummy_buff);
X        delete(dummy_buff);
X        if (flag=1) then
X          move_vertical(-1);
X        else 
X          if (flag=2) then 
X            position(beginning_of(current_buffer));
X          else 
X            position(ret_mark);
X            move_horizontal(+1);
X          endif;
X        endif;
X        move_horizontal(leftcolm-1);
X      else 
X        message('cannot extract rectangle if tabs are imbedded in text');
X        position(mark_2);
X        delete(dummy_buff);
X      endif; !tab check
X    endif; ! if mark_1<>mark_2
X    delete(mark_1);
X  endif; ! if mark_1 exists
X  set (bell,all,off);
X  set (bell,broadcast,on);
XendProcedure;   !extract_rect
X!
XProcedure pad_w_nb_blanks
XLOCAL n,loc,blanks_range,end_pad;
X  if (nb<>0) then 
X    loc:=mark(none);
X    blanks_buff:=eve$find_buffer('BLANKS');
X    if blanks_buff=0 then 
X      blanks_buff:=create_buffer('BLANKS');
X      set(no_write,blanks_buff,on);
X      set(system,blanks_buff);
X      position(blanks_buff);  !insert 132 blanks in blanks_buff for padding
X      n := 0;
X      loop
X        copy_text(' ');
X        n := n+1;
X        exitif n=132;
X      endloop;
X      position(loc);
X    endif;
X    position(beginning_of(blanks_buff));
X    move_horizontal(nb-1);
X    end_pad:=mark(none);
X    blanks_range:=create_range(beginning_of(blanks_buff),end_pad,none);
X    position(loc);
X    copy_text(blanks_range);
X  endif;
XendProcedure;  !pad_w_nb_blanks
X!
XProcedure copy_rect
XLOCAL col_2,dummy_buff,dumb,end_ext,ext_range,extract_buff,numlines,
X      last_line,llen,rect_width,tabs,temp; 
X  on_error  !suppress WARNING error messages
X  endon_error          
X  set (bell,all,on);
X  mark_2:=mark(none);
X  col_2:=current_offset+1;
X  if (get_info(mark_1,"buffer") <> current_buffer) then 
X    message("no marker set");
X  else
X    if (mark_1<>mark_2) then
X      if (mark_1<mark_2) then 
X        position(mark_1);
X        move_horizontal(1-col_1); !beginning of line
X        start_ext:=mark(none);
X        position(mark_2);
X        move_horizontal(length(current_line)-col_2+1); !end of line 
X        end_ext:=mark(none);
X      else
X        position(mark_2);
X        move_horizontal(1-col_2); !beginning of line
X        start_ext:=mark(none);
X        position(mark_1);
X        move_horizontal(length(current_line)-col_1+1); !end of line
X        end_ext:=mark(none);
X      endif;
X      position(end_ext);
X      ext_range:=create_range(start_ext,end_ext,none);
X      dummy_buff:=create_buffer('DUMMY');
X      set(no_write,dummy_buff,on);
X      set(system,dummy_buff);
X      position(dummy_buff);
X      copy_text(ext_range);
X      tabs:=search(ascii(9),reverse); !search for any imbedded tabs -
X      if tabs=0 then  ! this routine will not work with imbedded tabs
X        extract_buff:=eve$find_buffer('EXTRACT');
X        if extract_buff=0 then 
X          extract_buff:=create_buffer('EXTRACT');
X          set(no_write,extract_buff,on);
X          set(eob_text,extract_buff,'[End of Extract]');
X          set(system,extract_buff);
X        else
X          erase(extract_buff);
X        endif;
X        if col_1>col_2 then 
X          dumb :=col_1;
X          col_1:=col_2;
X          col_2:=dumb;
X        endif;
X        rect_width:=col_2-col_1+1;
X        position(beginning_of(dummy_buff));
X        numlines:=get_info(current_buffer,"record_count");
X        dumb:=1;
X        loop
X          llen:=length(current_line);
X          if llen<col_2 then 
X            move_horizontal(llen-get_info(current_buffer,"offset_column")+1);
X            nb:=(col_2-llen);
X            pad_w_nb_blanks;
X          endif;
X          exitif (dumb=numlines);
X          dumb:=dumb+1;
X          move_vertical(1);
X        endloop;      
X        dumb:=1;
X        position(beginning_of(dummy_buff));
X        loop
X          move_horizontal(col_1-get_info(current_buffer,"offset_column"));
X          temp:=mark(none);
X          move_horizontal(rect_width-1);
X          ext_range:=create_range(temp,mark(none),none);
X          position(extract_buff);
X          move_text(ext_range);
X          split_line;
X          position(dummy_buff);
X          exitif (dumb=numlines);
X          dumb:=dumb+1;
X          move_vertical(1);
X        endloop;
X        position(extract_buff);
X        erase_line;
X      else 
X        message('cannot copy a rectangle if tabs are imbedded in text');
X      endif; ! if tab 
X      position(mark_2);
X      delete(dummy_buff);
X    endif; ! if mark_1<>mark_2
X    delete(mark_1);
X  endif;
X  set (bell,all,off);
X  set (bell,broadcast,on);
XendProcedure;  !copy_rect
X!
XProcedure replacement_log
XLOCAL msg_text;
X  case n_replaced from 0 to 1
X  [0]: msg_text:='No replacements made';
X  [1]: msg_text:='Replaced 1 occurrence';
X  [outrange]:   msg_text:=FAO('Replaced !UL occurrences',n_replaced);
X  endcase;
X  erase(message_buffer);
X  message(msg_text);
X  position(here);
X  update(current_window);
XendProcedure;   !replacement_log
X!
XProcedure replace
XLOCAL command_index,from_string,to_string,action,src_range;
X!GLOBAL here, n_replaced
Xon_error
X  replacement_log;
X  return;
Xendon_error;
X  n_replaced:=0;
X  action:=' ';
X  here:=mark(none);
X  from_string:=read_line('replace old string> ');
X  to_string:=read_line('with new string> ');
X  loop
X    src_range:=search(from_string,FORWARD);
X    erase(message_buffer);
X    message(
V"' '->change,'!'->change all '.'->change and stop 'n'->don't change 's'->stop")
X;
X    position(src_range);
X    update(current_window);
X    loop
X      action:=read_char;
X      command_index := index(' !.nNsS',action);
X      exitif command_index<>0;
X    endloop;
X    case command_index from 1 to 7
X    [1]: ! change this occurrence
X         erase(src_range);
X         position(end_of(src_range));
X         copy_text(to_string);
X         n_replaced:=n_replaced+1;
X    [2]: ! change all
X         loop
X           erase(src_range);
X           position(end_of(src_range));
X           copy_text(to_string);
X           n_replaced:=n_replaced+1;
X           src_range:=search(from_string,FORWARD);
X         endloop;
X         exitif;        !exit loop for each occurrence
X    [3]: ! change and stop
X         erase(src_range);
X         position(end_of(src_range));
X         copy_text(to_string);
X         n_replaced:=n_replaced+1;
X         exitif;
X    [4,5]:! don't change this one
X         if length(from_string)=1
X         then
X           move_horizontal(1)
X         else
X           position(end_of(src_range))
X         endif;
X    [6,7]:! don't change and stop
X         exitif;
X    endcase;
X  endloop;
X  replacement_log;
XendProcedure;   !replace
X!
XProcedure visit_readonly_file
X  eve_split_window;
X  eve_get_file("");
X  set(modifiable,current_buffer,off);
X  eve$update_status_lines;
XendProcedure;   !visit_readonly_file
X!
XProcedure write_file_specified
XLOCAL file_name;
X  file_name := read_line('Enter filename or <CR> for default:');
X  if file_name = '' then
X    write_file(current_buffer);
X  else
X    write_file(current_buffer,file_name);
X  endif;
XendProcedure;   ! write_file_specified
X!
XProcedure update_all_files
XLOCAL buf;
X  buf:=get_info(buffers,'first');
X  loop
X    exitif buf=0;
X    if (get_info(buf,'modified')=1) AND (get_info(buf,'file_name')<>'')
X       AND (get_info(buf,'no_write')=0)
X    then
X      write_file(buf);
X    endif;
X    buf:=get_info(buffers,'next');
X  endloop;
XendProcedure;   !update_all_files
X!
XProcedure window_top
XLOCAL cur_row,vtop,n;
X  cur_row:=current_row;
X  vtop:=get_info(current_window,'visible_top');
X  n:=cur_row-vtop;
X  scroll(current_window,n);
X  cursor_vertical(-n);
XendProcedure;   !window_top
X!
XProcedure window_bottom
XLOCAL cur_row,vbot,n;
X  cur_row:=current_row;
X  vbot:=get_info(current_window,'visible_bottom');
X  n:=vbot-cur_row;
X  scroll(current_window,-n);
X  cursor_vertical(n);
XendProcedure;   !window_bottom
X!
XProcedure scroll_up
X  message('release mouse to stop scrolling');
X  set(forward,current_buffer);
X  scroll(current_window);
XendProcedure;   !scroll_up
X!
XProcedure scroll_down
X  message('release mouse to stop scrolling');
X  set(reverse,current_buffer);
X  scroll(current_window);
XendProcedure;   !scroll_down
X!
XProcedure start_learn;
X  message('Remembering...');
X  learn_begin(EXACT);
XendProcedure;   !start_learn
X!
XProcedure end_learn;
X  learned:=learn_end;
X  message('Done remembering...');
XendProcedure;   !end_learn
X!
XProcedure save_cursor
X  save_buf:=current_buffer;
X  save_cur:=mark(none);
X  message('Saved current position');
XendProcedure;   !save_cursor
X!
XProcedure goto_saved_cursor
X  map(current_window,save_buf);
X  position(save_cur);
X  update(current_window);
XendProcedure;   !goto_saved_cursor
X!
XProcedure untab ! Turn TABs to spaces according to current tab setting
XLOCAL target,n;
X  loop
X    target := search(ascii(9), FORWARD);
X    exitif (target = 0);
X    position(beginning_of(target));
X    erase_character(1);
X    n := current_offset;
X    tab_indent;
X  endloop;
XendProcedure;   !eliminate_tabs
X!
XProcedure tab_indent
XLOCAL n,b,tab_pos,this_pos,blanks;
X  blanks := '                                                       ';
X  n := current_offset;
X  tab_pos := get_info(current_buffer,'tab_stops');
X  if get_info(tab_pos,'type') = integer then
X    n := tab_pos - n + ( tab_pos * (n/ tab_pos) );
X    copy_text(substr(blanks,1,n));
X  else
X    loop
X      b := index(tab_pos,' ');
X      if b = 0 then
X        this_pos := int(tab_pos);
X      else
X        this_pos := int(substr(tab_pos,1,b-1));
X      endif;
X      exitif (this_pos > n+1) or (b = 0);
X      tab_pos := substr(tab_pos,b+1,length(tab_pos)-b);
X    endloop;
X    if this_pos > n+1 then  ! important to check this first
X      copy_text(substr(blanks,1,this_pos-n-1));
X    else
X      message('no further tabs are defined');
X    endif;
X  endif;
XendProcedure;   !tab_indent
X!
XProcedure redefine_tab  ! insert the right number of spaces when you hit TAB
X  define_key('tab_indent',tab_key,'indent spaces');
XendProcedure;      !redefine_tab
X!
XProcedure display_row_column
XLOCAL row_num,col_num;
X  row_num:=get_info(current_window,'current_row');
X  col_num:=get_info(current_window,'current_column');
X  message(FAO('Cursor is at Row !UL Column !UL',row_num,col_num));
XendProcedure;   !display_row_column
X!
XProcedure toggle_window_width
XLOCAL current_width;
X  current_width:=get_info(current_window,'WIDTH');
X  if current_width<=80
X  then 
X    set(width,current_window,132);
X  else
X    set(width,current_window,80);
X  endif;
XendProcedure;   !toggle_window_width
X!
XProcedure transpose
Xlocal this_position,            ! Marker for current cursor position
X      save_character,           ! Storage for twiddled character
X      save_mode;                ! Storage for mode
X
X  save_mode := get_info (current_buffer, "mode");
X  set (insert, current_buffer);
X  this_position := mark (none);
X  if this_position = end_of (current_buffer) then
X     return;
X  else
X    if current_offset = 0 then         
X        save_character := erase_character (1);
X        move_horizontal (-1);
X        copy_text (save_character);
X    else
X        save_character := erase_character (-1);
X        move_horizontal (1);
X        copy_text (save_character);
X        move_horizontal (-1);
X    endif;
X  endif;
X  set (save_mode, current_buffer);
XendProcedure;   !transpose
X!
XProcedure switch_case           !gold kp1 (change case)
XLOCAL    character,what_case,command_index,selected_range;
X  selected_range:=eve$selection(TRUE);
X  if selected_range <> 0 
X  then
X    what_case:=read_line('change to Upper/Lower or Invert? [U/L/I]',1);
X    command_index:=index('UuLlIi',what_case);
X    case command_index from 1 to 6
X    [1,2]:      change_case(selected_range,UPPER);
X    [3,4]:      change_case(selected_range,LOWER);
X    [5,6]:      change_case(selected_range,INVERT);
X    [OUTRANGE]: change_case(selected_range,INVERT);
X    endcase;
X    selected_range:=0;
X    return;
X  endif;
X  if current_character <> '' !change case of current character
X  then
X    character :=current_character;
X    change_case(character,invert);
X    erase_character(1);
X    copy_text(character);
X    if current_direction <> forward
X    then
X      move_horizontal(-2);
X    endif;
X    return;
X  endif;
Xendprocedure;   !switch_case
X!
XProcedure show_ascii_table
XLOCAL cur_buf,buf;                   
X  save_pos:=current_window;
X  cur_buf:=current_buffer;
X  ascii_table_buffer:=create_buffer('ascii_table_buffer');
X  position(ascii_table_buffer);
X  copy_text('   0       1       2       3       4       5       6       7');
X  split_line;
X  copy_text(
X'    ----+-------+-------+-------+-------+-------+-------+-------+------');
X  split_line;
X  copy_text(
X'    0  NUL  0  DLE  16 SP  32  0  48   @  64   P  80   ``   96  p   112');
X  split_line;
X  copy_text(
X'    1  SOH  1  DC1  17 !   33  1  49   A  65   Q  81   a   97  q   113');
X  split_line;
X  copy_text(
X'    2  STX  2  DC2  18 "   34  2  50   B  66   R  82   b   98  r   114');
X  split_line;
X  copy_text(
X'    3  ETX  3  DC3  19 #   35  3  51   C  67   S  83   c   99  s   115');
X  split_line;
X  copy_text(
X'    4  EOT  4  DC4  20 $   36  4  52   D  68   T  84   d  100  t   116');
X  split_line;
X  copy_text(
X'    5  ENQ  5  NAK  21 %   37  5  53   E  69   U  85   e  101  u   117');
X  split_line;
X  copy_text(
X'    6  ACK  6  SYN  22 &   38  6  54   F  70   V  86   f  102  v   118');
X  split_line;
X  copy_text(
X"    7  BEL  7  ETB  23 '   39  7  55   G  71   W  87   g  103  w   119");
X  split_line;
X  copy_text(
X'    8  BS   8  CAN  24 (   40  8  56   H  72   X  88   h  104  x   120');
X  split_line;
X  copy_text(
X'    9  HT   9  EM   25 )   41  9  57   I  73   Y  89   i  105  y   121');
X  split_line;
X  copy_text(
X'    A  LF  10  SUB  26 *   42  :  58   J  74   Z  90   j  106  z   122');
X  split_line;
X  copy_text(
X'    B  VT  11  ESC  27 +   43  ;  59   K  75   [  91   k  107  {   123');
X  split_line;
X  copy_text(
X'    C  FF  12  FS   28 ,   44  <  60   L  76   \  92   l  108  |   124');
X  split_line;
X  copy_text(
X'    D  CR  13  GS   29 -   45  =  61   M  77   ]  93   m  109  }   125');
X  split_line;
X  copy_text(
X'    E  SO  14  RS   30 .   46  >  62   N  78   ^  94   n  110  ~   126');
X  split_line;
X  copy_text(
X'    F  SI  15  US   31 /   47  ?  63   O  79   _  95   o  111  DEL 127');
X  split_line;
X  set(width,info_window,get_info(screen,'width'));
X  set(video,info_window,none);
X  set(modifiable,ascii_table_buffer,off);
X  map(info_window,ascii_table_buffer);
X  set(eob_text,ascii_table_buffer,"[That's all, folks!]");
X  set(tab_stops,ascii_table_buffer,'8 16 24 32 40 48 56 64 72');
X  set(status_line,info_window,reverse,
X    'Press Return to remove this window and resume editing');
X  position(beginning_of(ascii_table_buffer));
X  update(info_window);
X  define_key('redefine_cr',ret_key);
XendProcedure;   !show_ascii_table
XProcedure redefine_cr
X  delete(ascii_table_buffer);
X  undefine_key(ret_key);
XendProcedure;   !undefine_return
X!
XProcedure help_key
XLOCAL which_key,key_info;
X  erase(message_buffer);
X  set(video,message_window,none);
X  set(video,message_window,blink);
X  message('Press the (shift/control) key you want help on');
X  set(video,message_window,none);
X  which_key:=read_key;
X  key_info:=lookup_key(which_key,COMMENT);
X  if key_info<>''
X  then
X    message('Comment for key is: '+key_info);
X  else
X    message('There is no comment for this key');
X  endif;
XendProcedure;   !help_key
X!
XProcedure use_eve_keys
X  remove_key_map (eve$x_key_map_list, eve$x_user_keys);
X  remove_key_map (eve$x_key_map_list, eve$x_mouse_keys);
X  remove_key_map (eve$x_key_map_list, eve$x_edt_keys);
X  add_key_map (eve$x_key_map_list, "first", eve$x_numeric_keys);
XendProcedure;
X!
XProcedure use_edtplus_keys
X  remove_key_map (eve$x_key_map_list, eve$x_numeric_keys);
X  add_key_map (eve$x_key_map_list, "first", eve$x_edt_keys);
X  add_key_map (eve$x_key_map_list, "first", eve$x_mouse_keys);
X  add_key_map (eve$x_key_map_list, "first", eve$x_user_keys);
XendProcedure;
X!
XProcedure define_edt_plus_keys_in_eve
X
X  set(shift_key,pf1);   ! enable gold key
X!
X! file related commands
X!
X  define_key('eve_get_file("")',key_name('c',shift_key),
X             'use current window to display another file');
X  define_key('eve_split_window;eve_get_file("")',key_name('f',shift_key),
X             'visit file in another window');
X  define_key('eve_include_file("")',key_name('i',shift_key),
X             'include file before current line');
X  define_key('visit_readonly_file',key_name('v',shift_key),
X             'visit another file READONLY in another window');
X  define_key('update_all_files',key_name('u',shift_key),
X             'update all modified files onto disk');
X  define_key('write_file_specified',
X             key_name('w',shift_key),
X             'write out current buffer in specified file');
X!
X! buffer related commands
X!
X  define_key('eve_buffer("")',key_name('b',shift_key),
X             'goto buffer in current window');
X  define_key('eve_show_buffers',key_name('l',shift_key),'list buffers');
X  define_key('eve_buffer(main_buffer)',key_name('m',shift_key),
X             'return to main buffer');
X!
X! windows related commands
X!
X  define_key('eve_next_window',key_name('n',shift_key),'next window');
X  define_key('eve_previous_window',key_name('p',shift_key),'previous window');
X  define_key('eve_one_window',key_name('o',shift_key),
X             'make this the only window');
X  define_key('eve_split_window',key_name('+',shift_key),
X             'split current window in 2');
X  define_key('eve_delete_window',key_name('-',shift_key),
X             'unmap current window');
X  define_key('eve_enlarge_window("")',key_name('g',shift_key),
X             'enlarge current window by lines specified');
X  define_key('eve_shrink_window("")',key_name('s',shift_key),
X             'shrink current window by lines specified');
X  define_key('toggle_window_width',key_name(TAB_KEY,shift_key),
X             'toggle window width between 80 and 132');
X  define_key('window_top',key_name(UP,shift_key),
X             'move current line to top of window');
X  define_key('window_bottom',key_name(DOWN,shift_key),
X             'move current line to bottom of window');
X  define_key('eve_shift_right("")',key_name(RIGHT,shift_key),
X             'shift window right by number of columns specified');
X  define_key('eve_shift_left("")',key_name(LEFT,shift_key),
X             'shift window left by number of columns specified');
X!
X! editing, pick/put, rectangular cut/paste
X!
X! use the following line if you like EVE's replace better
X! define_key('eve_replace("","")',key_name('r',shift_key),'replace string');
X  define_key('replace',key_name('r',shift_key),'replace string');
X  define_key('transpose',key_name('t',shift_key),'transpose two characters');
X  define_key('pick_range',KP9,'Copy selected range to Pick buffer');
X  define_key('put_range',key_name(KP9,shift_key),
X             'put contents of Pick buffer here');
X  define_key('copy_text(ascii(int(read_line('+
X             '"Enter ASCII code in decimal: "))))',
X             key_name(KP3,shift_key),'special insert');
X  define_key('mark_it',key_name('.',shift_key),'mark corner of rectangle');
X  define_key('insert_rect',key_name('>',shift_key),'insert rectangle');
V  define_key('extract_rect',key_name('<',shift_key),'extract/remove rectangle')
X;
X  define_key('overlay_rect',key_name(')',shift_key),'pasteover rectangle');
X  define_key('copy_rect',key_name('(',shift_key),'copy rectangle');
X!
X! mouse commands
X!
X  define_key('position(mouse)',M1DOWN,'position cursor to mouse');
X  define_key('message("position updated")',M1UP,'position cursor to mouse');
X  define_key('scroll_up',M2DOWN,'scroll text up');
X  define_key('message("ok")',M2UP,'stop scroll up');
X  define_key('scroll_down',M3DOWN,'scroll text down');
X  define_key('message("ok")',M3UP,'stop scroll down');
X!
X! misc functions
X!
X  define_key('copy_text(fao("!%D",0))',key_name(PF2,shift_key),
X             'insert date/time');
X  define_key('switch_case',key_name(KP1,shift_key),'switch case');
X  define_key('eve_dcl("")',key_name('d',shift_key),'do DCL command');
X  define_key('eve_quit',key_name('q',shift_key),'quit');
V  define_key('exit',key_name('e',shift_key),'exit'); !want to write all modifie
Xd
X                ! unconditionally, eve_exit confirms for all but current buffer
X  define_key('attach',key_name('z',shift_key),'attach to parent process');
X  define_key('help_key',key_name('h',shift_key),
X             'display comment on key definitions');
X  define_key('show_ascii_table',key_name('a',shift_key),'show ascii table');
V  define_key('display_row_column',key_name('?',shift_key),'display row,column')
X;
X  define_key('eve_set_tabs("")',key_name('&',shift_key),'set tab stops');
X  define_key('start_learn',key_name('[',shift_key),'Start learn sequence');
X  define_key('execute(learned)',key_name('x',shift_key),
X             'Execute learn sequence');
X  define_key('end_learn',key_name(']',shift_key),'End learn sequence');
X  define_key('save_cursor',key_name('=',shift_key),'save current location');
V  define_key('goto_saved_cursor',key_name('^',shift_key),'goto saved location')
X;
X  define_key('eve_line("","")',key_name('#',shift_key),'goto line specified');
X  define_key('eve_what_line',pf2,'display current line number');
X  define_key('refresh',ctrl_r_key,'refresh screen, keep messages');
X  define_key('mail_reply',key_name('j',shift_key),
X             'format mail reply/signature');
X  define_key('indent_region',key_name('k',shift_key),
X             'indent region selected');
X  define_key('sort_region',f17,'sort region selected');
X  define_key('write_region',f18,'write region selected');
X  define_key('narrow_region',key_name(ctrl_n_key,shift_key),'narrow region');
X  define_key('widen_region',key_name(ctrl_w_key,shift_key),'widen region');
X  define_key('filter_region',key_name(ctrl_f_key,shift_key),'filter region');
X  define_key('vassar_spell',f19,'Vassar speller interface');
XendProcedure;   !define_edt_plus_keys
X!
X! put your local modifications here
X!
XProcedure tpu$local_init
X!
X! do not change these lines
X!
X  pick_buffer:=eve$init_buffer("Pick Buffer","");       !create Pick buffer
X  main_buffer:=get_info(current_buffer,'name');         !remember where main is
X!
X! change these lines as you like
X!
X  eve$add_word_separators ("~``!@#$%^&*()_-+={}[]:;'"+'"<>,.?/|\');
X  eve_set_cursor_bound;         ! use bound cursor motion like EDT
XendProcedure;
X
Xeve_set_keypad_edt;             ! use EDT keypad
Xdefine_edt_plus_keys_in_eve;    ! then add our own shorthands
Xsave('sys$disk:[]edtplus');
Xquit;
X!------------------------ end of edtplus.tpu -----------------------------
$ GoSub Convert_File
$ Exit

