- pass description as 3rd argument to CMDx() macros - normalize argument specifications - 'p' means point - 'a' means argval - 'A' means argval premultiplied by value - pass argval before value to do_split_window(), do_isearch(), do_sort_span(), do_sort_region(), do_sort_buffer() - add SF_SILENT flag to suppress messages in eb_sort_span() - bumped version to 5.3.3
26 lines
555 B
C
26 lines
555 B
C
/*
|
|
* Simple plugin example
|
|
*/
|
|
#include "qe.h"
|
|
|
|
/* insert 'hello' at the current cursor position */
|
|
static void insert_hello(EditState *s)
|
|
{
|
|
s->offset += eb_insert_str(s->b, s->offset, "Hello world\n");
|
|
}
|
|
|
|
static const CmdDef my_commands[] = {
|
|
CMD2( "insert-hello", "C-c h",
|
|
"Insert the string Hello world\\n",
|
|
insert_hello, ES, "*")
|
|
};
|
|
|
|
static int my_plugin_init(void)
|
|
{
|
|
/* commands and default keys */
|
|
qe_register_cmd_table(my_commands, countof(my_commands), NULL);
|
|
|
|
return 0;
|
|
}
|
|
|
|
qe_module_init(my_plugin_init);
|