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
master
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. 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 Also, look for ^U only in the main menu, to which ^W M-J factually
returns and which shortcut_init() "sneakily" sets. 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> 2014-04-06 Benno Schulenberg <bensberg@justemail.net>
* src/global.c (shortcut_init): Limit M-T (cut-till-end-of-file) to * src/global.c (shortcut_init): Limit M-T (cut-till-end-of-file) to

View File

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

View File

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

View File

@ -1127,7 +1127,6 @@ void do_exit(void)
} else if (i != 1) } else if (i != 1)
statusbar(_("Cancelled")); statusbar(_("Cancelled"));
shortcut_init(FALSE);
display_main_list(); display_main_list();
} }
@ -1710,9 +1709,6 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
{ {
s->scfunc(); s->scfunc();
#ifndef DISABLE_COLOR #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 if (f && !f->viewok && openfile->syntax != NULL
&& openfile->syntax->nmultis > 0) { && openfile->syntax->nmultis > 0) {
reset_multis(openfile->current, FALSE); reset_multis(openfile->current, FALSE);
@ -2407,9 +2403,9 @@ int main(int argc, char **argv)
#endif #endif
} }
/* Set up the shortcut lists. /* Set up the function and shortcut lists. This needs to be done
* Need to do this before the rcfile. */ * before reading the rcfile, to be able to rebind/unbind keys. */
shortcut_init(FALSE); shortcut_init();
/* We've read through the command line options. Now back up the flags /* 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 * 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 #endif
, int metaval, int funcval, int miscval, bool view, void , int metaval, int funcval, int miscval, bool view, void
(*func)(void)); (*func)(void));
void shortcut_init(bool unjustify); void shortcut_init(void);
#ifdef DEBUG #ifdef DEBUG
void thanks_for_all_the_fish(void); void thanks_for_all_the_fish(void);
#endif #endif

View File

@ -1281,9 +1281,9 @@ void parse_rcfile(FILE *rcstream
else else
rcfile_error(N_("Cannot unset flag \"%s\""), rcfile_error(N_("Cannot unset flag \"%s\""),
rcopts[i].name); 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) if (strcasecmp(rcopts[i].name, "undo") == 0)
shortcut_init(0); shortcut_init();
break; break;
} }
} }