Next Previous Contents

1. Movement Functions

1.1 _get_point

Synopsis

Get the current offset from the beginning of the line

Usage

Int_Type _get_point ()

Description

The _get_point function returns the current character offset fro the beginning of the line.

See Also

_set_point, what_column

1.2 _set_point

Synopsis

Move to a specified offset from the beginning of the line

Usage

_set_point (Int_Type nth)

Description

The _set_point function moves the current editing position to the nth character of the current line.

See Also

_get_point, goto_column

1.3 backward_paragraph

Synopsis

backward_paragraph

Usage

Void backward_paragraph ();

Description

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.

See Also

forward_paragraph, set_buffer_hook

1.4 bob

Synopsis

bob

Usage

Void bob ();

Description

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.

See Also

bobp, eob, bol, eol

1.5 bol

Synopsis

bol

Usage

Void bol();

Description

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.

See Also

eol, bob, eob, bolp

1.6 bskip_chars

Synopsis

bskip_chars

Usage

Void bskip_chars (String str);

Description

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");
See Also

skip_chars, left

1.7 bskip_non_word_chars

Synopsis

bskip_non_word_chars

Usage

Void bskip_word_chars ();

Description

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.

See Also

define_word, skip_non_word_chars, bskip_chars, bskip_word_chars

1.8 bskip_word_chars

Synopsis

bskip_word_chars

Usage

Void bskip_word_chars ();

Description

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.

See Also

define_word, skip_word_chars, bskip_chars, bskip_non_word_chars

1.9 down

Synopsis

down

Usage

Integer down(Integer n);

Description

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.
See Also

down, left, right, goto_line

1.10 eob

Synopsis

eob

Usage

Void eob();

Description

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.

See Also

eobp, bob, bol, eol

1.11 eol

Synopsis

eol

Usage

Void eol();

Description

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.

See Also

eolp, bol, bob, eob

1.12 forward_paragraph

Synopsis

forward_paragraph

Usage

Void forward_paragraph ();

Description

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.

See Also

backward_paragraph, set_buffer_hook

1.13 goto_column

Synopsis

goto_column

Usage

Void goto_column (Integer n);

Description

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.

See Also

goto_column_best_try, what_column, left, right, goto_line

See Also

TAB,TAB_DEFAULT,DISPLAY_EIGHT_BIT

1.14 goto_column_best_try

Synopsis

goto_column_best_try

Usage

Integer goto_column_best_try (Integer c);

Description

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.

See Also

goto_column, what_column

1.15 goto_line

Synopsis

goto_line

Usage

Void goto_line (Integer n);

Description

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.

See Also

what_line, goto_column, down, up.

1.16 left

Synopsis

left

Usage

Integer left(Integer n);

Description

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.

See Also

right, up, down, bol, bob

1.17 right

Synopsis

right

Usage

Integer right(Integer n);

Description

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.

See Also

left, up, down, eol, eob

1.18 skip_chars

Synopsis

skip_chars

Usage

Void skip_chars(String s);

Description

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.
See Also

bskip_chars, skip_white

1.19 skip_non_word_chars

Synopsis

skip_non_word_chars

Usage

Void skip_non_word_chars ();

Description

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.

See Also

define_word, skip_word_chars, skip_chars, bskip_non_word_chars

1.20 skip_white

Synopsis

skip_white

Usage

Void skip_white ();

Description

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.

See Also

bskip_chars, what_char, trim, right

1.21 skip_word_chars

Synopsis

skip_word_chars

Usage

Void skip_word_chars ();

Description

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.

See Also

define_word, skip_non_word_chars, skip_chars, bskip_word_chars

1.22 up

Synopsis

up

Usage

Integer up(Integer n)

Description

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.

See Also

down, left, right


Next Previous Contents