From f803ef5aeaf013f2de7c7651b6942e1d45d4769b Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 13 Apr 2014 12:16:37 +0000 Subject: [PATCH] Cosmetic tweaks. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4761 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/global.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5e7ddec..0b4df1cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * global.c (shortcut_init): Remove mistaken browser item from the Go-To-Line menu. * global.c (shortcut_init): Delete a misplaced setting of 'currmenu'. + * global.c (shortcut_init, strtomenu): Cosmetic tweaks. 2014-04-10 Benno Schulenberg * doc/syntax/Makefile.am: Add four recent syntaxes to the packlist. diff --git a/src/global.c b/src/global.c index 2b7da227..9547e8e4 100644 --- a/src/global.c +++ b/src/global.c @@ -605,7 +605,7 @@ void shortcut_init(void) #endif const char *nano_replace_msg = N_("Replace a string or a regular expression"); - const char *nano_gotoline_msg = N_("Go to line and column number"); + const char *nano_gotoline_msg = N_("Go to line and column number"); #ifndef NANO_TINY const char *nano_mark_msg = N_("Mark text at the cursor position"); const char *nano_whereis_next_msg = N_("Repeat last search"); @@ -735,6 +735,8 @@ void shortcut_init(void) free(f); } + /* Start populating the different menus with functions. */ + add_to_funcs(do_help_void, (MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MBROWSER|MWHEREISFILE|MGOTODIR|MLINTER), get_help_msg, IFSCHELP(nano_help_msg), FALSE, VIEW); @@ -1077,6 +1079,8 @@ void shortcut_init(void) goto_dir_msg, IFSCHELP(nano_gotodir_msg), FALSE, VIEW); #endif + /* Start associating key combos with functions in specific menus. */ + add_to_sclist(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MBROWSER|MWHEREISFILE|MGOTODIR|MLINTER, "^G", do_help_void, 0, TRUE); add_to_sclist(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MBROWSER|MWHEREISFILE|MGOTODIR|MLINTER, @@ -1248,8 +1252,7 @@ void shortcut_init(void) add_to_sclist(MWRITEFILE, "M-A", append_void, 0, FALSE); add_to_sclist(MWRITEFILE, "M-P", prepend_void, 0, FALSE); add_to_sclist(MWRITEFILE, "M-B", backup_file_void, 0, FALSE); - add_to_sclist(MWRITEFILE, "^T", to_files_void, 0, FALSE); - add_to_sclist(MINSERTFILE, "^T", to_files_void, 0, FALSE); + add_to_sclist(MWRITEFILE|MINSERTFILE, "^T", to_files_void, 0, FALSE); add_to_sclist(MINSERTFILE, "^X", ext_cmd_void, 0, FALSE); add_to_sclist(MMAIN, "^Z", do_suspend_void, 0, FALSE); add_to_sclist(MMAIN, "^L", total_refresh, 0, TRUE); @@ -1603,7 +1606,7 @@ int strtomenu(char *input) else if (!strcasecmp(input, "replace")) return MREPLACE; else if (!strcasecmp(input, "replace2") || - !strcasecmp(input, "replacewith")) + !strcasecmp(input, "replacewith")) return MREPLACE2; else if (!strcasecmp(input, "gotoline")) return MGOTOLINE; @@ -1612,7 +1615,7 @@ int strtomenu(char *input) else if (!strcasecmp(input, "insert")) return MINSERTFILE; else if (!strcasecmp(input, "externalcmd") || - !strcasecmp(input, "extcmd")) + !strcasecmp(input, "extcmd")) return MEXTCMD; else if (!strcasecmp(input, "help")) return MHELP;