doc/man/nanorc.5, doc/texinfo/nano.texi, doc/syntax/nanorc.nanorc:
Unabbreviate the long option --const to --constantshow, and --poslog
to --positionlog, to be more understandable.
+ * src/nano.h, src/global.c (add_to_sclist), src/help.c (help_init),
+ src/rcfile.c (parse_binding), src/winio.c (get_shortcut): Rename
+ the 'menu' item in the sc (shortcut) struct to 'menus', as it can
+ refer to more than one menu.
2015-07-13 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_int_spell_fix, do_alt_speller): Remove an unneeded
}
/* Add a key combo to the shortcut list. */
-void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggle)
+void add_to_sclist(int menus, const char *scstring, void (*func)(void), int toggle)
{
static sc *tailsc;
static int counter = 0;
s->next = NULL;
/* Fill in the data. */
- s->menu = menu;
+ s->menus = menus;
s->scfunc = func;
s->toggle = toggle;
if (toggle)
assign_keyinfo(s);
#ifdef DEBUG
- fprintf(stderr, "Setting sequence to %d for shortcut \"%s\" in menu %x\n", s->seq, scstring, (int)s->menu);
+ fprintf(stderr, "Setting sequence to %d for shortcut \"%s\" in menus %x\n", s->seq, scstring, s->menus);
#endif
}
const sc *s;
for (s = sclist; s != NULL; s = s->next)
- if ((s->menu & menu) && s->scfunc == func)
+ if ((s->menus & menu) && s->scfunc == func)
return s;
#ifdef DEBUG
if (s->type == RAWINPUT)
continue;
- if ((s->menu & currmenu) == 0)
+ if ((s->menus & currmenu) == 0)
continue;
if (s->scfunc == f->scfunc) {
counter++;
for (s = sclist; s != NULL; s = s->next)
if (s->toggle && s->ordinal == counter) {
- ptr += sprintf(ptr, "%s\t\t%s %s\n", (s->menu == MMAIN ? s->keystr : ""),
+ ptr += sprintf(ptr, "%s\t\t%s %s\n", (s->menus == MMAIN ? s->keystr : ""),
_(flagtostr(s->toggle)), _("enable/disable"));
if (s->toggle == NO_COLOR_SYNTAX || s->toggle == TABS_TO_SPACES)
ptr += sprintf(ptr, "\n");
/* What kind of command key it is, for convenience later. */
int seq;
/* The actual sequence to check on the type is determined. */
- int menu;
- /* What list this applies to. */
+ int menus;
+ /* Which menus this applies to. */
void (*scfunc)(void);
/* The function we're going to run. */
int toggle;
}
newsc->keystr = keycopy;
- newsc->menu = menu;
+ newsc->menus = menu;
newsc->type = strtokeytype(newsc->keystr);
assign_keyinfo(newsc);
#ifdef DEBUG
/* Now find and delete any existing same shortcut in the menu(s). */
for (s = sclist; s != NULL; s = s->next) {
- if (((s->menu & menu)) && !strcmp(s->keystr, keycopy)) {
+ if ((s->menus & menu) && !strcmp(s->keystr, keycopy)) {
#ifdef DEBUG
- fprintf(stderr, "deleting entry from menu %x\n", s->menu);
+ fprintf(stderr, "deleting entry from among menus %x\n", s->menus);
#endif
- s->menu &= ~menu;
+ s->menus &= ~menu;
}
}
#endif
for (s = sclist; s != NULL; s = s->next) {
- if ((currmenu & s->menu) && *kbinput == s->seq
+ if ((s->menus & currmenu) && *kbinput == s->seq
&& meta_key == (s->type == META)) {
#ifdef DEBUG
fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menu is %x from %x)\n",
- s->keystr, meta_key, currmenu, s->menu);
+ s->keystr, meta_key, currmenu, s->menus);
#endif
return s;
}