home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
p2demo21.exe
/
PEL
/
LOCAL.PEL
< prev
next >
Wrap
Text File
|
1995-02-14
|
14KB
|
295 lines
# $Header: P:\source\wmacros\local.pev 1.37 14 Feb 1995 08:59:06 WALKER $
# $Tabs:4 7$
##############################################################################
#
# Compuware Corporation
# 31440 Northwestern Highway
# Farmington Hills, Michigan 48334-2564
#
# This source code listing contains information that is
# proprietary to Compuware Corporation and may not be copied
# duplicated, translated, transmitted, stored, retrieved
# or in any manner or by any method conveyed or disclosed
# to a third party or parties without express written
# permission from Compuware Corporation.
#
#
##############################################################################
#### $Workfile: local.pel $: User's customized startup
###
# Each user may have a local copy of this file in order to augment the
# standard macro library. The function "local_setup" is called from within
# the startup function.
#
# As shipped, this function does virtually nothing. However, sample code
# and advisory comments have been included to simplify the inclusion of
# popular customizations into a customer's local_setup function. Some of
# the customizations interact, so this outline illuminates a path of least
# astonishment.
#
# If any changes are made to this or any other .pel source file, the
# user must recompile the "cpe.ae" file using the PEL compiler.
# (For details on how this is done, see chapter 10 in the User's Manual
# entitled "Getting Started With PEL."
global function local_setup()
{
###
# (At this point in system initialization, no windows have yet been
# created and a default system buffer named "Scratch" has been
# initialized.)
# initialize the dde mechanism of the editor. This will allow the
# editor to make use of the stub program
initialize_dde()
# initialize the IBM WorkFrame dde mechanism of the editor. This will
# allow the editor to make use of the IBM WorkFrame.
#initialize_wf_dde()
###
# The emulation modes modify many system variables. For your
# customizations to persist, you probably should pick an emulation
# mode before any other customization. Pick only one from the
# list below.
# cua()
# native() # Sage Professional Editor's Native mode
# vi()
# brief()
# emacs()
# ispf() # If turned on, MUST also be present in config file!
###
# There are several global parameters you may wish to modify:
# pause_on_error = 1 # enable pausing after every error
save_state = 1 # enable automatic state file saves/restores
save_flags = set_flag_bits( save_flags, SAVE_SETTINGS, SAVE_SETTINGS) # enable automatic settings saves/restores
save_flags = set_flag_bits( save_flags, SAVE_COMMANDS, SAVE_COMMANDS) # enable automatic command history saves/restores
save_flags = set_flag_bits( save_flags, SAVE_SEARCH , SAVE_SEARCH) # enable automatic search history saves/restores
save_flags = set_flag_bits( save_flags, SAVE_REPLACE , SAVE_REPLACE) # enable automatic replace history saves/restores
save_flags = set_flag_bits( save_flags, SAVE_EDITFILE, SAVE_EDITFILE) # enable automatic editfile history saves/restores
save_flags = set_flag_bits( save_flags, SAVE_COMPILE , SAVE_COMPILE) # enable automatic compile history saves/restores
###
# Several features are enabled by some emulation modes but not by
# others (or in some cases they're not enabled at all). In any case
# you may wish to override the defaults, and they generally should
# be set AFTER you select an emulation mode. The toggle_...
# functions take an optional argument: 0=> disable, 1=> enable,
# nothing=> toggle the current state.
# toggle_dir_sync( 1 ) # have the editor change its working dir on new current buffer
# toggle_pvcs( 3 ) # automatic pvcs gets/puts,
# see "pvcs.pel" for definition of "3"
# toggle_file_backup( 1 ) # enable file backups
# autosave( 15 ) # autosave every 15 seconds
# toggle_pause( 1 ) # enable pause on errors/warnings
# toggle_search_flags(SEARCH_CASE, 0 ) # disable case sensitive searches (default is different for each keymap)
# toggle_search_flags(SEARCH_REGEX, 1 ) # enable regular expression searches (default is different for each keymap)
# toggle_search_flags(SEARCH_FORWARD, 1 ) # enable forward searches (default is different for each keymap)
# toggle_search_flags(SEARCH_BLOCK, 1 ) # enable block restricted searches (default is different for each keymap)
###
# The toggle_... functions listed above affect the entire system.
# Several other toggle_... functions exist which only affect the
# current buffer or current window. These can be used from the
# command line or within other functions.
#
# toggle_buffer_flags(BUFFER_OVERTYPE_MODE, 0 ) # disable overtype mode
# toggle_linenumbers( 1 ) # enable display of line numbers
# toggle_buffer_flags(BUFFER_REAL_SPACE_ONLY, 1 ) # disable entry into virtual space
# toggle_buffer_flags(BUFFER_TABS_TO_SPACES, 1) # enable conversion of tabs to spaces during edits
# toggle_wp( 1 ) # enable continuous word wrap
###
# To modify the mode and operation of all regular buffers created
# from this point on, modify the default_buffer_flags variable.
# Each flag has a unique affect on buffer edit operations. See
# "Library Reference" for more details.
#
# set_default_buffer_flag( BUFFER_READ_ONLY, 1 ) # make all buffers read-only
# set_default_buffer_flag( BUFFER_OVERTYPE_MODE, 1 ) # make overtype mode the default
# set_default_buffer_flag( BUFFER_EXPAND_TABS, 1 ) # expand tabs on write
# set_default_buffer_flag( BUFFER_WP_ENABLED, 1 ) # enable continuous word wrap
# set_default_buffer_flag( BUFFER_REAL_SPACE_ONLY, 1 )# disable movement into virtual space
# set_default_buffer_flag( BUFFER_SNAP_TO_EOL, 1 ) # disable insertion past EOL
# set_default_buffer_flag( BUFFER_NO_UNDO, 1 ) # disable recording of undo information
# set_default_buffer_flag( BUFFER_TABS_TO_SPACES, 1 ) # enable convertion of tabs to spaces
# set_default_buffer_flag( BUFFER_WHOLE_LINES, 1 ) # enable display of whole lines
###
# Loads all .ndx files specified in the HELPNDX environment variable.
# This will allow language specific help when the F1 key is processed.
#
# load_ndx_help()
###
# Some various examples of event handlers that may be attached
# to the left mouse double click. Please refer to the PEL
# functions by Category for a list of all the events that may
# be attached.
# open the file that was double-clicked
#attach_event_handler( EVENT.MOUSE_LEFT_CLICK2, "open_file_under_cursor" )
# do a tags auto on word that was double-clicked
#attach_event_handler( EVENT.MOUSE_LEFT_CLICK2, "tags_auto" )
# search for word double-clicked on
#attach_event_handler( EVENT.MOUSE_LEFT_CLICK2, "gui_context_find" )
# hilight the word that was double-clicked
attach_event_handler( EVENT.MOUSE_LEFT_CLICK2, "hilight_word_mouse" )
# display help on word that was double-clicked
#attach_event_handler( EVENT.MOUSE_LEFT_CLICK2, "display_help_item" )
###
# All other custom initialization goes here.
#
# When setting variables here, it is advisable to set the
# default_... version of them variables so they take effect when
# windows are eventually created.
#
default_buffer_tabs = "4 7"
buffer_tabs = "4 7"
###
# After local_setup() exits, startup processing proceeds as follows:
#
# 1) The configuration/state file, CPE.CFG, is processed.
# 2) Buffers are created for all files specified on the command line,
# and command line switches are processed.
#
# Upon completion of startup processing, the editor begins accepting
# commands from the user.
}
global function local_settings()
{
###
# (At this point in system initialization, the config file has just been
# read and any settings in here will override them)
#
}
### additional custom startup function definitions go here,
# after local_startup():
### place additional menus in user_menu
# "main_menu" is a global variable that contains the main menu handle
global function user_menu()
{
}
### place help for user menus in user_help_lines
#
global function user_help_lines( main_menu )
{
}
global function local_keys()
{
###
# Place any assign-key settings that you wish to persist in any emulation
# mode here. This routine is called from all emulation modes to modify
# their keymap. To assign a key in only certain emulation modes, check
# the emulation_mode variable.
# EXAMPLE
# ------------------------------------------------------------------------
# In Cua, Brief, and Native keymap modes, <Alt-1> through <Alt-0> set
# bookmarks that can later be moved to by pressing <Alt-J>, then selecting
# the bookmark number to go to. This sample key assignment causes <Ctrl-1>
# through <Ctrl-0> to move to their respective bookmarks.
# ------------------------------------------------------------------------
#assign_key( "<Ctrl-1>", function_id("goto_bookmark 1") )
#assign_key( "<Ctrl-2>", function_id("goto_bookmark 2") )
#assign_key( "<Ctrl-3>", function_id("goto_bookmark 3") )
#assign_key( "<Ctrl-4>", function_id("goto_bookmark 4") )
#assign_key( "<Ctrl-5>", function_id("goto_bookmark 5") )
#assign_key( "<Ctrl-6>", function_id("goto_bookmark 6") )
#assign_key( "<Ctrl-7>", function_id("goto_bookmark 7") )
#assign_key( "<Ctrl-8>", function_id("goto_bookmark 8") )
#assign_key( "<Ctrl-9>", function_id("goto_bookmark 9") )
#assign_key( "<Ctrl-0>", function_id("goto_bookmark 10") )
# uncomment the following if you want to
# fix the menu incase there are key assignments in config file that matter
# by calling the corresponding menu function for the current emulation
#if ( emulation_mode )
# execute_function( emulation_mode"_menu")
# useful functions
#assign_key( "<F11>", "tags_auto" )
#assign_key( "<Shift-F11>", "tags" )
#assign_key( "<F12>", "fgrep" )
#assign_key( "<Ctrl-P>", "prev_window" )
#assign_key( "<Alt-F12>", "set_buffer_mask_key" )
#assign_key( "<Ctrl-F12>", "reset_buffer_mask" )
# CUA clipboard keys in any emulation mode
#assign_key( "<Shift-Delete>", "gui_delete_to_scrap" )
#assign_key( "<Shift-Insert>", "insert_scrap" )
#assign_key( "<Ctrl-Insert>", "copy_to_scrap_key" )
# assigns all the CUAelection keys in any emulation mode
#assign_key( "<Shift-Left>", "cua_extend " ) #CUA
#assign_key( "<Shift-Right>", "cua_extend " ) #CUA
#assign_key( "<Shift-Down>", "cua_extend " ) #CUA
#assign_key( "<Shift-Up>", "cua_extend " ) #CUA
#assign_key( "<Shift-Home>", "cua_extend " ) #CUA
#assign_key( "<Shift-End>", "cua_extend " ) #CUA
#assign_key( "<Shift-PageDown>", "cua_extend " ) #CUA
#assign_key( "<Shift-PageUp>", "cua_extend " ) #CUA
#assign_key( "<Shift-Num-Left>", "cua_extend " ) #CUA
#assign_key( "<Shift-Num-Right>", "cua_extend " ) #CUA
#assign_key( "<Shift-Num-Down>", "cua_extend " ) #CUA
#assign_key( "<Shift-Num-Up>", "cua_extend " ) #CUA
#assign_key( "<Shift-Num-Home>", "cua_extend " ) #CUA
#assign_key( "<Shift-Num-End>", "cua_extend " ) #CUA
#assign_key( "<Shift-Num-PageDown>", "cua_extend " ) #CUA
#assign_key( "<Shift-Num-PageUp>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-Left>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-Right>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-Down>", "cua_extend " )
#assign_key( "<Ctrl-Shift-Up>", "cua_extend " )
#assign_key( "<Ctrl-Shift-Home>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-End>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-PageDown>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-PageUp>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-Num-Left>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-Num-Right>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-Num-Down>", "cua_extend " )
#assign_key( "<Ctrl-Shift-Num-Up>", "cua_extend " )
#assign_key( "<Ctrl-Shift-Num-Home>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-Num-End>", "cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-Num-PageDown>","cua_extend " ) #CUA
#assign_key( "<Ctrl-Shift-Num-PageUp>", "cua_extend " ) #CUA
# reassigns Alt-X to minimize the editor and prompt to save changed files
#assign_key( "<Alt-X>", "minimize_and_save" )
#assign_key( "<Ctrl-Shift-{>", "goto_matching" )
# reassign Alt key so it doesn't select a menu item.
#assign_key( "<Alt>", "nop" )
}