Dropping the obsolete argument of shortcut_init(),

and removing two unneeded calls of this function.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4740 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2014-04-07 09:24:10 +00:00
parent bc6e9aa926
commit a2dcd6edce
6 changed files with 10 additions and 15 deletions

View File

@ -5,6 +5,8 @@
the functions and shortcuts lists before and after every Justify.
Also, look for ^U only in the main menu, to which ^W M-J factually
returns and which shortcut_init() "sneakily" sets.
* src/{proto.h,files.c,global.c,nano.c,rcfile.c}: Drop the obsolete
argument of shortcut_init(), and remove two unneeded calls of it.
2014-04-06 Benno Schulenberg <bensberg@justemail.net>
* src/global.c (shortcut_init): Limit M-T (cut-till-end-of-file) to

View File

@ -1277,8 +1277,6 @@ void do_insertfile(
break;
}
}
shortcut_init(FALSE);
free(ans);
}

View File

@ -544,9 +544,8 @@ const char *new_buffer_msg = N_("New Buffer");
#endif
/* Initialize all shortcut lists. If unjustify is TRUE, replace
* the Uncut shortcut in the main shortcut list with UnJustify. */
void shortcut_init(bool unjustify)
/* Initialize the list of functions and the list of shortcuts. */
void shortcut_init(void)
{
/* TRANSLATORS: Try to keep the following strings at most 10 characters. */
const char *get_help_msg = N_("Get Help");

View File

@ -1127,7 +1127,6 @@ void do_exit(void)
} else if (i != 1)
statusbar(_("Cancelled"));
shortcut_init(FALSE);
display_main_list();
}
@ -1710,9 +1709,6 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
{
s->scfunc();
#ifndef DISABLE_COLOR
/* The command might have re-initialized shortcuts,
* in which case f is now invalid. Let's reload it. */
f = sctofunc((sc *) s);
if (f && !f->viewok && openfile->syntax != NULL
&& openfile->syntax->nmultis > 0) {
reset_multis(openfile->current, FALSE);
@ -2407,9 +2403,9 @@ int main(int argc, char **argv)
#endif
}
/* Set up the shortcut lists.
* Need to do this before the rcfile. */
shortcut_init(FALSE);
/* Set up the function and shortcut lists. This needs to be done
* before reading the rcfile, to be able to rebind/unbind keys. */
shortcut_init();
/* We've read through the command line options. Now back up the flags
* and values that are set, and read the rcfile(s). If the values

View File

@ -357,7 +357,7 @@ void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc
#endif
, int metaval, int funcval, int miscval, bool view, void
(*func)(void));
void shortcut_init(bool unjustify);
void shortcut_init(void);
#ifdef DEBUG
void thanks_for_all_the_fish(void);
#endif

View File

@ -1281,9 +1281,9 @@ void parse_rcfile(FILE *rcstream
else
rcfile_error(N_("Cannot unset flag \"%s\""),
rcopts[i].name);
/* Looks like we still need this specific hack for undo */
/* If undo/redo was enabled, reinitialize the lists. */
if (strcasecmp(rcopts[i].name, "undo") == 0)
shortcut_init(0);
shortcut_init();
break;
}
}