version 1.10, 2005/03/09 16:20:48 |
version 1.11, 2005/04/03 02:09:28 |
|
|
#ifndef NO_HELP |
#ifndef NO_HELP |
{apropos_command, "apropos",}, |
{apropos_command, "apropos",}, |
#endif /* !NO_HELP */ |
#endif /* !NO_HELP */ |
{ auto_execute, "auto-execute", }, |
{auto_execute, "auto-execute", }, |
{fillmode, "auto-fill-mode",}, |
{fillmode, "auto-fill-mode",}, |
{indentmode, "auto-indent-mode",}, |
{indentmode, "auto-indent-mode",}, |
{backchar, "backward-char",}, |
{backchar, "backward-char",}, |
|
|
{poptobuffer, "switch-to-buffer-other-window",}, |
{poptobuffer, "switch-to-buffer-other-window",}, |
{togglereadonly, "toggle-read-only" }, |
{togglereadonly, "toggle-read-only" }, |
{twiddle, "transpose-chars",}, |
{twiddle, "transpose-chars",}, |
{ undo, "undo", }, |
{undo, "undo", }, |
{ undo_dump, "undo-list", }, |
{undo_dump, "undo-list", }, |
{universal_argument, "universal-argument",}, |
{universal_argument, "universal-argument",}, |
{upperregion, "upcase-region",}, |
{upperregion, "upcase-region",}, |
{upperword, "upcase-word",}, |
{upperword, "upcase-word",}, |
{showcpos, "what-cursor-position",}, |
{showcpos, "what-cursor-position",}, |
{filewrite, "write-file",}, |
{filewrite, "write-file",}, |
{yank, "yank",}, |
{yank, "yank",}, |
{NULL, NULL,}, |
{NULL, NULL,} |
}; |
}; |
|
|
void |
void |
|
|
struct funmap *fn; |
struct funmap *fn; |
|
|
if ((fn = malloc(sizeof(*fn))) == NULL) |
if ((fn = malloc(sizeof(*fn))) == NULL) |
return FALSE; |
return (FALSE); |
|
|
fn->fn_funct = fun; |
fn->fn_funct = fun; |
fn->fn_name = fname; |
fn->fn_name = fname; |
fn->fn_next = funs; |
fn->fn_next = funs; |
|
|
funs = fn; |
funs = fn; |
return TRUE; |
return (TRUE); |
} |
} |
|
|
/* |
/* |
|
|
|
|
for (fn = funs; fn != NULL; fn = fn->fn_next) { |
for (fn = funs; fn != NULL; fn = fn->fn_next) { |
if (strcmp(fn->fn_name, fname) == 0) |
if (strcmp(fn->fn_name, fname) == 0) |
return fn->fn_funct; |
return (fn->fn_funct); |
} |
} |
return NULL; |
return (NULL); |
} |
} |
|
|
const char * |
const char * |
|
|
|
|
for (fn = funs; fn != NULL; fn = fn->fn_next) { |
for (fn = funs; fn != NULL; fn = fn->fn_next) { |
if (fn->fn_funct == fun) |
if (fn->fn_funct == fun) |
return fn->fn_name; |
return (fn->fn_name); |
} |
} |
return NULL; |
return (NULL); |
} |
} |
|
|
/* |
/* |
* list possible function name completions. |
* List possible function name completions. |
*/ |
*/ |
LIST * |
LIST * |
complete_function_list(const char *fname, int c) |
complete_function_list(const char *fname, int c) |
{ |
{ |
struct funmap *fn; |
struct funmap *fn; |
LIST *head, *el; |
LIST *head, *el; |
int len; |
int len; |
|
|
len = strlen(fname); |
len = strlen(fname); |
head = NULL; |
head = NULL; |
|
|
if (memcmp(fname, fn->fn_name, len) == 0) { |
if (memcmp(fname, fn->fn_name, len) == 0) { |
if ((el = malloc(sizeof(*el))) == NULL) { |
if ((el = malloc(sizeof(*el))) == NULL) { |
free_file_list(head); |
free_file_list(head); |
return NULL; |
return (NULL); |
} |
} |
el->l_name = fn->fn_name; |
el->l_name = fn->fn_name; |
el->l_next = head; |
el->l_next = head; |
head = el; |
head = el; |
} |
} |
} |
} |
|
return (head); |
return head; |
|
} |
} |
|
|
|
|
|
|