From 07b5d97a3a83f25c6ce6a421732d3492c6950f48 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 18 Sep 2020 12:29:28 +0200 Subject: [PATCH] help: do not show "^G Help" in the tiny version when there is no help Also, to keep menu items nicely grouped in the Main, Search, Replace, and Goto menus, reorder a few items when no help is available. This addresses https://savannah.gnu.org/bugs/?59110. --- src/global.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/global.c b/src/global.c index 03dabd6e..d9ceb521 100644 --- a/src/global.c +++ b/src/global.c @@ -728,9 +728,11 @@ void shortcut_init(void) #endif /* Start populating the different menus with functions. */ +#ifdef ENABLE_HELP add_to_funcs(do_help, (MMOST | MBROWSER) & ~MFINDINHELP, /* TRANSLATORS: Try to keep the next thirteen strings at most 10 characters. */ N_("Help"), WITHORSANS(help_gist), TOGETHER, VIEW); +#endif add_to_funcs(do_cancel, ((MMOST & ~MMAIN) | MYESNO), N_("Cancel"), WITHORSANS(cancel_gist), BLANKAFTER, VIEW); @@ -745,6 +747,12 @@ void shortcut_init(void) close_tag, WITHORSANS(exitbrowser_gist), TOGETHER, VIEW); #endif +#ifndef ENABLE_HELP + add_to_funcs(full_refresh, MMAIN|MREPLACE, "Refresh", "x", 0, VIEW); + add_to_funcs(flip_goto, MWHEREIS, "Go To Line", "x", 0, VIEW); + add_to_funcs(flip_goto, MGOTOLINE, "Go To Text", "x", 0, VIEW); +#endif + add_to_funcs(do_writeout_void, MMAIN, N_("Write Out"), WITHORSANS(writeout_gist), TOGETHER, NOVIEW); @@ -846,17 +854,19 @@ void shortcut_init(void) N_("Newer"), WITHORSANS(newer_gist), BLANKAFTER, VIEW); #endif +#ifdef ENABLE_HELP add_to_funcs(flip_goto, MWHEREIS, N_("Go To Line"), WITHORSANS(gotoline_gist), BLANKAFTER, VIEW); +#endif #ifdef ENABLE_BROWSER add_to_funcs(goto_dir, MBROWSER, /* TRANSLATORS: Try to keep the next seven strings at most 10 characters. */ N_("Go To Dir"), WITHORSANS(gotodir_gist), TOGETHER, VIEW); - +#ifdef ENABLE_HELP add_to_funcs(full_refresh, MBROWSER, N_("Refresh"), WITHORSANS(browserrefresh_gist), BLANKAFTER, VIEW); - +#endif add_to_funcs(do_search_forward, MBROWSER, N_("Where Is"), WITHORSANS(browserwhereis_gist), TOGETHER, VIEW); add_to_funcs(do_search_backward, MBROWSER, @@ -999,8 +1009,10 @@ void shortcut_init(void) add_to_funcs(do_verbatim_input, MMAIN, N_("Verbatim"), WITHORSANS(verbatim_gist), BLANKAFTER, NOVIEW); +#ifdef ENABLE_HELP add_to_funcs(full_refresh, MMAIN, N_("Refresh"), WITHORSANS(refresh_gist), TOGETHER, VIEW); +#endif add_to_funcs(do_suspend_void, MMAIN, N_("Suspend"), WITHORSANS(suspend_gist), BLANKAFTER, VIEW); @@ -1090,8 +1102,10 @@ void shortcut_init(void) N_("Formatter"), WITHORSANS(formatter_gist), BLANKAFTER, NOVIEW); #endif +#ifdef ENABLE_HELP add_to_funcs(flip_goto, MGOTOLINE, N_("Go To Text"), WITHORSANS(whereis_gist), BLANKAFTER, VIEW); +#endif #ifndef NANO_TINY add_to_funcs(dos_format_void, MWRITEFILE,