home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
editors
/
hypsh40c.arj
/
HYPDOC.LZH
/
CHAP9.TXT
< prev
next >
Wrap
Text File
|
1991-04-27
|
27KB
|
859 lines
HyperShell Users Guide Environment Configuration
Environment Configuration
9 Environment Configuration
This section provides details of how the integrated environment is
driven, and how it may be configured.
The additional actions, dynamic menus and functions are provided as a
reference.
The environment is configured to use the various actions and modifiers
through the hyperfile itself, through an `edit control file' called
HS_IDE.HYP, or through a combination of both. It is possible to use
the environment without any configuration, but this requires a
knowledge of the following actions and associated information.
The actions, actions modifiers and functions may be combined with
standard HyperShell facilities to provide a customised interactive
environment.
9.1 Actions
The environment provides an extra set of actions which control the
editing and associated operations to be performed.
The environment actions start with the `#' character, and have a
single letter action code following this. These actions are ignored
by the reader component.
The environment actions which specify items use the normal item action
specification (eg. Nnotename). The action parameters are of the form
`tname' (and tafter etc) which is made up of `t' and `name' as
follows:-
`t' item type
+------------------------------------+
|N,n,M,m,S,s | as expected |
|F | FRAME |
|R | REMARK |
|E | END |
|P | PRINT directive |
|C | CHECK directive |
|T | Text file |
+------------------------------------+
e.g. local note fred is nfred
Also, these types may be specified for certain operations:-
- 157 -
Environment Configuration HyperShell Users Guide
+------------------+
| U | HEADER |
| V | FOOTER |
| I | INDEX |
| Z | SHARE |
+------------------+
9.1.1 Control actions
+----+
| #B | - Load text for paged display message/edit string
+----+
#Bmessage
The #B action is used to load a text string. This will be
used in the next paged list or edit/view operation, and is
cleared after use:-
Paged list Message for bottom line
Edit/view Edit string to be executed initially
+----+
| #K | - Set configuration string
+----+
#Knnn string
The #K action set the configuration string specified by the number
`nnn'. The format of the line after the `#K' should be the same as it
would be in the HYPSHELL.CFG file. This action is primarily provided
to allow keys to be re-mapped for the edit mode.
+----+
| #O | - Edit option setting
+----+
#Onvalue
This action allows the environment specific options to be set. The
following options are available, where n is one of
- 158 -
HyperShell Users Guide Environment Configuration
Environment options
+----------------------------------------------+
|0 | 1 | Create backup on save (set by -eb) |
|1 | 0 | (Create file -ec) |
|2 | 1 | scrollbar (0 = none, 1 = scrollbar) |
|3 | 0 | assumed indent (for edit mode/checks) |
|4 | | |
|5 | | |
|6 | | RESERVED |
|7 | | |
|8 | | |
|9 | | |
+----------------------------------------------+
+---------+
| #L / #W | - Set frame margins for edit mode
+---------+
#L ;
#Wnn
These set the global margins for frames. Global margins can be used
in edit mode to allow word wrap on input and to allow formatting of
the frame text.
The `#L' action should specify an argument which represents the actual
margin, as spaces, tabs or whatever, terminated by a `;' character,
which terminates the action.
The `#W' action should specify a number which represents the column
number of the right margin.
9.1.2 Editing actions
+---------+
| #A / #a | - Add new item
+---------+
#Atname~tafter Add item and enter edit mode.
#atname~tfrom Add item, copied from other
+----+
| #E | - Edit item
+----+
#Etname
This causes the specified item to be presented for editing in edit
mode.
+----+
| #M | - Move item in list
+----+
- 159 -
Environment Configuration HyperShell Users Guide
#Mtname~tafter
This moves item `tname' to immediately after item `tafter'. Note both
items must be in the same list.
+----+
| #D | - Delete item
+----+
#Dtname
This causes item `tname' to be deleted. The item is moved to the
deleted list, and may be `undeleted'.
+----+
| #U | - Undelete item
+----+
#Utname~tafter
This undeletes item `tname', and places it after item `tafter'. If
`tafter' is not specified, it is placed at the end of the list.
+----+
| #Z | - Remove deleted item
+----+
#Ztname
This `zaps' (or removes) an item from the deleted list, releasing any
memory it occupies.
+----+
| #R | - Rename item
+----+
#Rtname~tnewnm
This renames item `tname' as `tnewnm'. The `t' in both cases must be
the same, as it does not make sense to change the type of the item.
+----+
| #T | - Change title string of frame
+----+
#TFframe~newtitle
This changes the title string of frame specified by `Fframe' to
`newtitle'.
- 160 -
HyperShell Users Guide Environment Configuration
9.1.3 Miscellaneous actions
+----+
| #C | - Check item
+----+
#Ctname
This performs a check on the item specified, and lists any problems
found in the item.
+----+
| #F | - Find item
+----+
#Ftname
This attempts to locate the specified item to see if it exists, and
sets condition code `d' or `u' to reflect the result. `d' is set of
the item is defined, `u' is set of it is not.
+----+
| #V | - View item
+----+
#Vtname
This displays the item in View mode. This is like the `edit mode'
display, but does not allow the item to be saved. Edits may be
performed, but they will not affect the item viewed. The edited
buffer may be saved by pressing F10 to save the buffer to the file
EDITBUFF.SAV then pressing F9 to quit.
+---------+
| #P / #p | - Print item
+---------+
#Ptname
#ptname
These actions cause the item to be sent to the output route currently
specified by option flag O5. If O51 is set, the item is printed on
the printer.
The `#P' action causes reference and formatting flags to be
interpreted, whilst the `#p' action prints the item without
interpretation of flags, as it appears in the hyperfile.
9.1.4 File actions
+---------+
| #X / #Y | - Save file and exit
+---------+
- 161 -
Environment Configuration HyperShell Users Guide
#X
#Yfilename
These actions cause the edits to be applied to the file. If the edit
was done in memory, the changed file is written straight out. If the
edits are performed against the file, the changes are merged with the
file (and any change file present) to form the new file. The old file
is retained as backup if the -eb flag was not specified. The `#Y'
action allows a filename to be specified if the file is to be written
as a different name.
+----+
| #S | - Save file and continue
+----+
#S
This causes the changes to be applied against the file, as in the #X
and #Y actions, but the filename written has a .TMP extension and the
program continues afterwards.
+----+
| #I | - Incremental save
+----+
#I
The incremental save action causes the current changes to be written
to a combined index and change file, which has the same name as the
hyperfile, but with an extension of .HXC. Edits in memory are cleared
out, allowing further edits to be performed. Any eventual save will
utilise the change file and any further changes in memory. Successive
incremental saves will replace the change file with the additional
changes.
The incremental save process is fast, and allows the program to quit
and restart again, picking up the changes from the previous session.
The change file can be copied, after it is produced, to a backup file
to allow changes to be `backed out'.
Also, different users can operate different change files against the
same hyperfile, and the hyperfile can remain as a `read-only' basis.
+----+
| #Q | - Quit without save
+----+
#Q
#QQ
The `#Q' action causes the program to quit without saving the changes.
The normal HyperShell `Q' action has the same effect, but a
confirmation message is given allowing the user to continue, if edits
have been performed.
- 162 -
HyperShell Users Guide Environment Configuration
The `#QQ' action also causes the change file to be deleted.
9.2 Dynamic menus
Additional dynamic menus are provided in the integrated environment.
These may be used with the additional actions, or with the normal
reader actions.
+--------------+
| @I / @i / @Z | - Item Lists
+--------------+
@I Global item list
@i Local item list
@Z Deleted item list
These present a list of items, which provides the names and types of
the items, highlighted in appropriate fashion to indicate the item
type, and also specifying the item name, and returns the item
reference, for use in editing actions or normal actions.
The local item list relates to the current frame.
The `@Z' list can be used to provide the item reference for an `#U'
undelete action.
+---------+
| @P / @p | - Popup item menu
+---------+
@P{n {title}}
@p{n {title}}
The `@P' menu is a global item popup menu, and the `@p' is a local
item popup menu. These popup menus present a list of items, the type
of which is specified by parameter `n', which defaults to note type.
The title of the menu is the type name, unless the `title' parameter
is supplied.
+------------------------------------+
| n | Item type (also default title) |
|---+--------------------------------|
| 0 | MENU |
| 1 | NOTE |
| 2 | SCRIPT |
| 3 | PRINT |
| 4 | CHECK |
| 5 | REMARK |
| 6 | END |
+------------------------------------+
These return the selected item reference.
- 163 -
Environment Configuration HyperShell Users Guide
e.g. To display local note menu:-
n@p
or
n@p1 Notes
+---------+
| @Y / @y | - Search Items
+---------+
@Ystring
@ystring
These are search operations which work in a similar fashion to the @S
and @X searches. They always search the text of the items.
The `@Y' dynamic menu is a global item search. The `@y' is a local
item search
These return the selected item reference.
+--------------+
| @U / @V / @v | - Perform check scan
+--------------+
@U
@V
@v
These are `check scans', which process the text of each item in turn,
and report the first check failure in each item which has errors. The
list produced is similar to that produced by a search operation.
The `@U' menu checks frame texts, and if the frame in error is
selected, it returns the selected frame reference.
The `@V' and `@v' menus check global and local items, producing a
list, and returning the selected item reference.
9.3 Extra Functions
+----+
| &f | - Free space on default (specified) drive
+----+
&f{d}
This returns the amount of free space on the default (or specified)
drive. This may be used to determine if there is enough room to do
edits.
- 164 -
HyperShell Users Guide Environment Configuration
+----+
| &l | - Length of current hyperfile
+----+
&l
This returns the length of the hyperfile, as it was initially read.
This may be used to determine if it is too large to fit in the
available space on the disk.
+---------+
| &0 - &9 | - Edit mode variables
+---------+
&0 to &9
These are variables which are used in edit mode by complex functions.
0 to 4 are assignable by configured mappings
0 is a `macro' to be executed by the F3 mapping. This is a definable
edit function. Its default value is `v', which performs a syntax and
consistency check on the edit buffer.
1 and 2 are generally used in the search and replace functions.
5 to 9 are predefined variables, as follows:-
Predefined edit variables
+------------------------------------+
| 5 | edited item name |
| 6 | edited item type name |
| 7 | last deleted (part) line |
| 8 | kill buffer |
| 9 | left margin |
+------------------------------------+
9.4 Extra condition codes
The condition code `i' is set when the integrated environment is being
used, and is not set for the reader component. This permits certain
text, actions and menu options to only be effective when in the
integrated environment.
The condition code `v' is set whilst in the edit mode display of the
editor to indicate when `VIEW ONLY' mode is in effect, and can be used
in menus and notes invoked from edit mode.
9.5 Other additions to reader functionality
The `@N' popup note returns the character at the mouse cursor position
if the HOME key is pressed (this is used for selection from the
graphic map in edit mode).
- 165 -
Environment Configuration HyperShell Users Guide
Additional run option values may be obtained through function &R.
28 Edit location (0 = in memory, 1 = from file `-ef')
29 Number of edits so far
9.6 Configuration of edit mode functions
The screen editor in edit mode is driven by a number of `primitive'
functions. These can be used singly, or in combination, to form edit
operations. These operations can be mapped to control keys, or
supplied from a menu or other action modifier. A function is provided
to allow notes to be displayed, so that a help system can be set up
for the edit mode.
Configuration may be done through the HYPSHELL.CFG file, or may be
performed in the SETUP script or subsequently, by use of a mapping
action code. Please note that whilst further re-mapping of a control
key is possible, the memory allocated for previous mappings is not
freed up, so repetitive re-mapping will gradually use up memory.
An editing function string may consist of one or more edit mode
primitives chained together. For primitives expecting a parameter,
the primitive must be separated by any following primitive by a `;'
character. The screen is not re-displayed until the complete function
string has been actioned.
The parameters specified on edit mode primitives as nspec, fspec,
sspec and ispec may be a literal string or may be obtained from an
action modifier.
Param Is a Of the form
+------------------------------------------------+
| nspec | Note spec | tname,Nname,nname |
| ispec | Item spec | nname,Nname,mname,Mname, |
| | | sname,Sname,Fname |
| fspec | File spec | filename.ext |
| sspec | String | any string |
+------------------------------------------------+
Where a filename is expected, a directory dynamic menu can be used to
supply the filename, although if the file is to be obtained from other
than the current directory, it is preferable to use a prompt modifier.
There is nothing to stop action modifiers such as iterators or string
functions being used in edit functions. Try anything unusual on a
test file before you endanger any important hyperfiles, however.
Whilst you can always quit from edit mode if things go wrong, the side
effects may cause problems.
- 166 -
HyperShell Users Guide Environment Configuration
Edit mode primitive function codes
+------------------------------------------------------+
| . | Mark start line |
| - | Cut from start line |
| + | Paste cut lines |
| ^ | Paste first line `in line' |
| =c | actual character `c' |
| * | copy character from mouse position |
| < | Previous char |
| > | Next char |
| { | Beginning of paragraph (first line) |
| } | End of paragraph (last line) |
| ( | Start of repeat range (must have ; after) |
| ) | End of repeat range (end of multi-string) |
| ! | Do action (use with extreme care) |
| \filename| Save PASTE buffer as file |
+------------------------------------------------------+
+-----------------------------------------------+
| 0 | User settable edit mode |
| 1 | variables for use with |
| 2 | &0 to &4 functions |
| 3 | 0 is `macro' run by F4 key |
| 4 | 1 and 2 are used in searching |
| # | Store current column,line in &3,&4 |
+-----------------------------------------------+
- 167 -
Environment Configuration HyperShell Users Guide
+------------------------------------------------------+
| A | Autoref global |
| a | Autoref local |
| B | Beginning of line |
| b | Beginning of word |
| C | Toggle cursor tracking (actual/ displayed)|
| cspec | Convert according to `spec' |
| D | Delete current char |
| d | Delete previous char |
| E | End of line |
| e | End of word |
| F | Autoref from frame list |
| ffspec | Append file |
| Gnn | Goto line number nn |
| gnn | Goto column nn |
| H | Toggle flag interpretation |
| hnspec | Popup note |
| I | Toggle Insert/Overwrite |
| iispec | Append item |
| J | Join lines |
| j | Format paste buffer |
| K | Kill (delete) current line |
| kstring | Load kill buffer |
| L | Insert newline character |
| l | Set temp left margin |
| M | Toggle margins |
| m | Set position at mouse (or scrollbar) |
| N | Next page |
| n | Next line |
| O | open line before |
| o | open line after |
| P | Prev page |
| p | Prev line |
| Q | Quit edit |
| q | Write edit buffer to file EDITBUFF.SAV |
| R | Refresh screen |
| r | Set temp right margin |
| S | Toggle symbol shift |
| ssspec | Insert string (replace if in search/repl) |
| T | Insert TAB character |
| tfspec | Append text screen |
| U | Undelete line as separate line |
| u | Undelete line inline |
| V | Verbatim character (from keyboard) |
| v | Verify (Check) edit buffer |
| W | wipe reference flags from word |
| wfspec | Append screen with attributes |
| X | Exit edit with save |
| xsspec | Execute function string |
| Ymessage | Ask for confirmation (multiple action line|
| ystring | Search for string and position cursor |
| Z | Delete to start of line |
| z | Delete to end of line |
+------------------------------------------------------+
- 168 -
HyperShell Users Guide Environment Configuration
The `x' primitive can be used with action modifiers to provide, for
example, menus which offer various edit functions.
The keys are configured using the normal configuration strings, and
are modifiable using the `#K' action in the hyperfile or edit control
file, or in the HYPSHELL.CFG file. The configuration numbers with
their mappings are shown in the file CONFIG.DOC.
NOTE: The Control-C key cannot be mapped. The Ctrl-C/Ctrl-Break
interrupt is trapped by HyperShell in the integrated environment.
Unfortunately, the `^C' message is echoed to `standard output' when
this is pressed. If you don't want this to disturb the display,
invoke HS or HI as follows:-
HS filename > NUL
HI filename > NUL
This will `throw away' the messages, along with all other standard
output (including any fatal error messages!!!).
ALSO: Control-P and Control-S cannot be mapped, as they have other
effects through the BIOS.
Example edit operations
+------------------------------------------------------------+
| Function | Edit function string |
|----------------------------+-------------------------------|
|Help Menu from file | x@FHEHELP |
|Mark in line | L.B |
|Cut in line | LpE-d |
|Paste in line | L+ |
|Display a note file | htHEKEYS |
|Insert requested string | s?String |
|Perform requested function | x?Function |
|Insert Global item ref | s~;s@I;s~E |
|Search | y?Search for |
|Search and replace | y?Search for;s?Replace with |
|Repeated search and replace | 1?search;2?replace;(;y&1;s&2;)|
+------------------------------------------------------------+
- 169 -