From 4b4b6088061c2f1236b1bb36671ccf91f2beed02 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Mon, 1 Nov 2004 22:54:40 +0000 Subject: [PATCH] leave "Mark Text" and "Where Is Next" out entirely when NANO_SMALL is defined; since they aren't in the visible main list, there's no point in having them in but disabled; also add a few formatting fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2043 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/global.c | 58 ++++++++++++++++++++++------------------------------ 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7f71807..a95aec2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -134,6 +134,9 @@ CVS code - N_(). (DLR) - Add new key aliases: F15 for "Mark Text" (DLR) and F16 for "Where Is Next" (Chris). + - Leave "Mark Text" and "Where Is Next" out entirely when + NANO_SMALL is defined. Since they aren't in the visible main + list, there's no point in having them in but disabled. (DLR) - nano.c: die_save_file() - Clarify the error message when there are too many backup files diff --git a/src/global.c b/src/global.c index 962e3ccc..3cbce14e 100644 --- a/src/global.c +++ b/src/global.c @@ -278,8 +278,10 @@ void shortcut_init(int unjustify) const char *nano_spell_msg = N_("Invoke the spell checker, if available"); const char *nano_gotoline_msg = N_("Go to a specific line number"); const char *nano_replace_msg = N_("Replace text within the editor"); +#ifndef NANO_SMALL const char *nano_mark_msg = N_("Mark text at the cursor position"); const char *nano_whereis_next_msg = N_("Repeat last search"); +#endif const char *nano_prevline_msg = N_("Move to the previous line"); const char *nano_nextline_msg = N_("Move to the next line"); const char *nano_forward_msg = N_("Move forward one character"); @@ -469,32 +471,22 @@ void shortcut_init(int unjustify) nano_disabled_msg); sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg, - IFHELP(nano_gotoline_msg, NANO_GOTOLINE_ALTKEY), NANO_GOTOLINE_FKEY, - NANO_NO_KEY, VIEW, do_gotoline_void); + IFHELP(nano_gotoline_msg, NANO_GOTOLINE_ALTKEY), + NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, do_gotoline_void); sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg, - IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY), NANO_REPLACE_FKEY, - NANO_NO_KEY, NOVIEW, do_replace); + IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY), + NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, do_replace); +#ifndef NANO_SMALL sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"), IFHELP(nano_mark_msg, NANO_MARK_ALTKEY), NANO_MARK_FKEY, - NANO_NO_KEY, NOVIEW, -#ifndef NANO_SMALL - do_mark -#else - nano_disabled_msg -#endif - ); + NANO_NO_KEY, NOVIEW, do_mark); sc_init_one(&main_list, NANO_NO_KEY, N_("Where Is Next"), IFHELP(nano_whereis_next_msg, NANO_WHEREIS_NEXT_KEY), - NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, -#ifndef NANO_SMALL - do_research -#else - nano_disabled_msg + NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, do_research); #endif - ); sc_init_one(&main_list, NANO_PREVLINE_KEY, N_("Prev Line"), IFHELP(nano_prevline_msg, NANO_NO_KEY), NANO_NO_KEY, @@ -579,8 +571,8 @@ void shortcut_init(int unjustify) #ifndef DISABLE_JUSTIFY /* Translators: try to keep this string under 10 characters long */ sc_init_one(&main_list, NANO_NO_KEY, fulljstify_msg, - IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY), NANO_NO_KEY, - NANO_NO_KEY, NOVIEW, do_full_justify); + IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY), + NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); #endif #if !defined(NANO_SMALL) && defined(HAVE_REGEX_H) @@ -639,8 +631,8 @@ void shortcut_init(int unjustify) /* Translators: try to keep this string under 10 characters long */ sc_init_one(&whereis_list, NANO_FULLJUSTIFY_KEY, fulljstify_msg, - IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY), NANO_NO_KEY, - NANO_NO_KEY, NOVIEW, do_full_justify); + IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY), + NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); #endif #ifndef NANO_SMALL @@ -774,9 +766,9 @@ void shortcut_init(int unjustify) IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_last_line); - sc_init_one(&gotoline_list, NANO_TOOTHERWHEREIS_KEY, N_("Go To Text"), - IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_NO_KEY, - NANO_NO_KEY, VIEW, do_search); + sc_init_one(&gotoline_list, NANO_TOOTHERWHEREIS_KEY, + N_("Go To Text"), IFHELP(nano_whereis_msg, NANO_NO_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, do_search); #ifndef DISABLE_HELP free_shortcutage(&help_list); @@ -898,9 +890,9 @@ void shortcut_init(int unjustify) * It's useless since inserting files is disabled. */ /* Translators: try to keep this string under 22 characters long */ if (!ISSET(RESTRICTED)) - sc_init_one(&insertfile_list, NANO_TOOTHERINSERT_KEY, N_("Execute Command"), - IFHELP(nano_execute_msg, NANO_NO_KEY), NANO_NO_KEY, - NANO_NO_KEY, NOVIEW, 0); + sc_init_one(&insertfile_list, NANO_TOOTHERINSERT_KEY, + N_("Execute Command"), IFHELP(nano_execute_msg, + NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, 0); #ifdef ENABLE_MULTIBUFFER /* If we're using restricted mode, the multibuffer toggle is @@ -908,8 +900,8 @@ void shortcut_init(int unjustify) /* Translators: try to keep this string under 22 characters long */ if (!ISSET(RESTRICTED)) sc_init_one(&insertfile_list, NANO_NO_KEY, new_buffer_msg, - IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY, - NANO_NO_KEY, NOVIEW, 0); + IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), + NANO_NO_KEY, NANO_NO_KEY, NOVIEW, 0); #endif #endif @@ -954,8 +946,8 @@ void shortcut_init(int unjustify) #ifdef ENABLE_MULTIBUFFER sc_init_one(&extcmd_list, NANO_NO_KEY, new_buffer_msg, - IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY, - NANO_NO_KEY, NOVIEW, 0); + IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), + NANO_NO_KEY, NANO_NO_KEY, NOVIEW, 0); #endif #endif @@ -986,8 +978,8 @@ void shortcut_init(int unjustify) /* Translators: try to keep this string under 22 characters long */ sc_init_one(&browser_list, NANO_GOTOLINE_KEY, N_("Go To Dir"), - IFHELP(nano_gotodir_msg, NANO_GOTOLINE_ALTKEY), NANO_GOTOLINE_FKEY, - NANO_NO_KEY, VIEW, 0); + IFHELP(nano_gotodir_msg, NANO_GOTOLINE_ALTKEY), + NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, 0); free_shortcutage(&gotodir_list); -- 2.39.5