Get the current offset from the beginning of the line
Int_Type _get_point ()
The _get_point
function returns the current character offset
fro the beginning of the line.
_set_point, what_column
Move to a specified offset from the beginning of the line
_set_point (Int_Type nth)
The _set_point
function moves the current editing position to
the nth
character of the current line.
_get_point, goto_column
backward_paragraph
Void backward_paragraph ();
This function moves the current editing point backward past the
current paragraph to the line that is a paragraph separator. Such a
line is determined by the S-Lang hook is_paragraph_separator
. This
hook can be modified on a buffer by buffer basis by using the
function set_buffer_hook
.
forward_paragraph, set_buffer_hook
bob
Void bob ();
The function bob
is used to move the current editing point to the
beginning of the buffer. The function bobp
may be used to determine
if the editing point is at the beginning of the buffer or not.
bobp, eob, bol, eol
bol
Void bol();
This function moves the current editing point to the beginning of the
current line. The function bolp
may be used to see if one is already
at the beginning of a line.
eol, bob, eob, bolp
bskip_chars
Void bskip_chars (String str);
This function may be used to skip past all characters defined by the
string str
. See skip_chars
for the definition of str
.
The following example illustrates how to skip past all whitespace
including newline characters:
bskip_chars (" \t\n");
skip_chars, left
bskip_non_word_chars
Void bskip_word_chars ();
This function moves the current editing point backward past all
non-word characters until a word character is encountered.
Characters that make up a word are set by the define_word
function.
define_word, skip_non_word_chars, bskip_chars, bskip_word_chars
bskip_word_chars
Void bskip_word_chars ();
This function moves the current editing point backward past all
word characters until a non-word character is encountered.
Characters that make up a word are set by the define_word
function.
define_word, skip_word_chars, bskip_chars, bskip_non_word_chars
down
Integer down(Integer n);
The down
function is used to move the editing point down a number of
lines specified by the integer n
. It returns the number of lines
actually moved. The number returned will be less than n
only if the
last line of the buffer has been reached. The editing point will be
left at the beginning of the line if it succeeds in going down more
than one line.
Example: The function
define trim_buffer
{
bob ();
do
{
eol (); trim ();
}
while (down (1));
}
removes excess whitespace from the end of every line in the buffer.
down, left, right, goto_line
eob
Void eob();
The eob
function is used to move the current point to the end of the
buffer. The function eobp
may be used to see if the current
position is at the end of the buffer.
eobp, bob, bol, eol
eol
Void eol();
Moves the current position to the end of the current line. The function
eolp
may be used to see if one is at the end of a line or not.
eolp, bol, bob, eob
forward_paragraph
Void forward_paragraph ();
This function moves the current editing point forward past the end of
the current paragraph. Paragraph delimiters are defined through either
a buffer hook or via the hook is_paragraph_separator
.
backward_paragraph, set_buffer_hook
goto_column
Void goto_column (Integer n);
This function moves the current editing point to the column specified
by the parameter n
. It will insert a combination of spaces and tabs
if necessary to achieve the goal.
Note: The actual character number offset from the beginning of the
line depends upon tab settings and the visual expansion of other
control characters.
goto_column_best_try, what_column, left, right, goto_line
TAB,TAB_DEFAULT,DISPLAY_EIGHT_BIT
goto_column_best_try
Integer goto_column_best_try (Integer c);
This function is like goto_column
except that it will not insert
whitespace. This means that it may fail to achieve the column number
specified by the argument c
. It returns the current column number.
goto_column, what_column
goto_line
Void goto_line (Integer n);
The goto_line
function may be used to move to a specific line number
specified by the parameter n
.
Note: The actual column that the editing point will be left in is
indeterminate.
what_line, goto_column, down, up.
left
Integer left(Integer n);
left
moves the editing point backward n
characters and returns the
number actually moved. The number returned will be less than n
only
if the top of the buffer is reached.
right, up, down, bol, bob
right
Integer right(Integer n);
This function moves the editing position forward forward n
characters. It returns the number of characters actually moved. The
number returned will be smaller than n
if the end of the buffer is
reached.
left, up, down, eol, eob
skip_chars
Void skip_chars(String s);
This fnction may be used to move the editing point forward past all
characters in string s
which contains the chars to skip, or a range
of characters. A character range is denoted by two charcters
separated by a hyphen. If the first character of the string s
is a
'^'
character, then the list of characters actually denotes the
complement of the set of characters to be skipped. To explicitly
include the hyphen character in the list, it must be either the first
or the second character of the string, depending upon whether or not
the '^'
character is present. So for example,
skip_chars ("- \t0-9ai-o_");
will skip the hyphen, space, tab, numerals 0
to 9
, the letter a
,
the letters i
to o
, and underscore. An example which illustrates
the complement of a range is
skip_chars("^A-Za-z");
which skips all characters except the letters.
Note: The backslash character may be used to escape only the first
character in the string. That is, "\\^"
is to be used to skip over
^
characters.
bskip_chars, skip_white
skip_non_word_chars
Void skip_non_word_chars ();
This function moves the current editing point forward past all
non-word characters until a word character is encountered.
Characters that make up a word are set by the define_word
function.
define_word, skip_word_chars, skip_chars, bskip_non_word_chars
skip_white
Void skip_white ();
The skip_white
function moves the current point forward until it
reaches a non-whitespace character or the end of the current line,
whichever happens first. In this context, whitespace is considered to
be any combination of space and tab characters. To skip newline
characters as well, the function skip_chars
may be used.
bskip_chars, what_char, trim, right
skip_word_chars
Void skip_word_chars ();
This function moves the current editing point forward across all
characters that constitute a word until a non-word character is
encountered. Characters that make up a word are set by the
define_word
function.
define_word, skip_non_word_chars, skip_chars, bskip_word_chars
up
Integer up(Integer n)
This function moves the current point up n
lines and returns the
number of lines actually moved. The number returned will be less than
n
only if the top of the buffer is reached.
down, left, right