1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-19 07:46:24 -05:00

apropos based on newmlarg (replacement of mlreply).

This commit is contained in:
Renaud 2015-10-01 08:03:14 +08:00
parent 9682cdb2d2
commit 575659b1c1

26
bind.c
View File

@ -274,23 +274,24 @@ static int unbindchar( unsigned c) {
* bring up a fake buffer and list the key bindings * bring up a fake buffer and list the key bindings
* into it with view mode * into it with view mode
*/ */
int desbind(int f, int n) int desbind( int f, int n) {
#if APROP #if APROP
{ return buildlist( "") ;
buildlist( "") ;
return TRUE;
} }
int apro(int f, int n) /* Apropos (List functions that match a substring) */
{ /* Apropos (List functions that match a substring) */ int apro( int f, int n) {
char mstring[NSTRING]; /* string to match cmd names to */ char *mstring ; /* string to match cmd names to */
int status ; /* status return */ int status ; /* status return */
status = mlreply("Apropos string: ", mstring, NSTRING - 1); status = newmlarg( &mstring, "Apropos string: ", 0) ;
if (status == ABORT) if( status == TRUE) {
return status; status = buildlist( mstring) ;
free( mstring) ;
} else if( status == FALSE)
status = buildlist( "") ; /* build list of all commands */
return buildlist( mstring) ; return status ;
} }
/* /*
@ -298,9 +299,8 @@ int apro(int f, int n)
* *
* char *mstring; match string if a partial list, "" matches all * char *mstring; match string if a partial list, "" matches all
*/ */
static int buildlist( char *mstring) static int buildlist( char *mstring) {
#endif #endif
{
struct window *wp; /* scanning pointer to windows */ struct window *wp; /* scanning pointer to windows */
struct key_tab *ktp; /* pointer into the command table */ struct key_tab *ktp; /* pointer into the command table */
struct name_bind *nptr; /* pointer into the name binding table */ struct name_bind *nptr; /* pointer into the name binding table */