|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 84352 (0x14980)
Types: TextFile
Notes: R1k Text-file segment
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦fcfbb430f⟧
└─⟦this⟧
@node !Commands.Editor
The Rational Environment's basic editing operations are defined in
package Editor. These operations apply to all objects regardless
of type and thus are primarily text-editing operations. They
should be used in conjunction with the type- and context-sensitive
procedures described in the Editing Specific Types (EST) book of
the Rational Environment Reference Manual.
The subpackages are named and organized by the objects or items to
which editing operations apply, as follows:
o Package Char: Editing operations for single characters.
o Package Cursor: Operations for cursor movement within an image
(up, down, left, and right); operations for moving the cursor by
designation (prompt or error).
o Package Hold_Stack: Operations for manipulating the hold stack
and for retrieving deletions.
o Package Image: Operations for scrolling the image.
o Package Key: Procedures for defining and saving new or custom
key bindings.
o Package Line: Editing operations for lines; operations for
moving the cursor by relative line position within a window and
for inserting and joining lines.
o Package Macro: Operations for defining, executing, saving, and
binding macros.
o Package Mark: Operations for marking locations in an image for
future reference or for moving between images.
o Package Region: Operations for defining, editing, and
manipulating regions of text.
o Package Screen: Operations for moving the cursor on the screen
regardless of window boundaries; facilities for dumping and
refreshing screen contents; facilities for manipulating the
screen stack.
o Package Search: Procedures for searching and replacing strings
of text.
o Package Set: Procedures for modifying default editor parameters.
o Package Window: Operations for managing or manipulating windows
and frames; operations for moving between windows.
o Package Word: Editing operations for words; operations for
moving the cursor by relative word position within a window.
@node !Commands.Editor.Alert
procedure Alert;
Rings the terminal bell.
@node !Commands.Editor.Noop
procedure Noop;
Performs no operation; can be used to define a key to do nothing.
@node !Commands.Editor.Quit
procedure Quit (Ignore_Changes : Boolean := False);
Ends the current session.
If the Ignore_Changes parameter is false (the default), the Quit
procedure ends the current session only if there are no new or
edited images that have not been committed. If there are images
that have not been committed, the Window Directory can be used
to find these images and to commit them before quitting. See the
Editing Specific Types (EST) book of the Rational Environment
Reference Manual for more information on the editing operations
available on the Window Directory.
If the Ignore_Changes parameter is true, the Quit procedure
does not warn whether an image needs committing. In that case,
it simply ends the current session and ignores any changes to
uncommitted images.
Note that the editor treats I/O windows with jobs requesting input
running in them as uncommitted images. You cannot log off while
such jobs are running without terminating them or ignoring changes.
@node !Commands.Editor.Char
package Char is
procedure Capitalize (Repeat : Integer := 1);
procedure Delete_Backward (Repeat : Integer := 1);
procedure Delete_Forward (Repeat : Integer := 1);
procedure Delete_Next (Repeat : Integer := 1);
procedure Delete_Previous (Repeat : Integer := 1);
procedure Delete_Spaces (Remaining : Natural := 1);
procedure Insert_String (Value : String);
procedure Insert_Character (Repeat : Integer := 1;
Value : Character);
procedure Lower_Case (Repeat : Integer := 1);
procedure Quote;
procedure Tab_Backward (Repeat : Integer := 1);
procedure Tab_Forward (Repeat : Integer := 1);
procedure Tab_To_Comment;
procedure Transpose (Offset : Integer := 1);
procedure Upper_Case (Repeat : Integer := 1);
end Char;
Package Char contains character-editing operations. The cursor
always rests between two characters or blanks. However, the cursor
appears to be on the second character of the two characters it
rests between. For example, in the word and, when the cursor
appears to be on n, it is actually located between the a and the n.
All character-editing operations affect the characters before or
after the cursor Repeat times.
The case-changing operations move the cursor forward Repeat
positions. They check for an alphabetic character in each position
and, if they find one, change its case.
The Tab_Forward procedure inserts blanks forward to the next tab
stop. The Tab_Backward procedure deletes all characters and blank
spaces back to the previous tab stop.
The Insert procedures insert the value specified in the Value
parameter in the image at the cursor.
By default, characters entered at the keyboard are inserted
in the image. If the editor must make room for a character in
the line, it moves any characters that lie to the right of the
cursor. Conversely, when a character is deleted, the editor shifts
characters to occupy the emptied position.
In overwrite mode, characters in the image are not moved to make
room for new insertions. Instead, a character entered from
the keyboard replaces the character under the cursor. (See the
Set.Insert_Mode procedure.)
Use the Quote procedure to insert special characters (such as
control characters) in the image. Special characters appear in
the image as highlighted characters. For example, the Control-L
character appears as a highlighted L in the image.
The Delete_Spaces procedure removes blanks between the cursor and
the next nonblank character.
@node !Commands.Editor.Char.Capitalize
procedure Capitalize (Repeat : Integer := 1);
Capitalizes the words in the next Repeat characters.
If the cursor is within a word, the procedure capitalizes the
"word" beginning at the cursor. The cursor is left after the last
word capitalized.
@node !Commands.Editor.Char.Delete_Backward
procedure Delete_Backward (Repeat : Integer := 1);
Deletes Repeat characters to the left of the cursor.
When the cursor reaches the beginning of the line, the line becomes
joined with the line before it. The cursor continues deleting on
that line.
@node !Commands.Editor.Char.Delete_Forward
procedure Delete_Forward (Repeat : Integer := 1);
Deletes Repeat characters to the right of the cursor.
When the cursor reaches the end of the line, the line becomes
joined with the line after it. The cursor continues deleting on
that line. The cursor remains in its original position.
@node !Commands.Editor.Char.Delete_Next
procedure Delete_Next (Repeat : Integer := 1);
Deletes Repeat next characters but does not delete beyond the
current line.
If Repeat is greater than the number of characters on the line,
the procedure deletes to the end of the line and stops. The cursor
remains in its original position.
@node !Commands.Editor.Char.Delete_Previous
procedure Delete_Previous (Repeat : Integer := 1);
Deletes Repeat previous characters but does not delete beyond the
current line.
If Repeat is greater than the number of characters on the line, the
procedure deletes to the beginning of the line and stops.
@node !Commands.Editor.Char.Delete_Spaces
procedure Delete_Spaces (Remaining : Natural := 1);
Deletes blanks and joins lines from the cursor to the next nonspace
character (in both directions), leaving Remaining spaces.
@node !Commands.Editor.Char.Insert_Character
procedure Insert_Character (Repeat : Integer := 1;
Value : Character);
Inserts the Value character Repeat times at the cursor.
After the operation, the cursor is located after the rightmost
character inserted.
@node !Commands.Editor.Char.Insert_String
procedure Insert_String (Value : String);
Inserts Value at the cursor.
After the operation, the cursor is located after the rightmost
character inserted.
@node !Commands.Editor.Char.Lower_Case
procedure Lower_Case (Repeat : Integer := 1);
Converts Repeat characters to lowercase.
The procedure moves forward Repeat spaces and, where it finds
an uppercase alphabetic character, converts the character to
lowercase.
@node !Commands.Editor.Char.Quote
procedure Quote;
Quotes a special character, such as a control character, into the
image.
This procedure must be used for each special character inserted
into the image. The procedure cannot be called from a Command
window but must be invoked through a key binding; use the
Insert_Character procedure or the Insert_String procedure to
insert special characters from a Command window or program.
@node !Commands.Editor.Char.Tab_Backward
procedure Tab_Backward (Repeat : Integer := 1);
Deletes backward to the previous tab stop Repeat times.
This procedure affects only the current line.
@node !Commands.Editor.Char.Tab_Forward
procedure Tab_Forward (Repeat : Integer := 1);
Inserts blanks to the next tab stop Repeat times.
This procedure affects only the current line.
@node !Commands.Editor.Char.Tab_To_Comment
procedure Tab_To_Comment;
Moves the cursor to the first character of the text in the comment,
if there is a comment on the current line.
If there is no comment on the line and no text currently located
at the comment column (set by the Comment_Column library switch),
this procedure inserts the comment characters (-- ) and leaves the
cursor at the first character position for the comment. Otherwise,
if there is text at the comment column, the procedure moves the
cursor to the end of the text, inserts the comment characters (--
), and leaves the cursor after the inserted characters.
@node !Commands.Editor.Char.Transpose
procedure Transpose (Offset: Integer := 1);
Transposes the Offset characters before and after the cursor.
The cursor actually appears on the second character of the two
characters it rests between. Thus, this procedure transposes
the character on which the cursor is located and the character
before it. The procedure transposes characters on the same line.
The cursor position that results depends on the value of the
Cursor_Transpose_Moves session switch. If the value is true,
the cursor is moved to the right one character position. If it
is false, the position of the cursor is not changed. For more
information on session switches, see SJM, Session Switches.
@node !Commands.Editor.Char.Upper_Case
procedure Upper_Case (Repeat : Integer := 1);
Converts Repeat characters to uppercase.
The procedure moves forward Repeat spaces and, where it finds
a lowercase alphabetic character, converts the character to
uppercase.
@node !Commands.Editor.Cursor
package Cursor is
procedure Down (Repeat : Integer := 1);
procedure Left (Repeat : Integer := 1);
procedure Right (Repeat : Integer := 1);
procedure Up (Repeat : Integer := 1);
procedure Forward (Repeat : Integer := 1);
procedure Backward (Repeat : Integer := 1);
procedure Next (Repeat : Integer := 1;
Prompt : Boolean := True;
Underline : Boolean := True);
procedure Previous (Repeat : Integer := 1;
Prompt : Boolean := True;
Underline : Boolean := True);
end Cursor;
The Up, Down, Left, and Right procedures move the cursor in the
indicated direction Repeat times.
The Next and Previous procedures move the cursor by prompts or
underlines.
The Forward and Backward procedures move the cursor left and right,
continuing cursor movement on the next or previous line when the
cursor reaches the end or beginning of the current line.
Cursor movement is restricted by window boundaries with commands in
this package. (Commands in package Screen can be used to move the
cursor across window boundaries.) At window boundaries, the editor
keeps the cursor visible by scrolling the image.
The cursor highlights a unique location in each image, indicating
to the editor where to place keyboard insertions. The cursor is a
point of reference for focusing the attention of the Environment,
specifying the domain for any command in progress or the object
to which an operation applies. The cursor actually appears on a
character but represents the position between the character it is
on and the character before it.
@node !Commands.Editor.Cursor.Backward
procedure Backward (Repeat : Integer := 1);
Moves the cursor to the left Repeat characters.
When the cursor is at the beginning of the current line, this
procedure moves the cursor to the position after the last character
on the previous line. Negative values move the cursor in the
opposite direction, to the right.
@node !Commands.Editor.Cursor.Down
procedure Down (Repeat : Integer := 1);
Moves the cursor down Repeat lines.
Negative values move the cursor in the opposite direction.
@node !Commands.Editor.Cursor.Forward
procedure Forward (Repeat : Integer := 1);
Moves the cursor to the right Repeat characters.
When the cursor is one position past the last character on the
current line, this procedure moves the cursor to the first
character on the next line. Negative values move the cursor in
the opposite direction, to the left.
@node !Commands.Editor.Cursor.Left
procedure Left (Repeat : Integer := 1);
Moves the cursor Repeat columns to the left, stopping at the
beginning of the line.
Negative values move the cursor in the opposite direction, to the
right.
@node !Commands.Editor.Cursor.Next
procedure Next (Repeat : Integer := 1;
Prompt : Boolean := True;
Underline : Boolean := True);
Moves the cursor forward to the next underline or prompt.
Negative values for the Repeat parameter move the cursor in the
opposite direction. If the Prompt parameter is true (the default),
the procedure looks for the next prompt. If the Underline
parameter is true, the procedure looks for the next underline.
When both parameters are true, the procedure looks for the next
occurrence of either a prompt or an underline; if both are false,
it does nothing.
@node !Commands.Editor.Cursor.Previous
procedure Previous (Repeat : Integer := 1;
Prompt : Boolean := True;
Underline : Boolean := True);
Moves the cursor backward to the previous underline or prompt.
Negative values for the Repeat parameter move the cursor in the
opposite direction. If the Prompt parameter is true (the default),
the procedure looks for the previous prompt. If the Underline
parameter is true, the procedure looks for the previous underline.
When both parameters are true, the procedure looks for the previous
occurrence of either a prompt or an underline; if both are false,
it does nothing.
@node !Commands.Editor.Cursor.Right
procedure Right (Repeat : Integer := 1);
Moves the cursor Repeat columns to the right on the current line.
Negative values move the cursor in the opposite direction, stopping
at the beginning of the line.
@node !Commands.Editor.Cursor.Up
procedure Up (Repeat : Integer := 1);
Moves the cursor up Repeat lines.
Negative values move the cursor in the opposite direction.
@node !Commands.Editor.Hold_Stack
package Hold_Stack is
procedure Copy_Top;
procedure Delete_Top;
procedure Next (Repeat : Integer := 1);
procedure Previous (Repeat : Integer := 1);
procedure Push (Repeat : Integer := 1);
procedure Rotate (Repeat : Integer := 1);
procedure Swap;
procedure Top;
end Hold_Stack;
Package Hold_Stack provides a mechanism for recovering deletions.
The Rational Editor saves the 100 most recent deletions (larger
than a single character) in the hold stack. Deleted selections of
any size are also saved. Items in the stack can be retrieved and
inserted at the cursor with the Top, Next, or Previous procedure.
An item retrieved from the hold stack is displayed and treated as a
selection.
The Push procedure puts the current selection in the hold stack.
The Top procedure inserts the most recent item back into the
image at the cursor. The Next and Previous procedures provide a
mechanism for moving through the items in the stack. They replace
the selection at the cursor with the next or previous item in the
stack. At the bottom of the stack, Next wraps to the top. At
the top of the stack, Previous wraps to the bottom. The Copy_Top
procedure makes a copy of the top item of the stack and puts it
on the top of the stack. The Delete_Top procedure removes the
top item from the stack. The Rotate procedure takes the bottom
item of the stack and places it on the top of the stack. The Swap
procedure swaps the top two items on the stack.
@node !Commands.Editor.Hold_Stack.Copy_Top
procedure Copy_Top;
Copies the top item of the hold stack onto the top of the hold
stack.
The result is that there are two copies of the same item on the top
of the hold stack.
@node !Commands.Editor.Hold_Stack.Delete_Top
procedure Delete_Top;
Removes the top item from the hold stack.
The item next to the top of the hold stack becomes the top item of
the hold stack.
@node !Commands.Editor.Hold_Stack.Next
procedure Next (Repeat : Integer := 1);
Retrieves the Repeat item from the hold stack and copies it at the
current cursor location.
At the bottom of the stack, this procedure wraps to the top.
@node !Commands.Editor.Hold_Stack.Previous
procedure Previous (Repeat : Integer := 1);
Retrieves the previous Repeat item from the hold stack and copies
it at the current cursor location.
At the top of the stack, this procedure wraps to the bottom.
@node !Commands.Editor.Hold_Stack.Push
procedure Push (Repeat : Integer := 1);
Pushes the current selection onto the hold stack Repeat times.
@node !Commands.Editor.Hold_Stack.Rotate
procedure Rotate (Repeat : Integer := 1);
Takes the Repeat number of items from the bottom of the stack and
places them on the top of the hold stack in order.
@node !Commands.Editor.Hold_Stack.Swap
procedure Swap;
Swaps the top two items on the hold stack.
The item next to the top of the hold stack becomes the top item of
the hold stack. The original top item becomes the item next to the
top of the hold stack.
@node !Commands.Editor.Hold_Stack.Top
procedure Top;
Retrieves the top item in the hold stack, leaving that item on the
hold stack.
The retrieved item is copied into the current cursor location.
@node !Commands.Editor.Image
package Image is
procedure Up (Repeat : Integer := 0);
procedure Down (Repeat : Integer := 0);
procedure Left (Repeat : Integer := 0);
procedure Right (Repeat : Integer := 0);
procedure Find (Name : String);
procedure Beginning_Of (Offset : Natural := 0);
procedure End_Of (Offset : Natural := 0);
end Image;
Package Image includes operations for finding and scrolling
images. The Find procedure searches for an image of a given name
in the Window Directory and displays it on the screen. The Up,
Down, Left, and Right procedures scroll the image Repeat lines
or columns in the indicated direction. The default (Repeat = 0)
scrolls the image one full window. When scrolling a full window,
the editor keeps a portion of the previous view to preserve context
(how much it keeps can be specified with switches).
The Beginning_Of and End_Of procedures move the view as indicated
but use Offset to adjust the new cursor position by Offset lines
from the beginning or end of the image.
@node !Commands.Editor.Image.Beginning_Of
procedure Beginning_Of (Offset : Natural := 0);
Moves the cursor to the beginning of the image.
This procedure uses Offset to adjust the new cursor position by
Offset lines from the beginning of the image.
@node !Commands.Editor.Image.Down
procedure Down (Repeat : Integer := 0);
Scrolls the image forward Repeat lines.
When Repeat = 0, the procedure scrolls one full window. If Repeat
is a negative number, it scrolls down Repeat lines.
@node !Commands.Editor.Image.End_Of
procedure End_Of (Offset : Natural := 0);
Moves the cursor to the end of the image.
This procedure uses Offset to adjust the new cursor position by
Offset lines from the end of the image.
@node !Commands.Editor.Image.Find
procedure Find (Name : String);
Searches the Window Directory for the specified image, or for an
image that contains a substring of Name in its name, and brings it
onto the screen.
If the null string is supplied as Name, the procedure brings back
to the screen the last image the Environment removed from the
screen (this does not include images explicitly removed by users
either by deleting them or marking them for replacement).
@node !Commands.Editor.Image.Left
procedure Left (Repeat : Integer := 0);
Scrolls the image left Repeat columns.
When Repeat = 0, the procedure scrolls one full window. If Repeat
is a negative number, it scrolls right. If the first character of
the image is already in the first character position of the window,
the procedure does nothing.
@node !Commands.Editor.Image.Right
procedure Right (Repeat : Integer := 0);
Scrolls the image right Repeat columns.
When Repeat = 0, the procedure scrolls one full window. If Repeat
is a negative number, it scrolls left.
@node !Commands.Editor.Image.Up
procedure Up (Repeat : Integer := 0);
Scrolls the image back Repeat lines.
When Repeat = 0, the procedure scrolls one full window. If Repeat
is a negative number, it scrolls down. If the first line of the
image is already at the top of the screen, the procedure does
nothing.
@node !Commands.Editor.Key
package Key is
procedure Define (Key_Name : String := ">>KEY NAME, e.g. CM_F1<<";
Command_Name : String := ">>COMMAND NAME<<";
Prompt : Boolean := False);
procedure Name (Key_Code : String := "");
procedure Save;
procedure Prompt (Key_Code : String := "");
end Key;
Use the procedures in package Key to bind any procedure from
!Commands or any fully qualified Ada procedure call to a key.
These bindings are in effect until the user logs off.
For example, function key names are defined as follows:
F1--F20 Function keys---for example, F10 is the Definition
key.
S_key The Shift key pressed along with another key,
nonalphanumeric---for example, S_F10.
C_key The Control key pressed along with another key---for
example, C_G or C_F10.
M_key The Meta key pressed along with another key---for
example, M_F10.
CS_key The Control and Shift keys pressed along with another
key---for example, CS_F10.
CM_key The Control and Meta keys pressed along with another
key---for example, CM_F10.
MS_key The Meta and Shift keys pressed along with another
key---for example, MS_F10.
CMS_key The Control, Meta, and Shift keys pressed along with
another key---for example, CMS_F10.
To determine the key name for a key, use the !Commands.What.Does or
What.Key procedure.
Another way to change the key bindings is to create a permanent
local key binding procedure. This is outlined below.
At login, the Environment assigns the key bindings defined in the
!Machine.Editor_Data.Rational_Commands procedure, which globally
assigns commands to key bindings for the entire system. This
procedure applies to the Rational Terminal. Other procedures exist
for each of the types of terminals that can be specified at login.
Users who want to create their own local key bindings should
build in their home world a procedure called Rational_Commands
that uses the same form as the default procedure, !Machine.Ed-
itor_Data.Rational_Commands. A template for this procedure,
called !Machine.Editor_Data.Rational_User_Commands, contains the
case statements and the proper context clauses. Like the default
procedure, this local procedure should contain a case statement;
it needs only those cases defined that differ from the cases of the
default procedure.
To create a local keymap, create a Rational_Commands procedure
in your home world and copy the contents of the !Machine.Edi-
tor_Data.Rational_User_Commands procedure into it. Modify the
case statement as desired, install the procedure, quit, and then
log in again for the new key bindings to take effect.
The Rational_Commands procedure applies specifically to the
Rational Terminal. Other terminals that the Environment
supports need similar procedures with different names for their
key bindings. The directory !Machine.Editor_Data contains
procedures and templates for each of the terminals supported by
the Environment.
@node !Commands.Editor.Key.Define
procedure Define (Key_Name : String := ">>KEY NAME, e.g. CM_F1<<";
Command_Name : String := ">>COMMAND NAME<<";
Prompt : Boolean := False);
Binds a command to a key.
The Key_Name parameter specifies the key to which the command
should be bound. To find out the name of a key, use the
!Commands.What.Does or What.Key procedure. The Command_Name
parameter specifies the command to be bound to Key_Name---for
example, Text.Create. The Prompt parameter specifies whether a
Command window should be brought up containing the command.
The Command_Name parameter either can take simple names (if they
are in the current context) or can be resolved via your searchlist
when it is defined. The key is bound to the object itself, rather
than the name. Thus, if there is an object in the current context
with the same simple name as Command_Name, the system will retrieve
the correct one.
To bind a procedure that has parameters and is not in your current
searchlist, you must enclose the name in quotes. For example, to
call a procedure called Phone in !Users.John, with a parameter
requesting the name of a person in the phone list, you would enter:
Key.Define
(Key_Name=>"F1",Command_Name=>"""!Users.John"".Phone(""Bill"")");
@node !Commands.Editor.Key.Name
procedure Name (Key_Code : String := "");
Displays help for the next key pressed, including a valid key name
and any procedures bound to that key.
@node !Commands.Editor.Key.Prompt
procedure Prompt (Key_Code : String := "");
Displays in a Command window the full procedure, with prompts, that
is bound to the next key pressed.
This allows you to change the default values for the parameters.
@node !Commands.Editor.Key.Save
procedure Save;
Not implemented in the current release of the Environment.
@node !Commands.Editor.Line
package Line is
procedure Beginning_Of (Offset : Natural := 0);
procedure Capitalize (Repeat : Integer := 1);
procedure Center (Right_Margin : Natural := 0);
procedure Copy (Repeat : Integer := 1);
procedure Delete (Repeat : Integer := 1);
procedure Delete_Backward (Repeat : Integer := 1);
procedure Delete_Forward (Repeat : Integer := 1);
procedure End_Of (Offset : Natural := 0);
procedure Insert (Repeat : Integer := 1);
procedure Indent (Repeat : Integer := 1);
procedure Join (Repeat : Integer := 1);
procedure Lower_Case (Repeat : Integer := 1);
procedure Open (Repeat : Integer := 1);
procedure Transpose (Offset : Integer := 1);
procedure Upper_Case (Repeat : Integer := 1);
procedure Next (Repeat : Integer := 1) renames Cursor.Down;
procedure Previous (Repeat : Integer := 1) renames Cursor.Up;
end Line;
Package Line contains operations for manipulating lines in an
image. Except for the Delete, Center, and Copy procedures,
editing operations affect the line starting at the cursor. The
Beginning_Of, End_Of, Delete, Center, and Copy procedures affect
the entire line regardless of where the cursor is on the line.
The Transpose procedure affects the current and previous lines
without moving the cursor. The Join procedure affects the current
line and the next line.
The Indent procedure starts a new line, indented to the previous
level of indentation. The Open procedure starts a new line below
the cursor but does not affect the cursor's position. The Insert
procedure inserts a new line, with the cursor remaining at the
first column of the line.
The Beginning_Of and End_Of procedures move the cursor as indicated
but use the Offset value to adjust the new cursor position by
Offset columns from the beginning or end of a line.
@node !Commands.Editor.Line.Beginning_Of
procedure Beginning_Of (Offset : Natural := 0);
Moves the cursor to the first nonblank character in the line.
This procedure uses the Offset value to adjust the new cursor
position by Offset columns from the beginning of the line. When
repeated in succession, it toggles the cursor between column 1 and
the first nonblank character.
@node !Commands.Editor.Line.Capitalize
procedure Capitalize (Repeat : Integer := 1);
Capitalizes each word following the cursor in the next Repeat lines
and leaves the cursor at the beginning of the following line.
@node !Commands.Editor.Line.Center
procedure Center (Right_Margin : Natural := 0);
Centers from the first nonblank character on the line to the last
nonblank character on the line.
This procedure centers the nonblank characters of the entire line
between the first column and the specified right margin. If the
right margin is specified as 0 (the default), the defined fill
column is used (see package Set).
@node !Commands.Editor.Line.Copy
procedure Copy (Repeat : Integer := 1);
Copies the current line Repeat times and places the new copy
immediately below the current line, pushing all remaining lines
down in the image.
@node !Commands.Editor.Line.Delete
procedure Delete (Repeat : Integer := 1);
Deletes the next Repeat lines beginning with the current line.
Negative values delete previous lines beginning with the current
line.
@node !Commands.Editor.Line.Delete_Backward
procedure Delete_Backward (Repeat : Integer := 1);
Deletes Repeat lines from the cursor back to the left margin and
Repeat -- 1 full line above the current line.
When Repeat = 1, this procedure deletes characters back to column 1
but not the line itself.
@node !Commands.Editor.Line.Delete_Forward
procedure Delete_Forward (Repeat : Integer := 1);
Deletes from the cursor to the end of the line and Repeat -- 1
lines following.
@node !Commands.Editor.Line.End_Of
procedure End_Of (Offset : Natural := 0);
Moves the cursor after the last nonblank character in the line, if
Offset = 0.
This procedure uses the Offset value to adjust the new cursor
position by Offset columns from the end of the line toward the
beginning of the line.
@node !Commands.Editor.Line.Indent
procedure Indent (Repeat : Integer := 1);
Opens Repeat new lines before the current line and indents to the
previous indentation.
If the cursor is within the current line, the procedure splits the
line at the cursor position.
@node !Commands.Editor.Line.Insert
procedure Insert (Repeat : Integer := 1);
Opens Repeat new lines before the current line.
If the cursor is within the current line, the procedure splits the
line at the cursor position. If Repeat = 0, no line is opened.
Negative values cause the absolute value of Repeat lines to be
before the current line, without splitting the current line at the
cursor position.
@node !Commands.Editor.Line.Join
procedure Join (Repeat : Integer := 1);
Joins the next Repeat lines to the current line, leaving the cursor
on the first character that came from the last line.
@node !Commands.Editor.Line.Lower_Case
procedure Lower_Case (Repeat : Integer := 1);
Converts the next Repeat lines from uppercase to lowercase starting
at the cursor position in the current line and leaves the cursor at
the beginning of the following line.
@node !Commands.Editor.Line.Next
procedure Next (Repeat : Integer := 1) renames Cursor.Down;
Moves the cursor down Repeat lines.
@node !Commands.Editor.Line.Open
procedure Open (Repeat : Integer := 1);
Opens Repeat new lines but does not change the cursor position.
If the cursor is within the line, the line is split. If Repeat
= 0, no line is added and the line is not split. If Repeat is a
negative value, the line is not split, but the absolute value of
Repeat lines are inserted before the current line.
@node !Commands.Editor.Line.Previous
procedure Previous (Repeat : Integer := 1) renames Cursor.Up;
Moves the cursor up Repeat lines.
@node !Commands.Editor.Line.Transpose
procedure Transpose (Offset : Integer := 1);
Exchanges the current and previous lines.
The cursor position that results depends on the value of the
Cursor_Transpose_Moves session switch. If the value is true,
the cursor is moved down one line. If it is false, the cursor
position is not changed. See SJM, Session Switches, for more
information on session switches. The Offset parameter is currently
not implemented.
@node !Commands.Editor.Line.Upper_Case
procedure Upper_Case (Repeat : Integer := 1);
Converts the next Repeat lines starting at the cursor position in
the current line from lowercase to uppercase and leaves the cursor
at the beginning of the following line.
@node !Commands.Editor.Macro
package Macro is
procedure Start;
procedure Finish;
procedure Execute (Repeat : Integer := 1;
Prior : Natural := 0);
procedure Bind (Key : String := "");
procedure Save (Expanded : Boolean := False);
procedure Restore;
end Macro;
A macro is a sequence of editor procedures that can be invoked with
a single command. Macros can be bound to a key or referenced as
the current macro.
To define a keyboard macro:
1. Execute the Start procedure from a key (by pressing [Mark] -
[Begin_Of ] on the Rational Terminal).
2. Enter a sequence of commands or characters from the keyboard.
The editor will remember each keystroke in sequence.
3. Execute the Finish procedure from a key (by pressing [Mark] -
[End_Of ] on the Rational Terminal).
Execute the macro Repeat times with the Execute procedure.
The editor allows only one unbound keyboard macro definition at a
time. This macro is sometimes referred to as the current macro.
A new definition replaces an existing definition. However, the
current macro can be invoked while a new macro is being defined.
A macro can be bound to a key and stored for the duration of the
session with the Bind procedure. Macros can be saved between
sessions with the Save procedure. They are written into a file
in the user's home world. Typically, the filename identifies
the terminal type---for example, Rational_Macros. This file is
processed at login.
A macro file can be edited once it has been saved.
Each macro that has been bound has a number. This number is
displayed when the Bind procedure is executed. This number is also
displayed when the Execute procedure is used to execute macros.
The current macro is number 0.
If a macro is executed from an Ada program by calling the Execute
procedure, the macro will not be executed until the job completes.
@node !Commands.Editor.Macro.Bind
procedure Bind (Key : String := "");
Binds the current keyboard macro to Key and assigns it a number.
This procedure prompts for a key for binding the macro and displays
the number assigned to the macro. The key name is the name of the
key for the terminal you are using. You can determine this name
by pressing [Help on Key]. The key name will appear in the Message
window.
@node !Commands.Editor.Macro.Execute
procedure Execute (Repeat : Integer := 1;
Prior : Natural := 0);
Executes a keyboard macro Repeat times.
If Prior = 0, the current macro is executed. If Prior does not
equal 0, the macro with the number indicated by Prior is executed.
See the Bind procedure for more information on macro numbers.
If a macro is executed from an Ada program by calling the Execute
procedure, the macro will not be executed until the job completes.
@node !Commands.Editor.Macro.Finish
procedure Finish;
Ends a macro definition.
Note that this command must be executed from a bound key and not
from a Command window.
@node !Commands.Editor.Macro.Restore
procedure Restore;
Rereads the macro file.
Macro files are read by the system only when the user logs in.
Thus, if the user edits the macro file, the new contents of the
file will not be known to the system unless it rereads the macro
file. The user can execute this procedure to force the system to
read the macro file without logging out and logging back in again.
@node !Commands.Editor.Macro.Save
procedure Save (Expanded : Boolean := False);
Saves the current macro file.
The Expanded parameter saves the macro file in user-readable
format, which means that you can edit the macros saved in the
file. When you save a macro file, it overwrites the current macro
file.
@node !Commands.Editor.Macro.Start
procedure Start;
Begins a macro definition.
Note that this command must be executed from a bound key and not
from a Command window.
@node !Commands.Editor.Mark
package Mark is
procedure Copy_Top;
procedure Delete_Top;
procedure Next (Repeat : Integer := 1);
procedure Previous (Repeat : Integer := 1);
procedure Push (Repeat : Integer := 1);
procedure Rotate (Repeat : Integer := 1);
procedure Swap;
procedure Top;
end Mark;
A mark is a remembered image position. The Rational Editor
remembers marks as absolute image positions on the quarter plane.
Mark positions do not change to adjust for inserted or deleted
lines and characters.
Use the Push procedure to set a mark. The Top procedure then
returns the cursor to the most recently set mark, returning the
image to the screen, if necessary, for the marked image to be
visible. The Next and Previous procedures move from mark to mark
as they are ordered on the stack. At the bottom of the stack,
the Next procedure wraps to the top. At the top, the Previous
procedure wraps to the bottom. The Copy_Top procedure makes
another copy of the top mark on the stack on the top of the stack.
The Delete_Top procedure removes the top mark from the stack. The
Swap procedure swaps the top two marks on the stack. The Rotate
procedure moves the bottom mark on the stack to the top of the
stack.
The mark stack holds up to 100 marks. Since there is only one mark
stack for all images, marks can be used to move from image to image
as well as from point to point within an image.
@node !Commands.Editor.Mark.Copy_Top
procedure Copy_Top;
Makes another copy of the top mark of the mark stack on the top of
the mark stack.
The result is that there are two copies of the top item on the top
of the mark stack.
@node !Commands.Editor.Mark.Delete_Top
procedure Delete_Top;
Deletes the top item on the mark stack.
@node !Commands.Editor.Mark.Next
procedure Next (Repeat : Integer := 1);
Moves to the position specified by Repeat next mark.
At the bottom of the stack, this procedure wraps to the top. If
Repeat = 0, it does nothing. If Repeat is a negative value, it
moves to the Repeat previous mark.
@node !Commands.Editor.Mark.Previous
procedure Previous (Repeat : Integer := 1);
Moves to the Repeat previous mark.
At the top of the stack, this procedure wraps to the bottom. If
Repeat = 0, it does nothing. If Repeat is a negative value, it
moves to the Repeat next mark.
@node !Commands.Editor.Mark.Push
procedure Push (Repeat : Integer := 1);
Sets Repeat marks at the cursor and pushes them onto the stack.
If Repeat = 0 or a negative value, the procedure does nothing.
@node !Commands.Editor.Mark.Rotate
procedure Rotate (Repeat : Integer := 1);
Rotates Repeat number of marks from the bottom of the stack to the
top of the stack.
If Repeat = 0, the procedure does nothing. If Repeat is a negative
value, it rotates Repeat number of items from the top of stack to
the bottom of the stack.
@node !Commands.Editor.Mark.Swap
procedure Swap;
Swaps the top two marks on the mark stack.
The mark next to the top of the mark stack becomes the top mark of
the mark stack. The top mark of the mark stack becomes the mark
next to the top of the mark stack.
@node !Commands.Editor.Mark.Top
procedure Top;
Moves to the mark at the top of the stack.
@node !Commands.Editor.Region
package Region is
procedure Beginning_Of;
procedure Capitalize;
procedure Comment;
procedure Copy;
procedure Delete;
procedure End_Of;
procedure Fill (Column : Natural := 0;
Leading : String := "");
procedure Finish;
procedure Justify (Column : Natural := 0;
Leading : String := "");
procedure Lower_Case;
procedure Move;
procedure Off;
procedure On;
procedure Start;
procedure Uncomment;
procedure Upper_Case;
end Region;
Package Region contains procedures for making and manipulating
selections. To make a selection with the Region package, indicate
the beginning with the Start procedure, and then move the cursor to
the end and indicate it with the Finish procedure. The commands in
package Common.Object (EST) can also be used to make selections.
The Rational Editor highlights the selection in a different font.
It highlights only one selection at a time. You can use the Off
and On procedures to unselect and reselect a selection.
The locations of selections of text can be stored in the hold
stack. For further information, see package Hold_Stack.
@node !Commands.Editor.Region.Beginning_Of
procedure Beginning_Of;
Moves the cursor to the beginning of the current selection, if the
cursor and the selection are in the same window.
If there is no selection in the current window, the procedure does
nothing.
@node !Commands.Editor.Region.Capitalize
procedure Capitalize;
Capitalizes the first letter in all the words in the selection.
If the cursor and the selection are not in the same window, the
procedure does nothing.
@node !Commands.Editor.Region.Comment
procedure Comment;
Puts comment characters (-- ) before the leftmost character of each
line in the current selection.
If a line is already commented in that se-
lection, additional comment characters
(-- ) are inserted in front of it.
@node !Commands.Editor.Region.Copy
procedure Copy;
Copies the current selection to the cursor location.
The selection and the cursor can be in different windows.
@node !Commands.Editor.Region.Delete
procedure Delete;
Deletes the current selection and pushes it onto the hold stack.
The cursor and the selection must be in the same window.
@node !Commands.Editor.Region.End_Of
procedure End_Of;
Moves the cursor to the end of the current selection.
The cursor and the selection must be in the same window.
@node !Commands.Editor.Region.Fill
procedure Fill (Column : Natural := 0;
Leading : String := "");
Adjusts the placement of all words in the selection to fill
completely the column between the left edge of the image and the
defined right margin (the Column parameter).
If Column = 0 (the default), the fill column defined by the
Image_Fill_Column session switch is used (described in SJM,
Session Switches). The Fill command puts as many words as possible
on a line, but it leaves a ragged right margin. It also leaves
only one space between words.
The Leading parameter allows a character string to be inserted
at the beginning of each line in the selection. This can be
used, for example, to insert the comment delimiter, (-- ),
into the selection. If the null string (the default), is used
for the parameter, then the leading string defined by the
Image_Fill_Prefix session switch is used (described in SJM,
Session Switches).
@node !Commands.Editor.Region.Finish
procedure Finish;
Marks the endpoint of a text selection.
@node !Commands.Editor.Region.Justify
procedure Justify (Column : Natural := 0;
Leading : String := "");
Adjusts the placement of all words in the selection to justify the
selection flush left between the left edge of the image and the
defined right margin (the Column parameter).
If Column = 0 (the default), the fill column defined by the
Image_Fill_Column session switch is used (described in SJM,
Session Switches). The Justify command puts as many words as
possible on a line and inserts spaces so that the right margin is
even.
The Leading parameter allows a character string to be inserted at
the beginning of each line in the selection. This can be used, for
example, to insert the comment delimiter (-- ) into the selection.
If the null string (the default) is used for the parameter, the
leading string defined by the Image_Fill_Prefix session switch is
used (described in SJM, Session Switches).
By default, the Justify command does not compress extra spaces
after the period (.), exclamation mark (!), and question mark (?)
when filling an image. However, this default can be changed by
modifying the Image_Fill_Extra_Space session switch. (See SJM,
Session Switches, for more information on session switches.)
Also by default, the Justify command indents subsequent lines to
the indent level of the first line of the region. However, this
default can be changed by modifying the Image_Fill_Indent session
switch. A value of -1 for this switch (the default) specifies that
the indentation of the first line of the region should be used for
subsequent lines. Values greater than or equal to 0 indent the
region the number of spaces that is the value of the switch.
@node !Commands.Editor.Region.Lower_Case
procedure Lower_Case;
Converts all characters in the selection to lowercase.
The cursor and the selection must be in the same window.
@node !Commands.Editor.Region.Move
procedure Move;
Deletes the current selection and copies it at the cursor.
The cursor and the selection must be in the same window.
@node !Commands.Editor.Region.Off
procedure Off;
Unselects the current selection.
The cursor and the selection must be in the same window.
@node !Commands.Editor.Region.On
procedure On;
Reselects a selection that has been unselected with the Off
procedure.
The cursor and the selection must be in the same window.
@node !Commands.Editor.Region.Start
procedure Start;
Marks the start of a selection.
@node !Commands.Editor.Region.Uncomment
procedure Uncomment;
Removes comment characters (-- ) from lines in which they are the
leftmost three nonblank characters.
This procedure does not remove comments from the end of lines
containing Ada code. The cursor and the selection must be in the
same window.
@node !Commands.Editor.Region.Upper_Case
procedure Upper_Case;
Converts the selection to uppercase.
The cursor and the selection must be in the same window.
@node !Commands.Editor.Screen
package Screen is
procedure Down (Repeat : Integer := 1);
procedure Left (Repeat : Integer := 1);
procedure Right (Repeat : Integer := 1);
procedure Up (Repeat : Integer := 1);
procedure Dump (To_File : String := ">>NAME<<");
procedure Redraw;
procedure Clear;
procedure Copy_Top;
procedure Delete_Top;
procedure Next (Repeat : Integer := 1);
procedure Previous (Repeat : Integer := 1);
procedure Push (Repeat : Integer := 1);
procedure Rotate (Repeat : Integer := 1);
procedure Swap;
procedure Top;
end Screen;
The movement operations of package Screen move the cursor Repeat
times in the indicated direction, regardless of window boundaries.
The Clear procedure erases the contents of the screen. The Redraw
procedure erases the contents and then repaints the screen.
The Dump procedure captures the contents of the screen in a file
specified by the To_File parameter, one screen line per line. Each
line contains graphics control sequences embedded in text. The
graphics control sequences signify:
o A graphics font for window borders.
o Selected and unselected fonts for plain text, underlined text,
and reverse video text.
Package Screen provides a mechanism for saving screens on a stack
for retrieval at a later time. The 100 most recent screen saves
are kept on the stack.
The screen stack saves the windows currently on the screen,
including their size, the cursor location, and the current viewport
into the window.
The Push procedure puts the current screen on the stack. The Next
and Previous procedures provide a mechanism for moving through the
items on the screen stack. They replace the current screen with
the Next or Previous screen on the stack. At the bottom of the
stack, Next wraps to the top. At the top of the stack, Previous
moves to the bottom. The Top procedure retrieves the screen at the
top of the stack. The Delete_Top procedure removes the screen at
the top of the stack from the stack. The Copy_Top procedure adds
another copy of the screen on top of the stack to the top of the
stack. The Rotate procedure moves the screen at the bottom of the
stack to the top of the stack. The Swap procedure swaps the top
two items on the top of the stack.
If you change the contents of any of the windows, the new contents
will be shown when the screen is retrieved from the stack. More
specifically, this means that if you abandon a window, it will
not be displayed when the screen is retrieved. A blank window
will appear in its space. If you have altered the contents of
the window---for example, adding text to the window---the new
contents of the window will be displayed. The Message window will
be displayed in its current state, rather than the state it was
in when saved. Also, Command windows will be in the state they
were in when last used, rather than the state they were in when the
screen was saved.
This feature is useful when you are performing one task with a
specific set of screens and then need to perform another task using
a different set of screens. You can save and later retrieve either
one or both of the sets of screens.
@node !Commands.Editor.Screen.Clear
procedure Clear;
Clears the screen completely and resets the terminal mode to ANSI.
Use this procedure when you need to use the terminal to connect to
another system or when modifying terminal characteristics.
@node !Commands.Editor.Screen.Copy_Top
procedure Copy_Top;
Makes another copy of the top item of the screen stack on the top
of the screen stack.
The result is that there are two copies of the original top item of
the screen stack on the top of the screen stack.
@node !Commands.Editor.Screen.Delete_Top
procedure Delete_Top;
Removes the top item from the screen stack.
The item next to the top of the screen stack becomes the top item
of the screen stack.
@node !Commands.Editor.Screen.Down
procedure Down (Repeat : Integer := 1);
Moves the cursor down Repeat lines, regardless of window
boundaries.
When the cursor reaches the last line of the screen, the procedure
does nothing.
@node !Commands.Editor.Screen.Dump
procedure Dump (To_File : String := ">>NAME<<");
Copies the contents of the screen to the file specified in the
To_File parameter, one screen line per line, as a series of
graphics control sequences embedded in text.
The default To_File parameter placeholder must be replaced or an
error will result. If the To_File parameter is the null string,
the procedure uses the file specified in the Screen_Dump_File
switch. If a simple name is not supplied to To_File, the file is
created in the user's home world.
@node !Commands.Editor.Screen.Left
procedure Left (Repeat : Integer := 1);
Moves the cursor Repeat columns to the left, regardless of window
boundaries.
When the cursor reaches the left edge of the screen, it stops,
regardless of the Repeat value.
@node !Commands.Editor.Screen.Next
procedure Next (Repeat : Integer := 1);
Retrieves and replaces the current screen with the next Repeat
screen from the screen stack.
At the bottom of the stack, this procedure wraps to the top.
@node !Commands.Editor.Screen.Previous
procedure Previous (Repeat : Integer := 1);
Retrieves and replaces the current screen with the previous Repeat
screen from the screen stack. At the top of the stack, this
procedure wraps to the bottom.
@node !Commands.Editor.Screen.Push
procedure Push (Repeat : Integer := 1);
Pushes the current screen onto the screen stack Repeat times.
@node !Commands.Editor.Screen.Redraw
procedure Redraw;
Clears the screen and then redraws it.
This procedure typically is used following the Clear procedure.
The Redraw procedure resets the terminal characteristics to those
specified at login.
@node !Commands.Editor.Screen.Right
procedure Right (Repeat : Integer := 1);
Moves the cursor Repeat columns to the right, regardless of window
boundaries.
@node !Commands.Editor.Screen.Rotate
procedure Rotate (Repeat : Integer := 1);
Takes Repeat items from the bottom of the screen stack and places
them in order on the top.
@node !Commands.Editor.Screen.Swap
procedure Swap;
Swaps the top two items on the screen stack.
@node !Commands.Editor.Screen.Top
procedure Top;
Retrieves the top item on the screen stack and replaces the current
screen with the screen saved on the top of the stack.
@node !Commands.Editor.Screen.Up
procedure Up (Repeat : Integer := 1);
Moves the cursor up Repeat lines, regardless of window boundaries.
When the cursor reaches the first line of the screen, the procedure
does nothing.
@node !Commands.Editor.Search
package Search is
procedure Previous (Target : String := "";
Wildcard : Boolean := False);
procedure Next (Target : String := "";
Wildcard : Boolean := False);
procedure Replace_Previous (Target : String := "";
Replacement : String := "";
Repeat : Integer := 1;
Wildcard : Boolean := False);
procedure Replace_Next (Target : String := "";
Replacement : String := "";
Repeat : Integer := 1;
Wildcard : Boolean := False);
end Search;
Package Search contains both search operations and replace
operations. The Next and Previous procedures move through
the image in the indicated directions, looking for a string
matching the Target string. The Replace_Next and Replace_Previous
procedures move similarly through the image with the intent of
replacing the Target string with the Replacement string.
All four of these procedures are bound to keys (see the Rational
Environment Keymap in Volume 1 of the Rational Environment
Reference Manual).
The search operations find the next or previous occurrence of the
Target string. Using the keys to which these operations are bound,
a search for the nth occurrence can be accomplished by pressing
the key n times. The search direction can be reversed without
respecifying the Target string by pressing the key that is bound to
the search operation of the opposite direction.
The replace operations, when the Repeat parameter is greater than
1, search for and replace Repeat occurrences of the Target string
with the Replacement string. If the cursor is currently on (or,
if using Replace_Next, one position beyond) an occurrence of the
Target string, that occurrence is the first one replaced.
The Target and Replacement strings are entered in the Message
window. When one of the keys is pressed, prompts appear in the
Message window for the necessary strings. Cursor-movement keys,
character- and line-delete keys, and beginning and end keys all
work while these search and replace strings are composed. You
can also use [Next Item ] and [Previous Item] to move between the
Target and Replacement strings. The Message window banner also
notes that search strings are being composed. The composing of
search and replace strings can be interrupted with the [Control][G]
key combination. Composing of search and replace strings is
completed by pressing the appropriate search or replace key again.
If the search operations are called from Ada programs instead of
being initiated from keys, the user will not be prompted for the
arguments in the Message window; instead, the arguments supplied in
the calls will be used.
The replace operations, when the Repeat parameter equals 1 (the
default), search for the first occurrence of the Target string and
then stop, awaiting a response. There are five choices at that
point:
o The occurrence can be replaced and the next occurrence searched
for by pressing one of the replace keys again. The direction
of searching can be reversed without respecifying the Target
or Replacement strings by pressing the key that is bound to the
replace operation of the opposite direction.
o The occurrence can be skipped by pressing one of the search keys.
The next occurrence is searched for.
o The occurrence can be replaced and the search discontinued by
pressing [Numeric 0] followed by the appropriate replace key.
o The occurrence and all remaining occurrences can be replaced by
pressing [Numeric --], followed by [Numeric 1], followed by the
appropriate replace key.
o The replace operation can be abandoned completely, bypassing any
remaining occurrences of the Target string, by pressing any other
key. The command bound to the other key is executed.
The Next and the Replace_Next procedures always leave the
cursor one position beyond the Target or Replacement string,
respectively. The Previous and Replace_Previous procedures
always leave the cursor on the first character of the Target or
Replacement string, respectively.
The commands in package Search can use regular expressions.
Regular expressions allow pattern matching. A pattern can be
specified with special metacharacters in the Target string that
could match many different strings in the image. Matches can occur
within a line; matches never span multiple lines.
The Wildcard parameter specifies whether any metacharacters in
either the Target or the Replacement string should be treated as
normal characters (false) or as wildcard characters (true).
The metacharacters include:
? Matches any single character.
% Matches any character that is legal in an Ada identifier.
$ Matches any Ada delimiter.
{ Matches beginning of line.
} Matches end of line.
(caret) the character or group of characters that follow from\r Excludes
the search. For example, the expression (caret)A means any
character except A.
* Matches zero or more occurrences of the previous character or
set of characters.
Treats the following special character as a regular character.
[] Delimits a class; searches for any of the characters in this
group. The class represents one character. For example, [ABC]
matches a single character that is A, B, or C. [(caret)ABC]
matches a single character that is not A, B, or C. Class
searches are case-sensitive.
For any of these procedures, if the Rational Editor cannot find
Target, it indicates so in the Message window and leaves the image
and cursor position unchanged.
@node !Commands.Editor.Search.Next
procedure Next (Target : String := "";
Wildcard : Boolean := False);
Searches forward for the next occurrence of the Target string.
When the Wildcard parameter is false (the default), metacharacters
are treated as characters only.
@node !Commands.Editor.Search.Previous
procedure Previous (Target : String := "";
Wildcard : Boolean := False);
Searches backward for the most recent occurrence of the Target
string.
When the Wildcard parameter is false (the default), metacharacters
are treated as characters only.
@node !Commands.Editor.Search.Replace_Next
procedure Replace_Next (Target : String := "";
Replacement : String := "";
Repeat : Integer := 1;
Wildcard : Boolean := False);
Finds the first occurrence of the Target string and awaits a
confirm, skip, or abandon request, if Repeat = 1.
If the cursor is already on an occurrence, the occurrence is
replaced and the next occurrence searched for. If Repeat is
greater than 1, the procedure replaces that many occurrences of
the Target string with the Replacement string. When the Wildcard
parameter is false (the default), metacharacters are treated as
simple characters.
A value of -1 for the Repeat parameter replaces everything from the
current cursor location to the end of the image.
@node !Commands.Editor.Search.Replace_Previous
procedure Replace_Previous (Target : String := "";
Replacement : String := "";
Repeat : Integer := 1;
Wildcard : Boolean := False);
Finds the previous occurrence of the Target string and awaits a
confirm, skip, or abandon request, if Repeat = 1.
If the cursor is already on an occurrence, the occurrence is
replaced and the next occurrence searched for. If Repeat is
greater than 1, the procedure replaces that many previous
occurrences of the Target string with the Replacement string.
When the Wildcard parameter is false (the default), metacharacters
are treated as simple characters.
A value of -1 for the Repeat parameter replaces everything from the
current cursor location to the beginning of the image.
@node !Commands.Editor.Set
package Set is
procedure Insert_Mode (On : Boolean := True);
procedure Fill_Mode (On : Boolean := True);
procedure Fill_Column (Column : Positive := 64);
procedure Designation_Off;
procedure Input_From (File_Name : String := "<SELECTION>");
procedure Input_Logging_To (File_Name : String := ">>Name<<");
procedure Input_Logging_Off;
procedure Tab_Off (Column : Positive);
procedure Tab_On (Column : Positive);
procedure Tab_Width (Size : Positive := 4);
procedure Argument_Prefix;
procedure Argument_Digit (Argument : Integer := 1);
procedure Argument_Minus;
end Set;
Package Set contains procedures for setting editor parameters.
Many of these parameters can also be changed through session
switches. See SJM, Session Switches, for more information on
session switches.
The Designation_Off procedure converts the indicated (prompt or
selection) to plain text.
The Insert_Mode procedure sets insert and overwrite modes. The
Fill_Mode procedure, when its parameter specifies true, instructs
the editor to wrap text lines whose length exceeds that specified
in the Column parameter of the Fill_Column procedure.
The Argument procedures cannot be called from a Command window but
must be invoked through key bindings.
The Input procedures all pertain to log files. The
Input_Logging_To procedure specifies a File_Name to which
the editor should begin recording all user keystrokes. The
Input_Logging_Off procedure instructs the editor to stop logging
keystrokes. The Input_From procedure instructs the editor to read
and execute the keystrokes saved by the Input_Logging_To procedure
in File_Name.
If the Input_From procedure is called from an Ada program, the
keystrokes in the file execute sequentially when the job performing
the call completes.
@node !Commands.Editor.Set.Argument_Digit
procedure Argument_Digit (Argument : Integer := 1);
Specifies a count for the following operation.
The procedure is bound to a key; when entered from a Command
window, the procedure has no effect. The count can be used as
a repeat count or other parameter to the following operation.
Entering a sequence of argument digits produces a number. For
example, entering the digits 3 and 5 produces an argument digit of
35.
@node !Commands.Editor.Set.Argument_Minus
procedure Argument_Minus;
Specifies a negative value for the following argument.
The procedure is bound to a key; when entered from a Command
window, the procedure has no effect.
@node !Commands.Editor.Set.Argument_Prefix
procedure Argument_Prefix;
Indicates to the editor that a command argument is being entered.
The procedure is bound to a key; when entered from a Command
window, the procedure has no effect. This procedure takes numbers
entered on the main keyboard and converts them to numeric keypad
argument digits. For example, this would be used if a keyboard
did not contain a numeric keypad or if the numeric keypad keys were
bound to something else.
@node !Commands.Editor.Set.Designation_Off
procedure Designation_Off;
Converts the prompt or selection in which the cursor is located to
normal text.
This procedure makes it possible to edit and reuse prompts.
@node !Commands.Editor.Set.Fill_Column
procedure Fill_Column (Column : Positive := 64);
Sets the desired column width for fill mode or for the Region.Fill
and Region.Justify procedures.
The column width can also be specified through a session switch
(see SJM, Session Switches).
@node !Commands.Editor.Set.Fill_Mode
procedure Fill_Mode (On : Boolean := True);
Wraps long text lines at the column position specified in the
Fill_Column procedure, when true.
The mode is specified only for the current image. The fill
mode can also be changed by a session switch (see SJM, Session
Switches).
@node !Commands.Editor.Set.Input_From
procedure Input_From (File_Name : String := "<SELECTION>");
Specifies a log file in the File_Name parameter (created with the
Input_Logging_To procedure) from which the editor should read and
execute keystrokes.
The default is the current selection.
If the Input_From procedure is called from an Ada program, the
keystrokes in the file execute sequentially when the job performing
the call completes.
@node !Commands.Editor.Set.Input_Logging_Off
procedure Input_Logging_Off;
Stops logging keystrokes.
@node !Commands.Editor.Set.Input_Logging_To
procedure Input_Logging_To (File_Name : String := ">>Name<<);
Logs all keystrokes to File_Name.
The parameter placeholder ">>Name<<" must be replaced or an error
will result.
@node !Commands.Editor.Set.Insert_Mode
procedure Insert_Mode (On : Boolean := True);
Sets insert or overwrite modes for the current image.
The insert and overwrite modes can also be changed by session
switches (see SJM, Session Switches).
@node !Commands.Editor.Set.Tab_Off
procedure Tab_Off (Column : Positive);
Removes a tab stop from the specified Column for all images.
The tab stops can also be changed permanently using session
switches (see SJM, Session Switches).
@node !Commands.Editor.Set.Tab_On
procedure Tab_On (Column : Positive);
Sets a tab stop in the specified Column for all images.
The tab stops can also be changed with session switches (see SJM,
Session Switches).
You can see the current tab settings by executing the
!Commands.What.Tabs procedure. Tab stops can be added to the
settings set by the Tab_Width procedure with the Tab_On procedure.
@node !Commands.Editor.Set.Tab_Width
procedure Tab_Width (Size : Positive := 4);
Sets the number of spaces between tab stops (in columns) for all
images.
The tab width can also be changed (see SJM, Session Switches).
You can see the current tab settings by executing the
!Commands.What.Tabs procedure. Tab stops can be added to the
settings set by the Tab_Width procedure with the Tab_On procedure.
@node !Commands.Editor.Window
package Window is
procedure Beginning_Of (Offset : Natural := 0);
procedure Child (Repeat : Integer := 1);
procedure Copy;
procedure Delete;
procedure Demote;
procedure Directory;
procedure End_Of (Offset : Natural := 0);
procedure Expand (Lines : Integer := 4);
procedure Focus;
procedure Frames (Maximum : Positive);
procedure Join (Repeat : Integer := 1);
procedure Next (Repeat : Integer := 1);
procedure Parent (Repeat : Integer := 1);
procedure Previous (Repeat : Integer := 1);
procedure Promote;
procedure Transpose (Offset : Integer := 1);
end Window;
The procedures in package Window provide facilities for managing
windows and include a number of commands that control window size
and disposition.
A window can be in one of three states (ordered from highest to
lowest):
o Frozen (also called locked) (banner symbol: @)
o Normal
o Replace (banner symbol: ~)
The Promote and Demote procedures change the state of a window to
the next higher or lower level.
In the frozen state, the window will not be replaced and will be
split only if there is no other space available for bringing up a
new window. In the normal state, the window can become eligible
for replacement if it becomes the least recently visited window (in
this case, it will automatically be changed to the replace state).
If it is in the replace state, the window will be replaced the next
time the editor needs to bring a new window on the screen (only one
window can be in the replace state).
Four procedures facilitate window management. The Frames
procedure sets the number of work windows the editor creates on
the screen. The editor treats each frame as a separate area for
placing windows. The default configuration is terminal dependent
(for the Rational Terminal, it is three frames). The Directory
procedure displays a list of active images in the Window Directory.
The Window Directory allows various operations on these active
images. The Promote procedure elevates a minor window to its own
frame (making it a major window) or changes a major window to the
next higher state. The Demote procedure changes a window to the
next lower state.
Several operations modify the configuration of windows on the
screen. The Join, Transpose, and Delete procedures behave
similarly to their counterparts in packages Word and Line.
The Child, Parent, Next, and Previous procedures move between
windows. The Beginning_Of and End_Of procedures scroll a window to
reposition the cursor to the first or last line of the window.
The editor manages the size, shape, and position of windows.
Nevertheless, the editor provides the user a procedure for
affecting these window attributes. The Expand procedure increases
the size, in lines, of the current or most recently used window.
The most recently used window is the one in which a command (other
than a cursor-movement command) was last entered.
The Focus procedure restores the screen to the state specified by
the current defaults.
Many of the aspects of how windows are displayed on the screen can
be tailored with session switches. See SJM, Session Switches, for
more information on session switches.
@node !Commands.Editor.Window.Beginning_Of
procedure Beginning_Of (Offset : Natural := 0);
Scrolls the image to move the cursor to the top of the window.
This procedure uses the Offset value to adjust the new cursor
position by Offset lines from the top of the window.
@node !Commands.Editor.Window.Child
procedure Child (Repeat : Integer := 1);
Moves the cursor Repeat times to the next window in the current
frame.
@node !Commands.Editor.Window.Copy
procedure Copy;
Divides the window into two views on the same image.
The procedure does not duplicate the Command window. The two views
are separate frames.
@node !Commands.Editor.Window.Delete
procedure Delete;
Removes the window in a minor or Command window.
The space for that window is returned to the major window with
which it is associated. In a major window, the procedure removes
the major window and its associated minor and Command windows from
the screen. Windows removed from the screen are not destroyed.
Major windows and their contents can be retrieved from the Window
Directory or by retrieving their definition. Command windows and
their contents can be retrieved by creating the Command window
again. Minor windows and their contents can be retrieved by
pressing [Definition] from the enclosing Ada unit or library or
by using the Window Directory.
@node !Commands.Editor.Window.Demote
procedure Demote;
Changes the state of the current window to the next lower state.
A window can be in one of three states (ordered from highest to
lowest):
o Frozen (banner symbol: @)
o Normal
o Replace (banner symbol: ~)
The Promote and Demote procedures change the state of a window to
the next higher or lower level.
In the frozen state, the window will not be replaced and will be
split only if there is no other space available for bringing up a
new window. In the normal state, the window can become eligible
for replacement if it becomes the least recently visited window (in
this case, it will automatically be changed to the replace state).
If it is in the replace state, the window will be replaced the next
time the editor needs to bring a new window on the screen (only one
window can be in the replace state).
@node !Commands.Editor.Window.Directory
procedure Directory;
Displays a list of the currently active images in an image.
This image, called the Window Directory, allows various operations
on these active images. See EST, Window Directory, for more
information.
@node !Commands.Editor.Window.End_Of
procedure End_Of (Offset : Natural := 0);
Scrolls the image to move the cursor to the bottom of the window.
This procedure uses the Offset value to adjust the new cursor
position by Offset lines from the bottom of the window. If Offset
is greater than the number of lines in the window, it moves the
cursor to the first line of the file and an error results.
@node !Commands.Editor.Window.Expand
procedure Expand (Lines : Integer := 4);
Enlarges the window by the specified number of Lines, taking lines
from an adjacent frame or neighboring window.
@node !Commands.Editor.Window.Focus
procedure Focus;
Restores the frame sizes, dividing the screen equally among the
current number of frames.
@node !Commands.Editor.Window.Frames
procedure Frames (Maximum : Positive);
Sets the maximum number of frames the editor will create on the
screen.
A session switch controls the number of frames, but this procedure
can be used to override that value for the current session.
@node !Commands.Editor.Window.Join
procedure Join (Repeat : Integer := 1);
Increases current window size by joining the current and next
Repeat frames.
@node !Commands.Editor.Window.Next
procedure Next (Repeat : Integer := 1);
Moves the cursor down Repeat frames.
From the bottom frame, the cursor wraps to the top of the screen.
@node !Commands.Editor.Window.Parent
procedure Parent (Repeat : Integer := 1);
Moves the cursor Repeat times to the previous window in the current
frame.
@node !Commands.Editor.Window.Previous
procedure Previous (Repeat : Integer := 1);
Moves the cursor up Repeat frames.
At the top of the screen, the cursor wraps to the bottom of the
screen.
@node !Commands.Editor.Window.Promote
procedure Promote;
Changes the current window to the next higher state or makes a
minor window a major window.
A window can be in one of three states (ordered from highest to
lowest):
o Frozen (banner symbol: @)
o Normal
o Replace (banner symbol: ~)
The Promote and Demote procedures change the state of a window to
the next higher or lower level.
In the frozen state, the window will not be replaced and will be
split only if there is no other space available for bringing up a
new window. In the normal state, the window can become eligible
for replacement if it becomes the least recently visited window (in
this case, it will automatically be changed to the replace state).
If it is in the replace state, the window will be replaced the next
time the editor needs to bring a new window on the screen (only one
window can be in the replace state).
@node !Commands.Editor.Window.Transpose
procedure Transpose (Offset : Integer := 1);
Exchanges the current frame with another.
The default Offset value specifies the previous frame. An Offset
value greater than 1 ignores intervening frames. A negative Offset
value exchanges the current frame with a next frame.
The cursor position that results depends on the value of the
Cursor_Transpose_Moves session switch. If the value is true,
the cursor is left in the window that was the current window or, if
no windows are below it, the first window on the screen below the
Message window. If the value is false, the cursor is left in the
window that replaces the window that was the current window. See
SJM, Session Switches, for more information on session switches.
@node !Commands.Editor.Word
package Word is
procedure Beginning_Of;
procedure Breaks (Break_Set : String := "";
Are_Delimiters : Boolean := True);
procedure Capitalize (Repeat : Integer := 1);
procedure End_Of;
procedure Delete (Repeat : Integer := 1);
procedure Delete_Backward (Repeat : Integer := 1);
procedure Delete_Forward (Repeat : Integer := 1);
procedure Lower_Case (Repeat : Integer := 1);
procedure Next (Repeat : Integer := 1);
procedure Previous (Repeat : Integer := 1);
procedure Transpose (Offset : Integer := 1);
procedure Upper_Case (Repeat : Integer := 1);
end Word;
The operations in package Word manipulate strings of characters
separated by word delimiters. The default includes blank and
Ada delimiters. Word delimiters can be changed with the Breaks
procedure.
Except for the Delete procedure, which erases an entire word, the
editing and movement commands affect the next, previous, or current
word from the cursor forward to the next end of word or from the
cursor back to the previous beginning of word.
@node !Commands.Editor.Word.Beginning_Of
procedure Beginning_Of;
Moves the cursor to the first character of the current word.
@node !Commands.Editor.Word.Breaks
procedure Breaks (Break_Set : String := "";
Are_Delimiters : Boolean := True);
Redefines the set of break characters to be used in the current
session.
The Break_Set string is an unordered set of characters. Each
character, if the Are_Delimiters parameter has been set to true for
it, delimits a word boundary. This procedure can be used to tailor
the editor to define words for particular uses.
At login, the break characters for the current session are set to
the value of the Word_Breaks session switch. By default, the break
characters are:
" "#%&'()*+,-./:;<=>?[]_`{|}~"
A value of false for the Are_Delimiters parameter removes the
characters specified by Break_Set from the set of break characters
for the current session.
@node !Commands.Editor.Word.Capitalize
procedure Capitalize (Repeat : Integer := 1);
Capitalizes the first letter of the next Repeat words.
After the operation, the cursor appears on the character after the
last target word.
@node !Commands.Editor.Word.Delete
procedure Delete (Repeat : Integer := 1);
Deletes the next Repeat words.
@node !Commands.Editor.Word.Delete_Backward
procedure Delete_Backward (Repeat : Integer := 1);
Deletes the previous Repeat words from the cursor backward.
@node !Commands.Editor.Word.Delete_Forward
procedure Delete_Forward (Repeat : Integer := 1);
Deletes the next Repeat words from the cursor forward.
@node !Commands.Editor.Word.End_Of
procedure End_Of;
Moves the cursor to the last character of the current word.
@node !Commands.Editor.Word.Lower_Case
procedure Lower_Case (Repeat : Integer := 1);
Converts the next Repeat words to lowercase.
After the operation, the cursor appears immediately after the last
target word.
@node !Commands.Editor.Word.Next
procedure Next (Repeat : Integer := 1);
Moves the cursor forward Repeat words.
After the operation, the cursor appears immediately after the
Target word.
@node !Commands.Editor.Word.Previous
procedure Previous (Repeat : Integer := 1);
Moves the cursor back Repeat words.
After the operation, the cursor appears on the first character of
the target word.
@node !Commands.Editor.Word.Transpose
procedure Transpose (Offset : Integer := 1);
Exchanges the current and previous words.
The cursor position that results depends on the value of the
Cursor_Transpose_Moves session switch. If the value is true,
the cursor is moved to the word delimiter at the end of the
exchanged word. If it is false, the position of the cursor is
not changed. See SJM, Session Switches, for more information on
session switches.
The Offset parameter is currently not implemented and is reserved
for future development.
@node !Commands.Editor.Word.Upper_Case
procedure Upper_Case (Repeat : Integer := 1);
Converts the next Repeat words to uppercase.
After the operation, the cursor appears immediately after the last
target word