rcfile: when a vital function is not mapped, mention in which menu
Add the reverse of the name-to-menu function to accomplish this. This fixes https://savannah.gnu.org/bugs/?54449.master
parent
dc079bdf31
commit
2147e161bf
12
src/global.c
12
src/global.c
|
@ -1710,6 +1710,18 @@ int strtomenu(const char *input)
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return the name that corresponds to the given menu symbol. */
|
||||||
|
char *menu_to_name(int menu)
|
||||||
|
{
|
||||||
|
int index = -1;
|
||||||
|
|
||||||
|
while (++index < NUMBER_OF_MENUS)
|
||||||
|
if (menusymbols[index] == menu)
|
||||||
|
return menunames[index];
|
||||||
|
|
||||||
|
return "boooo";
|
||||||
|
}
|
||||||
#endif /* ENABLE_NANORC */
|
#endif /* ENABLE_NANORC */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -330,6 +330,7 @@ const subnfunc *sctofunc(const sc *s);
|
||||||
const char *flagtostr(int flag);
|
const char *flagtostr(int flag);
|
||||||
sc *strtosc(const char *input);
|
sc *strtosc(const char *input);
|
||||||
int strtomenu(const char *input);
|
int strtomenu(const char *input);
|
||||||
|
char *menu_to_name(int menu);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void thanks_for_all_the_fish(void);
|
void thanks_for_all_the_fish(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -882,7 +882,8 @@ static void check_vitals_mapped(void)
|
||||||
const sc *s = first_sc_for(inmenus[v], f->func);
|
const sc *s = first_sc_for(inmenus[v], f->func);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
fprintf(stderr, _("No key is bound to function '%s' in "
|
fprintf(stderr, _("No key is bound to function '%s' in "
|
||||||
"some menu. Exiting.\n"), f->desc);
|
"menu '%s'. Exiting.\n"), f->desc,
|
||||||
|
menu_to_name(inmenus[v]));
|
||||||
fprintf(stderr, _("If needed, use nano with the -I option "
|
fprintf(stderr, _("If needed, use nano with the -I option "
|
||||||
"to adjust your nanorc settings.\n"));
|
"to adjust your nanorc settings.\n"));
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Reference in New Issue