home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 16 / 16.iso / w / w055 / 4.ddi / SOURCES.LIF / STARTUP.PEL < prev    next >
Encoding:
Text File  |  1990-09-27  |  3.2 KB  |  89 lines

  1. # $Header:   P:/source/ppee/macros/startup.pev   1.33   17 Aug 1990 18:25:48   skipr  $
  2.  
  3. ##############################################################################
  4. #
  5. #           Sage Software - POLYTRON Division
  6. #             1700 NW 167th Place
  7. #               Beaverton, OR 97006
  8. #
  9. #   Copyright 1990, Sage Software, Inc.
  10. #
  11. #   Permission is hereby granted for licensed users of Sage Professional
  12. #   Editor and PolyAwk to copy and modify this source code for their own
  13. #   personal use.  These derivative works may be distributed only to other
  14. #   licensed Sage Professional Editor and PolyAwk users.  All other usage
  15. #   is prohibited without express written permission from Sage Software.
  16. #
  17. ##############################################################################
  18.  
  19. #### $Workfile:   startup.pel  $: System startup processing
  20.  
  21. ###
  22. # The startup() function controls the overall initialization and 
  23. # customization of the Sage Professional Editor.  For certain special 
  24. # applications it may be desirable to modify or replace startup() in order to 
  25. # override normal startup behavior.  However, caution is advised.
  26. #
  27. # The recommended location for routine customizations is (a) in the 
  28. # local_setup() function in LOCAL.PEL, (b) in the SAGEEDIT.CFG config file, 
  29. # or (c) in both locations.  Local_setup() provides the fastest 
  30. # initialization, and is the preferred location for customizations that 
  31. # change infrequently.  Items in the configuration file execute a little more 
  32. # slowly, but are easily changed.  Presently, all the customizations provided 
  33. # by setup are placed in the config file, and override local_setup().  This 
  34. # permits multiple users or projects to share a base configuration of the 
  35. # editor, yet easily allows local customizations.
  36. #
  37.  
  38. global function startup() {
  39.  
  40.     ###
  41.     # The items contained within this function are customizable, though
  42.     # few will want to change them here:
  43.  
  44.     pause_on_error = 0    # DO NOT prompt after each error
  45.  
  46.     if ( os_name == "OS/2" ) {
  47.                 # In OS/2, increase the keyboard repeat
  48.                 # rate to 30 characters per second.
  49.         keyboard_speed( 30, 250 )
  50.     }
  51.  
  52.     ###
  53.     # First: implement hard-wired user customization:
  54.  
  55.     optional_function( "local_setup" )
  56.  
  57.     ###
  58.     # Second, read soft-wired configuration and state information 
  59.     #    from the config file
  60.  
  61.     optional_function( "read_config_file" )
  62.  
  63.     ###
  64.     # If no emulation mode has been defined by setup or config then
  65.     #    use "native".  This may override some of the settings
  66.     #    defined in local_setup or in the config file, (notably
  67.     #    default_window_flags, search_flags, and calls to the
  68.     #    assign_key function).
  69.     
  70.     if ( emulation_mode == "" ) {
  71.         optional_function( "native" )
  72.     }
  73.  
  74.     ###
  75.     # process command line options and create buffers for all files 
  76.     # named on the command line
  77.  
  78.     process_command_line()
  79.  
  80.     ###
  81.     # When startup() exits, the editor will create a full-screen window,
  82.     # Next it will ensure that current_window is a non-system window
  83.     # and current_buffer is attached.  (These steps are omitted if they
  84.     # have already been performed by the config file or local_setup().)
  85.     #
  86.     # Then the editor will begin processing keyboard input.
  87.     #
  88. }
  89.