home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / editors / epm / e_macros / load.e < prev    next >
Encoding:
Text File  |  1993-03-27  |  2.7 KB  |  83 lines

  1. ;  LOAD.E                                                Bryan Lewis 1/2/89
  2. ;
  3. ;  This event is triggered immediately after a file is loaded.  It will be
  4. ;  invoked after loading an existing file from disk, or opening a new file,
  5. ;  but not after an error such as "Not enough memory".
  6. ;  In other words, a new file must be entered into the ring.
  7. ;
  8. ;  This is the place to select a keyset (like c_keys for .C files) since
  9. ;  keysets now stay bound to a file once assigned.
  10. ;  This is also a good place to do other one-time processing like returning to
  11. ;  a saved bookmark.
  12. ;
  13. ;  No argument is passed.  Check .filename if you want the name of the file.
  14. ;  Use the function filetype() for the filetype.
  15. ;  1993/01/07:  put the result of filetype() in a universal so others needn't call it.
  16. defload
  17.    universal load_ext
  18. compile if WANT_EBOOKIE = 'DYNALINK'
  19.    universal bkm_avail
  20. compile endif
  21. compile if EPM
  22.    universal vDEFAULT_TABS, vDEFAULT_MARGINS, vDEFAULT_AUTOSAVE, load_var
  23.  compile if EVERSION >= '5.50'
  24.    universal default_font
  25.  compile endif
  26.  compile if WANT_LONGNAMES='SWITCH'
  27.    universal SHOW_LONGNAMES
  28.  compile endif
  29.  
  30.    load_var = 0
  31.  
  32.    .tabs     = vDEFAULT_TABS
  33.    .margins  = vDEFAULT_MARGINS
  34.    .autosave = vDEFAULT_AUTOSAVE
  35.  compile if EVERSION < 5.21
  36.    .statusline=STATUS_TEMPLATE
  37.  compile endif
  38.  compile if WANT_LONGNAMES
  39.   compile if WANT_LONGNAMES='SWITCH'
  40.    if SHOW_LONGNAMES then
  41.   compile endif
  42.    longname = get_EAT_ASCII_value('.LONGNAME')
  43.    if longname<>'' then
  44.       filepath = leftstr(.filename, lastpos('\',.filename))
  45.       .titletext = filepath || longname
  46.    endif
  47.   compile if WANT_LONGNAMES='SWITCH'
  48.    endif
  49.   compile endif
  50.  compile endif
  51. compile else
  52.    .tabs     = DEFAULT_TABS
  53.    .margins  = DEFAULT_MARGINS
  54.    .autosave = DEFAULT_AUTOSAVE
  55. compile endif
  56.    load_ext = filetype()
  57.    keys edit_keys    -- defaults for non-special filetypes
  58. compile if EVERSION >= '5.50'
  59.    if .font < 2 then    -- If being called from a NAME, and font was set, don't change it.
  60.       .font = default_font
  61.    endif
  62. compile endif
  63. compile if WANT_BOOKMARKS
  64.    if .levelofattributesupport < 2 then  -- If not already set (e.g., NAME does a DEFLOAD)
  65.       'loadattributes'
  66.    endif
  67. compile endif
  68. compile if WANT_EBOOKIE
  69.  compile if WANT_EBOOKIE = 'DYNALINK'
  70.    if bkm_avail <> '' then
  71.  compile endif
  72.       if bkm_defload()<>0 then keys bkm_keys; endif
  73.  compile if WANT_EBOOKIE = 'DYNALINK'
  74.    endif
  75.  compile endif
  76. compile endif  -- WANT_EBOOKIE
  77. compile if INCLUDE_BMS_SUPPORT
  78.    if isadefproc('BMS_defload_exit') then
  79.       call BMS_defload_exit()
  80.    endif
  81. compile endif
  82. -- sayerror 'DEFLOAD occurred for file '.filename'.'  -- for testing
  83.