Test of the editing point is at the beginning of the line
Int_Type rline_bolp()
The rline_bolp
function returns a non-zero value if the
current editing position is at the beginning of the line.
This function is part of the S-Lang readline interface.
Invoke an internal readline function
rline_call (String_Type func)
Not all of the readline functions are available directly from the S-Lang interpreter. For example, the "deleol" function, which deletes through the end of the line may be executed using
rline_call("deleol");
See the documentation for the rline_setkey
function for a
list of internal functions that may be invoked by rline_call
.
This function is part of the S-Lang readline interface.
Delete a specified number of characters at the current position
rline_del(Int_Type n)
This function delete a specified number of characters at the current
editing position. If the number n
is less than zero, then the
previous n
characters will be deleted. Otherwise, the next
n
characters will be deleted.
This function is part of the S-Lang readline interface.
Test of the editing point is at the end of the line
Int_Type rline_eolp()
The rline_bolp
function returns a non-zero value if the
current editing position is at the end of the line.
This function is part of the S-Lang readline interface.
Obtain the next byte in the readline input stream
Int_Type rline_getkey ()
This function returns the next byte in the readline input stream. If no byte is available, the function will wait until one is.
This function is part of the S-Lang readline interface.
Get the width of the readline edit window
Int_Type rline_get_edit_width ()
This function returns the width of the edit window. For slsh, this number corresponds to the width of the terminal window.
This function is part of the S-Lang readline interface.
Retrieve the readline history
Array_Type rline_get_history ()
This function returns the readline edit history as an array of strings.
This function is part of the S-Lang readline interface.
Get a copy of the line being edited
String_Type rline_get_line ()
This function returns the current edit line.
This function is part of the S-Lang readline interface.
Get the current editing position
Int_Type rline_get_point ()
The rline_get_point
function returns the byte-offset of the
current editing position.
This function is part of the S-Lang readline interface.
Test to see if readline input is available for reading
Int_Type rline_input_pending (Int_Type tsecs)
This function returns a non-zero value if readline input is
available to be read. If none is immediately available, it will
wait for up to tsecs
tenths of a second for input before
returning.
This function is part of the S-Lang readline interface.
Insert a string at the current editing point
rline_ins (String_Type text)
This function inserts the specified string into the line being edited.
This function is part of the S-Lang readline interface.
Bind a key in the readline keymap to a function
rline_setkey (func, keyseq)
The rline_setkey
function binds the function func
to
the specified key sequence keyseq
. The value of func
may be either a reference to a S-Lang function, or a string giving
the name of an internal readline function.
Functions that are internal to the readline interface include:
bdel Delete the previous character
bol Move to the beginning of the line
complete The command line completion function
del Delete the character at the current position
delbol Delete to the beginning of the line
deleol Delete through the end of the line
down Goto the next line in the history
enter Return to the caller of the readline function
eol Move to the end of the line
kbd_quit Abort editing of the current line
left Move left one character
quoted_insert Insert the next byte into the line
redraw Redraw the line
right Move right one character
self_insert Insert the byte that invoked the function
trim Remove whitespace about the current position
up Goto the previous line in the history
This function is part of the S-Lang readline interface.
Set the function to be used for completion at the readline prompt
rline_set_completion_callback (Ref_Type func)
This function sets the callback function to be used for completion at the readline prompt. The callback function must be defined to accept two values, the first being a string containing the text of the line being edited, and an integer giving the position of the byte-offset into the string where completion was requested.
The callback function must return two values: an array giving the list of possible completion strings, and an integer giving the byte offset into the string of the start of the text to be completed.
See completion-callback function defined in the slsh library file
rline/complete.sl
.
This function is part of the S-Lang readline interface.
Replace the current history list with a new one
rline_set_history (Array_Type lines)
The rline_set_history
function replaces the current history
by the specified array of strings.
This function is part of the S-Lang readline interface.
Replace the current line with a new one
rline_set_line (String_Type line)
The rline_set_line
function replaces the line being edited by
the specified one.
This function is part of the S-Lang readline interface.
Set a callback function to display the list of completions
rline_set_list_completions_callback (Ref_Type func)
This function sets the S-Lang function that is to be used to display the list of possible completions for current word at the readline prompt. The callback function must be defined to accept a single parameter representing an array of completion strings.
This callback function writes the completions using the message functions:
private define display_completions (strings)
{
variable str;
vmessage ("There are %d completions:\n", length(strings));
foreach str (strings) vmessage ("%s\n", str);
}
rline_set_list_completions_callback (&display_completions);
Move the current editing position to another
rline_set_point (Int_Type ofs)
The rline_set_point
function sets the editing point to the
specified byte-offset from the beginning of the line.
This function is part of the S-Lang readline interface.
Unset a key binding from the readline keymap
rline_unsetkey (String_Type keyseq)
The rline_unsetkey
function unbinds the specified key sequence
from the readline keymap.
This function is part of the S-Lang readline interface.