Next Previous Contents

2. Insertion/Deletions Functions

2.1 USE_TABS

Synopsis

Control use of tabs in whitespace

Usage

Int_Type USE_TABS

Description

If USE_TABS is non-zero, the editor may use tab characters when creating whitespace. If the value of this variable is zero, no tabs will be used.

See Also

TAB, TAB_DEFAULT

2.2 WRAP

Synopsis

Set the column at which wrapping occurs

Usage

Int_Type WRAP

Description

The WRAP variable determines the column number at which wrapping will occur. When entering text, if the current point goes beyond this column, the text will automatically wrap to the next line. This will only happen for those buffers for which the wrap flag is set.

See Also

WRAP_INDENTS, getbuf_info, set_mode

2.3 WRAP_INDENTS

Synopsis

Control indentation after wrapping

Usage

Int_Type WRAP_INDENTS

Description

If this variable is non-zero, after a line is wrapped, the new line will start at the same indentation as the current one. On the other hand, if the value of WRAP_INDENTS is zero, the new line will begin in the first column.

2.4 del

Synopsis

del

Usage

Void del ();

Description

The del function deletes the character at the current editing position. If the position is at the end of the buffer, nothing happens. If the deletion occurs at the end of a line, the next line will be joined with the current one.

See Also

eobp, erase_buffer, insert

2.5 del_region

Synopsis

del_region

Usage

Void del_region ();

Description

This function deletes the region defined by the mark and the current editing point. For example,

        define delete_this_line ()
        {
          bol (); push_mark (); eol ();
          del_region ();
        }
defines a function that deletes all characters on the current line from the beginning of the line until the end of the line. It does not delete the line itself.
See Also

push_mark, markp, check_region

2.6 erase_buffer

Synopsis

erase_buffer

Usage

erase_buffer ();

Description

The erase_buffer function erases all text from the current buffer. However, it does not delete the buffer itself.

Note: This function destroys all undo information associated with the buffer making it impossible to undo the result of this function.

See Also

delbuf, del

2.7 indent_line

Synopsis

indent_line

Usage

Void indent_line ();

Description

The indent_line line function indents the current line in a manner which depends upon the current buffer. The actual function that gets called is set via a prior call the set_buffer_hook to set the indent hook. The default value is to indent the line to the indentation level of the previous line.

See Also

set_buffer_hook

2.8 insbuf

Synopsis

insbuf

Usage

Void insbuf (String buf);

Description

This function may be used to insert the contents of a buffer specified by the name buf into the current buffer. The editing position is advanced to the end of the insertion.

See Also

copy_region, narrow, narrow_to_region

2.9 insert

Synopsis

insert

Usage

Void insert (String str);

Description

Inserts string str into buffer at the current position. The editing point is moved to the end of the of the string that was inserted.

See Also

insert_char, del, insert_file, insbuf

2.10 insert_char

Synopsis

insert_char

Description

Undocumented

2.11 insert_file_region

Synopsis

insert_file_region

Usage

Integer insert_file_region (String file, String beg, String end);

Description

This function may be used to insert a region specified by the strings beg and end of the file with name file into the current buffer. The file is scanned line by line until a line that begins with the string given by beg is encountered. Then, that line and all successive lines up to the one that starts with the string specified by end is inserted into the buffer. The line beginning with the value of end is not inserted although the one beginning with beg is. The function returns the number of lines inserted or -1 upon failure to open the file.

Note that a zero length beg corresponds to the first line and that a zero length end corresponds to the last line.

See Also

insert_file

2.12 insert_from_kill_array

Synopsis

insert_from_kill_array

Usage

Void insert_from_kill_array (Integer n);

Description

This function inserts the contents of the nth element, specified by n, of an internal array of character strings.

Note: This function is not available on 16 bit systems.

See Also

insert_from_kill_array, copy_region_to_kill_array

See Also

KILL_ARRAY_SIZE

2.13 trim

Synopsis

trim

Usage

Void trim ();

Description

The trim function removes all whitespace around the current editing point. In this context, whitespace is considered to be any combination of tab and space characters. In particular, it does not include the newline character. This means that the trim function will not delete across lines.

See Also

skip_chars, skip_white, del, del_region

2.14 whitespace

Synopsis

whitespace

Usage

whitespace (Integer n);

Description

The whitespace function inserts white space of length n into the current buffer using a combination of spaces and tabs. The actual combination of spaces and tabs used depends upon the buffer local variable TAB. In particular, if TAB is zero, no tab characters will be used for the expansion.

See Also

insert, trim, goto_column

See Also

TAB,TAB_DEFAULT


Next Previous Contents