GRN
module.
So, you have to use them like this:
$var = GRN::function_name(parameter)
.
add_command(context, name, handler)
Adds a command named name
(this name will appear in the menu)
with the subroutine named handler
to the GRN's list of commands.
context
is an integer which defines the scope of the command:
0 | Everywhere |
1 | Main window |
2 | Message editing (posting and sending) window |
3 | Message posting window |
4 | Message sending window |
Adds a hook named name
with the subroutine named
handler
to the GRN's list of hooks.
entry_text_delete(entry, start, end)
Deletes a text of the entry specified by the start
and
end
parameters.
text entry_text_get(entry, start, end)
Returns a text of the entry specified by the start
and
end
parameters. The entry is a string. The values can be found
in the include/grn_consts.h
and src/grn_msgwin.c,
src/grn_msgsend.c, src/grn_msgwin.c
files.
Inserts a text to the current position of the entry.
error_dialog(context, message)
Makes a call to grn_error() function defined in grn_util.h.
context
and message
are strings.
Returns a configuration parameter param
(which is a string).
The following params
are available:
Parameter name | Description | Return type |
ver | Grn's version | string |
version | Grn's version | string |
srv_autoconnect | True, if "autoconnect to server" is on | integer |
scripts_autoload | If scripts load on startup (always true) | integer |
server | NNTP server name | string |
name | Person's full name | string |
E-mail address | string | |
replyto | Reply-To address | string |
organization | Organization name | string |
re_quoting | Quoting regexp | string |
fontN | Grn's font names. N may be 0-4 | string |
fgcolorN | Grn's foreground colors. N may be 0-2 | string |
bgcolorN | Grn's background colors. N may be 0-2 | string |
cfm_group_read | "Mark group read" confirmation | integer |
cfm_group_unread | "Mark group unread" confirmation | integer |
cfm_thread_read | "Mark thread read" confirmation | integer |
cfm_thread_unread | "Mark thread unread" confirmation | integer |
cfm_abort_posting | "Abort posting" confirmation | integer |
cfm_show_warnings | "Show warnings" confirmation | integer |
cfm_show_messages | "Show informational messages" confirmation | integer |
Returns a color palette element pointed by index
. The first
element has an index = 1. The returned value is a string in Xresource format
(e.g. "#3FBCDD").
Returns a font palette element pointed by index
. The first
element has an index = 1.
Returns an escaped string
for use with
PreShow hook or any other functions
which require a valid HTML or XML text.
Delete a text specified by the start
and end
parameters. Each of them can be -1
.
text mew_text_get (start, end)
Returns a text in message editing widget starting at start
and ending at end
. Any of these parameters can be -1
.
This means that the returned text starts at the beginning or at the end of
the entire text, respectively.
(start, end) mew_text_get_selection
Returns a selection position in message editing widget. Returns empty list if no selection available.
Inserts the string
into the message editing widget
at the current cursor position.
Selects the text in message editing widget from start
to
end
.
Makes a variables substitution in src
. The list of valid
variables may be found here.