From: David Lawrence Ramsey Date: Tue, 25 Jul 2006 21:13:30 +0000 (+0000) Subject: when DISABLE_HELP is defined, leave out some unused shortcut and toggle X-Git-Tag: v1.9.99pre1~46 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bd28ee472ba9e45cde03fa0133c4b8f3764c6ae5;p=nano.git when DISABLE_HELP is defined, leave out some unused shortcut and toggle list parameters git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3815 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 5a5b7299..e05d3dde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -106,6 +106,13 @@ CVS code - - Don't return NULL when the current directory doesn't exist, as we can still recover from that. (DLR, found by Mike Frysinger) - Add various cleanups. (DLR) +- global.c: + shortcut_init(), sc_init_one() + - Don't include blank_after when DISABLE_HELP is defined, as + it's never used then. (DLR) + toggle_init(), toggle_init_one() + - Don't include desc or blank_after when DISABLE_HELP is + defined, as neither are ever used then. (DLR) - help.c: do_help() - Simplify screen update handling and exiting. (DLR) diff --git a/src/global.c b/src/global.c index 9745013e..1a62244b 100644 --- a/src/global.c +++ b/src/global.c @@ -223,12 +223,12 @@ size_t length_of_list(const shortcut *s) } /* Add a new shortcut to the end of the shortcut list. */ -void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc, +void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc #ifndef DISABLE_HELP - const char *help, + , const char *help, bool blank_after #endif - bool blank_after, int metaval, int funcval, int miscval, bool - view, void (*func)(void)) + , int metaval, int funcval, int miscval, bool view, + void (*func)(void)) { shortcut *s; @@ -246,8 +246,8 @@ void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc, s->desc = (desc == NULL) ? "" : _(desc); #ifndef DISABLE_HELP s->help = (help == NULL) ? "" : _(help); -#endif s->blank_after = blank_after; +#endif s->metaval = metaval; s->funcval = funcval; s->miscval = miscval; @@ -456,17 +456,17 @@ void shortcut_init(bool unjustify) /* The following macro is to be used in calling sc_init_one(). The * point is that sc_init_one() takes 10 arguments, unless DISABLE_HELP - * is defined, when the 4th one should not be there. */ + * is defined, when the 4th and 5th ones should not be there. */ #ifndef DISABLE_HELP -#define IFHELP(help, nextvar) help, nextvar +#define IFSCHELP(help, blank, nextvar) help, blank, nextvar #else -#define IFHELP(help, nextvar) nextvar +#define IFSCHELP(help, blank, nextvar) nextvar #endif free_shortcutage(&main_list); sc_init_one(&main_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -480,18 +480,18 @@ void shortcut_init(bool unjustify) /* TRANSLATORS: Try to keep this at most 10 characters. */ openfile != NULL && openfile != openfile->next ? N_("Close") : #endif - exit_msg, IFHELP(nano_exit_msg, FALSE), NANO_NO_KEY, + exit_msg, IFSCHELP(nano_exit_msg, FALSE, NANO_NO_KEY), NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, do_exit); /* TRANSLATORS: Try to keep this at most 10 characters. */ sc_init_one(&main_list, NANO_WRITEOUT_KEY, N_("WriteOut"), - IFHELP(nano_writeout_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_writeout_msg, FALSE, NANO_NO_KEY), NANO_WRITEOUT_FKEY, NANO_NO_KEY, NOVIEW, do_writeout_void); /* TRANSLATORS: Try to keep this at most 10 characters. */ sc_init_one(&main_list, NANO_JUSTIFY_KEY, N_("Justify"), - IFHELP(nano_justify_msg, TRUE), NANO_NO_KEY, NANO_JUSTIFY_FKEY, - NANO_NO_KEY, NOVIEW, + IFSCHELP(nano_justify_msg, TRUE, NANO_NO_KEY), + NANO_JUSTIFY_FKEY, NANO_NO_KEY, NOVIEW, #ifndef DISABLE_JUSTIFY do_justify_void #else @@ -506,7 +506,7 @@ void shortcut_init(bool unjustify) * line. */ /* TRANSLATORS: Try to keep this at most 10 characters. */ sc_init_one(&main_list, NANO_INSERTFILE_KEY, N_("Read File"), - IFHELP(nano_insert_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_insert_msg, FALSE, NANO_NO_KEY), NANO_INSERTFILE_FKEY, NANO_NO_KEY, #ifdef ENABLE_MULTIBUFFER VIEW @@ -516,36 +516,36 @@ void shortcut_init(bool unjustify) , !ISSET(RESTRICTED) ? do_insertfile_void : nano_disabled_msg); sc_init_one(&main_list, NANO_WHEREIS_KEY, whereis_msg, - IFHELP(nano_whereis_msg, FALSE), NANO_NO_KEY, NANO_WHEREIS_FKEY, - NANO_NO_KEY, VIEW, do_search); + IFSCHELP(nano_whereis_msg, FALSE, NANO_NO_KEY), + NANO_WHEREIS_FKEY, NANO_NO_KEY, VIEW, do_search); sc_init_one(&main_list, NANO_PREVPAGE_KEY, prev_page_msg, - IFHELP(nano_prevpage_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_prevpage_msg, FALSE, NANO_NO_KEY), NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, do_page_up); sc_init_one(&main_list, NANO_NEXTPAGE_KEY, next_page_msg, - IFHELP(nano_nextpage_msg, TRUE), NANO_NO_KEY, + IFSCHELP(nano_nextpage_msg, TRUE, NANO_NO_KEY), NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, do_page_down); /* TRANSLATORS: Try to keep this at most 10 characters. */ sc_init_one(&main_list, NANO_CUT_KEY, N_("Cut Text"), - IFHELP(nano_cut_msg, FALSE), NANO_NO_KEY, NANO_CUT_FKEY, + IFSCHELP(nano_cut_msg, FALSE, NANO_NO_KEY), NANO_CUT_FKEY, NANO_NO_KEY, NOVIEW, do_cut_text_void); if (unjustify) /* TRANSLATORS: Try to keep this at most 10 characters. */ sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, N_("UnJustify"), - IFHELP(NULL, FALSE), NANO_NO_KEY, NANO_UNJUSTIFY_FKEY, + IFSCHELP(NULL, FALSE, NANO_NO_KEY), NANO_UNJUSTIFY_FKEY, NANO_NO_KEY, NOVIEW, NULL); else /* TRANSLATORS: Try to keep this at most 10 characters. */ sc_init_one(&main_list, NANO_UNCUT_KEY, N_("UnCut Text"), - IFHELP(nano_uncut_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_uncut_msg, FALSE, NANO_NO_KEY), NANO_UNCUT_FKEY, NANO_NO_KEY, NOVIEW, do_uncut_text); /* TRANSLATORS: Try to keep this at most 10 characters. */ sc_init_one(&main_list, NANO_CURSORPOS_KEY, N_("Cur Pos"), - IFHELP(nano_cursorpos_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_cursorpos_msg, FALSE, NANO_NO_KEY), NANO_CURSORPOS_FKEY, NANO_NO_KEY, VIEW, do_cursorpos_void); /* If we're using restricted mode, spell checking is disabled @@ -553,7 +553,7 @@ void shortcut_init(bool unjustify) * on the command line. */ /* TRANSLATORS: Try to keep this at most 10 characters. */ sc_init_one(&main_list, NANO_SPELL_KEY, N_("To Spell"), - IFHELP(nano_spell_msg, TRUE), NANO_NO_KEY, NANO_SPELL_FKEY, + IFSCHELP(nano_spell_msg, TRUE, NANO_NO_KEY), NANO_SPELL_FKEY, NANO_NO_KEY, NOVIEW, #ifndef DISABLE_SPELLER !ISSET(RESTRICTED) ? do_spell : @@ -561,172 +561,172 @@ void shortcut_init(bool unjustify) nano_disabled_msg); sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg, - IFHELP(nano_gotoline_msg, FALSE), NANO_GOTOLINE_ALTKEY, + IFSCHELP(nano_gotoline_msg, FALSE, NANO_GOTOLINE_ALTKEY), NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, do_gotolinecolumn_void); sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg #ifndef NANO_TINY - , IFHELP(nano_replace_msg, FALSE) + , IFSCHELP(nano_replace_msg, FALSE, NANO_ALT_REPLACE_KEY) #else - , IFHELP(nano_replace_msg, TRUE) + , IFSCHELP(nano_replace_msg, TRUE, NANO_ALT_REPLACE_KEY) #endif - , NANO_ALT_REPLACE_KEY, NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, - do_replace); + , NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, do_replace); #ifndef NANO_TINY sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"), - IFHELP(nano_mark_msg, FALSE), NANO_MARK_ALTKEY, NANO_MARK_FKEY, - NANO_NO_KEY, VIEW, do_mark); + IFSCHELP(nano_mark_msg, FALSE, NANO_MARK_ALTKEY), + NANO_MARK_FKEY, NANO_NO_KEY, VIEW, do_mark); sc_init_one(&main_list, NANO_NO_KEY, whereis_next_msg, - IFHELP(nano_whereis_next_msg, TRUE), NANO_WHEREIS_NEXT_KEY, + IFSCHELP(nano_whereis_next_msg, TRUE, NANO_WHEREIS_NEXT_KEY), NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, do_research); sc_init_one(&main_list, NANO_NO_KEY, N_("Copy Text"), - IFHELP(nano_copy_msg, FALSE), NANO_COPY_KEY, NANO_NO_KEY, + IFSCHELP(nano_copy_msg, FALSE, NANO_COPY_KEY), NANO_NO_KEY, NANO_COPY_ALTKEY, NOVIEW, do_copy_text); sc_init_one(&main_list, NANO_NO_KEY, N_("Indent Text"), - IFHELP(nano_indent_msg, FALSE), NANO_INDENT_KEY, NANO_NO_KEY, + IFSCHELP(nano_indent_msg, FALSE, NANO_INDENT_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_indent_void); sc_init_one(&main_list, NANO_NO_KEY, N_("Unindent Text"), - IFHELP(nano_unindent_msg, TRUE), NANO_UNINDENT_KEY, NANO_NO_KEY, - NANO_NO_KEY, NOVIEW, do_unindent); + IFSCHELP(nano_unindent_msg, TRUE, NANO_UNINDENT_KEY), + NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_unindent); #endif sc_init_one(&main_list, NANO_FORWARD_KEY, N_("Forward"), - IFHELP(nano_forward_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_forward_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_right); sc_init_one(&main_list, NANO_BACK_KEY, N_("Back"), - IFHELP(nano_back_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_back_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_left); #ifndef NANO_TINY sc_init_one(&main_list, NANO_NEXTWORD_KEY, N_("Next Word"), - IFHELP(nano_nextword_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_nextword_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_next_word_void); sc_init_one(&main_list, NANO_NO_KEY, N_("Prev Word"), - IFHELP(nano_prevword_msg, FALSE), NANO_PREVWORD_KEY, + IFSCHELP(nano_prevword_msg, FALSE, NANO_PREVWORD_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_prev_word_void); #endif sc_init_one(&main_list, NANO_PREVLINE_KEY, N_("Prev Line"), - IFHELP(nano_prevline_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_prevline_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_up_void); sc_init_one(&main_list, NANO_NEXTLINE_KEY, N_("Next Line"), - IFHELP(nano_nextline_msg, TRUE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_nextline_msg, TRUE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_down_void); sc_init_one(&main_list, NANO_HOME_KEY, N_("Home"), - IFHELP(nano_home_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_home_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_home); sc_init_one(&main_list, NANO_END_KEY, N_("End"), - IFHELP(nano_end_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_end_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_end); #ifndef DISABLE_JUSTIFY sc_init_one(&main_list, NANO_NO_KEY, beg_of_par_msg, - IFHELP(nano_parabegin_msg, FALSE), NANO_PARABEGIN_ALTKEY, + IFSCHELP(nano_parabegin_msg, FALSE, NANO_PARABEGIN_ALTKEY), NANO_NO_KEY, NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void); sc_init_one(&main_list, NANO_NO_KEY, end_of_par_msg, - IFHELP(nano_paraend_msg, FALSE), NANO_PARAEND_ALTKEY, + IFSCHELP(nano_paraend_msg, FALSE, NANO_PARAEND_ALTKEY), NANO_NO_KEY, NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void); #endif sc_init_one(&main_list, NANO_NO_KEY, first_line_msg, - IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY, + IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_ALTKEY), NANO_NO_KEY, NANO_FIRSTLINE_ALTKEY2, VIEW, do_first_line); sc_init_one(&main_list, NANO_NO_KEY, last_line_msg, - IFHELP(nano_lastline_msg, TRUE), NANO_LASTLINE_ALTKEY, + IFSCHELP(nano_lastline_msg, TRUE, NANO_LASTLINE_ALTKEY), NANO_NO_KEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); #ifndef NANO_TINY sc_init_one(&main_list, NANO_NO_KEY, N_("Find Other Bracket"), - IFHELP(nano_bracket_msg, FALSE), NANO_BRACKET_KEY, NANO_NO_KEY, - NANO_NO_KEY, VIEW, do_find_bracket); + IFSCHELP(nano_bracket_msg, FALSE, NANO_BRACKET_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, do_find_bracket); sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Up"), - IFHELP(nano_scrollup_msg, FALSE), NANO_SCROLLUP_KEY, + IFSCHELP(nano_scrollup_msg, FALSE, NANO_SCROLLUP_KEY), NANO_NO_KEY, NANO_SCROLLUP_ALTKEY, VIEW, do_scroll_up); sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Down"), - IFHELP(nano_scrolldown_msg, TRUE), NANO_SCROLLDOWN_KEY, + IFSCHELP(nano_scrolldown_msg, TRUE, NANO_SCROLLDOWN_KEY), NANO_NO_KEY, NANO_SCROLLDOWN_ALTKEY, VIEW, do_scroll_down); #endif #ifdef ENABLE_MULTIBUFFER sc_init_one(&main_list, NANO_NO_KEY, N_("Previous File"), - IFHELP(nano_prevfile_msg, FALSE), NANO_PREVFILE_KEY, + IFSCHELP(nano_prevfile_msg, FALSE, NANO_PREVFILE_KEY), NANO_NO_KEY, NANO_PREVFILE_ALTKEY, VIEW, switch_to_prev_buffer_void); sc_init_one(&main_list, NANO_NO_KEY, N_("Next File"), - IFHELP(nano_nextfile_msg, TRUE), NANO_NEXTFILE_KEY, NANO_NO_KEY, - NANO_NEXTFILE_ALTKEY, VIEW, switch_to_next_buffer_void); + IFSCHELP(nano_nextfile_msg, TRUE, NANO_NEXTFILE_KEY), + NANO_NO_KEY, NANO_NEXTFILE_ALTKEY, VIEW, + switch_to_next_buffer_void); #endif sc_init_one(&main_list, NANO_NO_KEY, N_("Verbatim Input"), - IFHELP(nano_verbatim_msg, FALSE), NANO_VERBATIM_KEY, + IFSCHELP(nano_verbatim_msg, FALSE, NANO_VERBATIM_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_verbatim_input); sc_init_one(&main_list, NANO_TAB_KEY, N_("Tab"), - IFHELP(nano_tab_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_tab_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_tab); sc_init_one(&main_list, NANO_ENTER_KEY, N_("Enter"), - IFHELP(nano_enter_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_enter_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_enter); sc_init_one(&main_list, NANO_DELETE_KEY, N_("Delete"), - IFHELP(nano_delete_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_delete_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_delete); sc_init_one(&main_list, NANO_BACKSPACE_KEY, N_("Backspace") #ifndef NANO_TINY - , IFHELP(nano_backspace_msg, FALSE) + , IFSCHELP(nano_backspace_msg, FALSE, NANO_NO_KEY) #else - , IFHELP(nano_backspace_msg, TRUE) + , IFSCHELP(nano_backspace_msg, TRUE, NANO_NO_KEY) #endif - , NANO_NO_KEY, NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_backspace); + , NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_backspace); #ifndef NANO_TINY sc_init_one(&main_list, NANO_NO_KEY, cut_till_end_msg, - IFHELP(nano_cut_till_end_msg, TRUE), NANO_CUTTILLEND_ALTKEY, + IFSCHELP(nano_cut_till_end_msg, TRUE, NANO_CUTTILLEND_ALTKEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end); #endif #ifndef DISABLE_JUSTIFY sc_init_one(&main_list, NANO_NO_KEY, fulljstify_msg, - IFHELP(nano_fulljustify_msg, FALSE), NANO_FULLJUSTIFY_ALTKEY, + IFSCHELP(nano_fulljustify_msg, FALSE, NANO_FULLJUSTIFY_ALTKEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); #endif #ifndef NANO_TINY sc_init_one(&main_list, NANO_NO_KEY, N_("Word Count"), - IFHELP(nano_wordcount_msg, FALSE), NANO_WORDCOUNT_KEY, + IFSCHELP(nano_wordcount_msg, FALSE, NANO_WORDCOUNT_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, do_wordlinechar_count); #endif sc_init_one(&main_list, NANO_REFRESH_KEY, refresh_msg #ifndef NANO_TINY - , IFHELP(nano_refresh_msg, TRUE) + , IFSCHELP(nano_refresh_msg, TRUE, NANO_NO_KEY) #else - , IFHELP(nano_refresh_msg, FALSE) + , IFSCHELP(nano_refresh_msg, FALSE, NANO_NO_KEY) #endif - , NANO_NO_KEY, NANO_NO_KEY, NANO_NO_KEY, VIEW, total_refresh); + , NANO_NO_KEY, NANO_NO_KEY, VIEW, total_refresh); free_shortcutage(&whereis_list); sc_init_one(&whereis_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -736,76 +736,76 @@ void shortcut_init(bool unjustify) ); sc_init_one(&whereis_list, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, first_line_msg, - IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY, + IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_ALTKEY), NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW, do_first_line); sc_init_one(&whereis_list, NANO_LASTLINE_KEY, last_line_msg, - IFHELP(nano_lastline_msg, FALSE), NANO_LASTLINE_ALTKEY, + IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_ALTKEY), NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); sc_init_one(&whereis_list, NANO_TOOTHERSEARCH_KEY, replace_msg, - IFHELP(nano_replace_msg, FALSE), NANO_NO_KEY, NANO_REPLACE_FKEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_replace_msg, FALSE, NANO_NO_KEY), + NANO_REPLACE_FKEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&whereis_list, NANO_TOGOTOLINE_KEY, go_to_line_msg, - IFHELP(nano_gotoline_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_gotoline_msg, FALSE, NANO_NO_KEY), NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, NULL); #ifndef DISABLE_JUSTIFY sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, beg_of_par_msg, - IFHELP(nano_parabegin_msg, FALSE), NANO_PARABEGIN_ALTKEY, + IFSCHELP(nano_parabegin_msg, FALSE, NANO_PARABEGIN_ALTKEY), NANO_NO_KEY, NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void); sc_init_one(&whereis_list, NANO_PARAEND_KEY, end_of_par_msg, - IFHELP(nano_paraend_msg, FALSE), NANO_PARAEND_ALTKEY, + IFSCHELP(nano_paraend_msg, FALSE, NANO_PARAEND_ALTKEY), NANO_NO_KEY, NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void); #endif #ifndef NANO_TINY sc_init_one(&whereis_list, NANO_NO_KEY, case_sens_msg, - IFHELP(nano_case_msg, FALSE), TOGGLE_CASE_KEY, NANO_NO_KEY, + IFSCHELP(nano_case_msg, FALSE, TOGGLE_CASE_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&whereis_list, NANO_NO_KEY, backwards_msg, - IFHELP(nano_reverse_msg, FALSE), TOGGLE_BACKWARDS_KEY, + IFSCHELP(nano_reverse_msg, FALSE, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif #ifdef HAVE_REGEX_H sc_init_one(&whereis_list, NANO_NO_KEY, regexp_msg, - IFHELP(nano_regexp_msg, FALSE), NANO_REGEXP_KEY, NANO_NO_KEY, + IFSCHELP(nano_regexp_msg, FALSE, NANO_REGEXP_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif #ifndef NANO_TINY sc_init_one(&whereis_list, NANO_PREVLINE_KEY, prev_history_msg, - IFHELP(nano_prev_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&whereis_list, NANO_NEXTLINE_KEY, next_history_msg, - IFHELP(nano_next_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&whereis_list, NANO_CUTTILLEND_KEY, cut_till_end_msg, - IFHELP(nano_cut_till_end_msg, FALSE), NANO_CUTTILLEND_ALTKEY, + IFSCHELP(nano_cut_till_end_msg, FALSE, NANO_CUTTILLEND_ALTKEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end); #endif #ifndef DISABLE_JUSTIFY sc_init_one(&whereis_list, NANO_FULLJUSTIFY_KEY, fulljstify_msg, - IFHELP(nano_fulljustify_msg, FALSE), NANO_FULLJUSTIFY_ALTKEY, + IFSCHELP(nano_fulljustify_msg, FALSE, NANO_FULLJUSTIFY_ALTKEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); #endif free_shortcutage(&replace_list); sc_init_one(&replace_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -815,53 +815,53 @@ void shortcut_init(bool unjustify) ); sc_init_one(&replace_list, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&replace_list, NANO_FIRSTLINE_KEY, first_line_msg, - IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY, + IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_ALTKEY), NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW, do_first_line); sc_init_one(&replace_list, NANO_LASTLINE_KEY, last_line_msg, - IFHELP(nano_lastline_msg, FALSE), NANO_LASTLINE_ALTKEY, + IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_ALTKEY), NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); /* TRANSLATORS: Try to keep this at most 12 characters. */ sc_init_one(&replace_list, NANO_TOOTHERSEARCH_KEY, N_("No Replace"), - IFHELP(nano_whereis_msg, FALSE), NANO_NO_KEY, NANO_REPLACE_FKEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_whereis_msg, FALSE, NANO_NO_KEY), + NANO_REPLACE_FKEY, NANO_NO_KEY, VIEW, NULL); #ifndef NANO_TINY sc_init_one(&replace_list, NANO_NO_KEY, case_sens_msg, - IFHELP(nano_case_msg, FALSE), TOGGLE_CASE_KEY, NANO_NO_KEY, + IFSCHELP(nano_case_msg, FALSE, TOGGLE_CASE_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&replace_list, NANO_NO_KEY, backwards_msg, - IFHELP(nano_reverse_msg, FALSE), TOGGLE_BACKWARDS_KEY, + IFSCHELP(nano_reverse_msg, FALSE, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif #ifdef HAVE_REGEX_H sc_init_one(&replace_list, NANO_NO_KEY, regexp_msg, - IFHELP(nano_regexp_msg, FALSE), NANO_REGEXP_KEY, NANO_NO_KEY, + IFSCHELP(nano_regexp_msg, FALSE, NANO_REGEXP_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif #ifndef NANO_TINY sc_init_one(&replace_list, NANO_PREVLINE_KEY, prev_history_msg, - IFHELP(nano_prev_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&replace_list, NANO_NEXTLINE_KEY, next_history_msg, - IFHELP(nano_next_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif free_shortcutage(&replace_list_2); sc_init_one(&replace_list_2, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -871,32 +871,32 @@ void shortcut_init(bool unjustify) ); sc_init_one(&replace_list_2, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&replace_list_2, NANO_FIRSTLINE_KEY, first_line_msg, - IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY, + IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_ALTKEY), NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW, do_first_line); sc_init_one(&replace_list_2, NANO_LASTLINE_KEY, last_line_msg, - IFHELP(nano_lastline_msg, FALSE), NANO_LASTLINE_ALTKEY, + IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_ALTKEY), NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); #ifndef NANO_TINY sc_init_one(&replace_list_2, NANO_PREVLINE_KEY, prev_history_msg, - IFHELP(nano_prev_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&replace_list_2, NANO_NEXTLINE_KEY, next_history_msg, - IFHELP(nano_next_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif free_shortcutage(&gotoline_list); sc_init_one(&gotoline_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -906,26 +906,26 @@ void shortcut_init(bool unjustify) ); sc_init_one(&gotoline_list, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&gotoline_list, NANO_FIRSTLINE_KEY, first_line_msg, - IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY, + IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_ALTKEY), NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW, do_first_line); sc_init_one(&gotoline_list, NANO_LASTLINE_KEY, last_line_msg, - IFHELP(nano_lastline_msg, FALSE), NANO_LASTLINE_ALTKEY, + IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_ALTKEY), NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); sc_init_one(&gotoline_list, NANO_TOOTHERWHEREIS_KEY, - N_("Go To Text"), IFHELP(nano_whereis_msg, FALSE), NANO_NO_KEY, - NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); + N_("Go To Text"), IFSCHELP(nano_whereis_msg, FALSE, + NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); free_shortcutage(&writefile_list); sc_init_one(&writefile_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -935,7 +935,7 @@ void shortcut_init(bool unjustify) ); sc_init_one(&writefile_list, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #ifndef DISABLE_BROWSER @@ -943,7 +943,7 @@ void shortcut_init(bool unjustify) * It's useless since inserting files is disabled. */ if (!ISSET(RESTRICTED)) sc_init_one(&writefile_list, NANO_TOFILES_KEY, to_files_msg, - IFHELP(nano_tofiles_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_tofiles_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); #endif @@ -957,40 +957,40 @@ void shortcut_init(bool unjustify) if (!ISSET(RESTRICTED)) /* TRANSLATORS: Try to keep this at most 16 characters. */ sc_init_one(&writefile_list, NANO_NO_KEY, N_("DOS Format"), - IFHELP(nano_dos_msg, FALSE), TOGGLE_DOS_KEY, + IFSCHELP(nano_dos_msg, FALSE, TOGGLE_DOS_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); if (!ISSET(RESTRICTED)) /* TRANSLATORS: Try to keep this at most 16 characters. */ sc_init_one(&writefile_list, NANO_NO_KEY, N_("Mac Format"), - IFHELP(nano_mac_msg, FALSE), TOGGLE_MAC_KEY, + IFSCHELP(nano_mac_msg, FALSE, TOGGLE_MAC_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); #endif if (!ISSET(RESTRICTED)) /* TRANSLATORS: Try to keep this at most 16 characters. */ sc_init_one(&writefile_list, NANO_NO_KEY, N_("Append"), - IFHELP(nano_append_msg, FALSE), NANO_APPEND_KEY, + IFSCHELP(nano_append_msg, FALSE, NANO_APPEND_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); if (!ISSET(RESTRICTED)) /* TRANSLATORS: Try to keep this at most 16 characters. */ sc_init_one(&writefile_list, NANO_NO_KEY, N_("Prepend"), - IFHELP(nano_prepend_msg, FALSE), NANO_PREPEND_KEY, + IFSCHELP(nano_prepend_msg, FALSE, NANO_PREPEND_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); #ifndef NANO_TINY if (!ISSET(RESTRICTED)) /* TRANSLATORS: Try to keep this at most 16 characters. */ sc_init_one(&writefile_list, NANO_NO_KEY, N_("Backup File"), - IFHELP(nano_backup_msg, FALSE), TOGGLE_BACKUP_KEY, + IFSCHELP(nano_backup_msg, FALSE, TOGGLE_BACKUP_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); #endif free_shortcutage(&insertfile_list); sc_init_one(&insertfile_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -1000,7 +1000,7 @@ void shortcut_init(bool unjustify) ); sc_init_one(&insertfile_list, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #ifndef DISABLE_BROWSER @@ -1008,7 +1008,7 @@ void shortcut_init(bool unjustify) * It's useless since inserting files is disabled. */ if (!ISSET(RESTRICTED)) sc_init_one(&insertfile_list, NANO_TOFILES_KEY, to_files_msg, - IFHELP(nano_tofiles_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_tofiles_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); #endif @@ -1019,16 +1019,16 @@ void shortcut_init(bool unjustify) sc_init_one(&insertfile_list, NANO_TOOTHERINSERT_KEY, /* TRANSLATORS: Try to keep this at most 22 * characters. */ - N_("Execute Command"), IFHELP(nano_execute_msg, FALSE), - NANO_NO_KEY, NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); + N_("Execute Command"), IFSCHELP(nano_execute_msg, FALSE, + NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); #ifdef ENABLE_MULTIBUFFER /* If we're using restricted mode, the multibuffer toggle is * disabled. It's useless since inserting files is disabled. */ if (!ISSET(RESTRICTED)) sc_init_one(&insertfile_list, NANO_NO_KEY, new_buffer_msg, - IFHELP(nano_multibuffer_msg, FALSE), - TOGGLE_MULTIBUFFER_KEY, NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_multibuffer_msg, FALSE, + TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); #endif #endif @@ -1037,7 +1037,7 @@ void shortcut_init(bool unjustify) free_shortcutage(&extcmd_list); sc_init_one(&extcmd_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -1047,16 +1047,16 @@ void shortcut_init(bool unjustify) ); sc_init_one(&extcmd_list, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&extcmd_list, NANO_TOOTHERINSERT_KEY, N_("Insert File"), - IFHELP(nano_insert_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_insert_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #ifdef ENABLE_MULTIBUFFER sc_init_one(&extcmd_list, NANO_NO_KEY, new_buffer_msg, - IFHELP(nano_multibuffer_msg, FALSE), TOGGLE_MULTIBUFFER_KEY, + IFSCHELP(nano_multibuffer_msg, FALSE, TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); #endif #endif @@ -1065,35 +1065,35 @@ void shortcut_init(bool unjustify) free_shortcutage(&help_list); sc_init_one(&help_list, NANO_REFRESH_KEY, refresh_msg, - IFHELP(nano_refresh_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_refresh_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg, - IFHELP(nano_exit_msg, FALSE), NANO_NO_KEY, NANO_EXIT_FKEY, + IFSCHELP(nano_exit_msg, FALSE, NANO_NO_KEY), NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&help_list, NANO_PREVPAGE_KEY, prev_page_msg, - IFHELP(nano_prevpage_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_prevpage_msg, FALSE, NANO_NO_KEY), NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&help_list, NANO_NEXTPAGE_KEY, next_page_msg, - IFHELP(nano_nextpage_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_nextpage_msg, FALSE, NANO_NO_KEY), NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&help_list, NANO_PREVLINE_KEY, N_("Prev Line"), - IFHELP(nano_prevline_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_prevline_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&help_list, NANO_NEXTLINE_KEY, N_("Next Line"), - IFHELP(nano_nextline_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_nextline_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&help_list, NANO_NO_KEY, first_line_msg, - IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY, + IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_ALTKEY), NANO_NO_KEY, NANO_FIRSTLINE_ALTKEY2, VIEW, NULL); sc_init_one(&help_list, NANO_NO_KEY, last_line_msg, - IFHELP(nano_lastline_msg, TRUE), NANO_LASTLINE_ALTKEY, + IFSCHELP(nano_lastline_msg, TRUE, NANO_LASTLINE_ALTKEY), NANO_NO_KEY, NANO_LASTLINE_ALTKEY2, VIEW, NULL); #endif @@ -1101,7 +1101,7 @@ void shortcut_init(bool unjustify) free_shortcutage(&spell_list); sc_init_one(&spell_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -1111,7 +1111,7 @@ void shortcut_init(bool unjustify) ); sc_init_one(&spell_list, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif @@ -1119,46 +1119,46 @@ void shortcut_init(bool unjustify) free_shortcutage(&browser_list); sc_init_one(&browser_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&browser_list, NANO_EXIT_KEY, exit_msg, - IFHELP(nano_exitbrowser_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_exitbrowser_msg, FALSE, NANO_NO_KEY), NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&browser_list, NANO_WHEREIS_KEY, whereis_msg, - IFHELP(nano_whereis_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_whereis_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&browser_list, NANO_NO_KEY, whereis_next_msg, - IFHELP(nano_whereis_next_msg, FALSE), NANO_WHEREIS_NEXT_KEY, + IFSCHELP(nano_whereis_next_msg, FALSE, NANO_WHEREIS_NEXT_KEY), NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&browser_list, NANO_PREVPAGE_KEY, prev_page_msg, - IFHELP(nano_prevpage_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_prevpage_msg, FALSE, NANO_NO_KEY), NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&browser_list, NANO_NEXTPAGE_KEY, next_page_msg, - IFHELP(nano_nextpage_msg, FALSE), NANO_NO_KEY, + IFSCHELP(nano_nextpage_msg, FALSE, NANO_NO_KEY), NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&browser_list, NANO_NO_KEY, first_file_msg, - IFHELP(nano_firstfile_msg, FALSE), NANO_FIRSTFILE_ALTKEY, + IFSCHELP(nano_firstfile_msg, FALSE, NANO_FIRSTFILE_ALTKEY), NANO_NO_KEY, NANO_FIRSTFILE_ALTKEY2, VIEW, NULL); sc_init_one(&browser_list, NANO_NO_KEY, last_file_msg, - IFHELP(nano_lastfile_msg, FALSE), NANO_LASTFILE_ALTKEY, + IFSCHELP(nano_lastfile_msg, FALSE, NANO_LASTFILE_ALTKEY), NANO_NO_KEY, NANO_LASTFILE_ALTKEY2, VIEW, NULL); /* TRANSLATORS: Try to keep this at most 12 characters. */ sc_init_one(&browser_list, NANO_GOTODIR_KEY, N_("Go To Dir"), - IFHELP(nano_gotodir_msg, FALSE), NANO_GOTODIR_ALTKEY, + IFSCHELP(nano_gotodir_msg, FALSE, NANO_GOTODIR_ALTKEY), NANO_GOTODIR_FKEY, NANO_NO_KEY, VIEW, NULL); free_shortcutage(&whereis_file_list); sc_init_one(&whereis_file_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_browser_help @@ -1168,48 +1168,48 @@ void shortcut_init(bool unjustify) ); sc_init_one(&whereis_file_list, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&whereis_file_list, NANO_FIRSTFILE_KEY, first_file_msg, - IFHELP(nano_firstfile_msg, FALSE), NANO_FIRSTFILE_ALTKEY, + IFSCHELP(nano_firstfile_msg, FALSE, NANO_FIRSTFILE_ALTKEY), NANO_FIRSTFILE_FKEY, NANO_FIRSTFILE_ALTKEY2, VIEW, do_first_file); sc_init_one(&whereis_file_list, NANO_LASTFILE_KEY, last_file_msg, - IFHELP(nano_lastfile_msg, FALSE), NANO_LASTFILE_ALTKEY, + IFSCHELP(nano_lastfile_msg, FALSE, NANO_LASTFILE_ALTKEY), NANO_LASTFILE_FKEY, NANO_LASTFILE_ALTKEY2, VIEW, do_last_file); #ifndef NANO_SMALL sc_init_one(&whereis_file_list, NANO_NO_KEY, case_sens_msg, - IFHELP(nano_case_msg, FALSE), TOGGLE_CASE_KEY, NANO_NO_KEY, + IFSCHELP(nano_case_msg, FALSE, TOGGLE_CASE_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&whereis_file_list, NANO_NO_KEY, backwards_msg, - IFHELP(nano_reverse_msg, FALSE), TOGGLE_BACKWARDS_KEY, + IFSCHELP(nano_reverse_msg, FALSE, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif #ifdef HAVE_REGEX_H sc_init_one(&whereis_file_list, NANO_NO_KEY, regexp_msg, - IFHELP(nano_regexp_msg, FALSE), NANO_REGEXP_KEY, NANO_NO_KEY, + IFSCHELP(nano_regexp_msg, FALSE, NANO_REGEXP_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif #ifndef NANO_SMALL sc_init_one(&whereis_file_list, NANO_PREVLINE_KEY, prev_history_msg, - IFHELP(nano_prev_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); sc_init_one(&whereis_file_list, NANO_NEXTLINE_KEY, next_history_msg, - IFHELP(nano_next_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, - NANO_NO_KEY, VIEW, NULL); + IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY), + NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif free_shortcutage(&gotodir_list); sc_init_one(&gotodir_list, NANO_HELP_KEY, get_help_msg, - IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY, + IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, VIEW, #ifndef DISABLE_HELP do_help_void @@ -1219,7 +1219,7 @@ void shortcut_init(bool unjustify) ); sc_init_one(&gotodir_list, NANO_CANCEL_KEY, cancel_msg, - IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY, + IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); #endif @@ -1244,8 +1244,11 @@ void free_shortcutage(shortcut **shortcutage) #ifndef NANO_TINY /* Add a new toggle to the end of the global toggle list. */ -void toggle_init_one(int val, const char *desc, bool blank_after, long - flag) +void toggle_init_one(int val +#ifndef DISABLE_HELP + , const char *desc, bool blank_after +#endif + , long flag) { toggle *u; @@ -1260,8 +1263,10 @@ void toggle_init_one(int val, const char *desc, bool blank_after, long } u->val = val; +#ifndef DISABLE_HELP u->desc = (desc == NULL) ? "" : _(desc); u->blank_after = blank_after; +#endif u->flag = flag; u->next = NULL; } @@ -1274,91 +1279,106 @@ void toggle_init(void) if (toggles != NULL) return; - toggle_init_one(TOGGLE_NOHELP_KEY, N_("Help mode"), FALSE, NO_HELP); +/* The following macro is to be used in calling toggle_init_one(). The + * point is that toggle_init_one() takes 4 arguments, unless + * DISABLE_HELP is defined, when the 2nd and 3rd ones should not be + * there. */ +#ifndef DISABLE_HELP +#define IFTHELP(help, blank, nextvar) help, blank, nextvar +#else +#define IFTHELP(help, blank, nextvar) nextvar +#endif + + toggle_init_one(TOGGLE_NOHELP_KEY, IFTHELP(N_("Help mode"), FALSE, + NO_HELP)); toggle_init_one(TOGGLE_CONST_KEY, - N_("Constant cursor position display"), FALSE, CONST_UPDATE); + IFTHELP(N_("Constant cursor position display"), FALSE, + CONST_UPDATE)); toggle_init_one(TOGGLE_MORESPACE_KEY, - N_("Use of more space for editing"), FALSE, MORE_SPACE); + IFTHELP(N_("Use of more space for editing"), FALSE, + MORE_SPACE)); - toggle_init_one(TOGGLE_SMOOTH_KEY, N_("Smooth scrolling"), + toggle_init_one(TOGGLE_SMOOTH_KEY, #ifdef ENABLE_NANORC - FALSE + IFTHELP(N_("Smooth scrolling"), FALSE, SMOOTH_SCROLL) #else - TRUE + IFTHELP(N_("Smooth scrolling"), TRUE, SMOOTH_SCROLL) #endif - , SMOOTH_SCROLL); + ); #ifdef ENABLE_NANORC - toggle_init_one(TOGGLE_WHITESPACE_KEY, N_("Whitespace display"), + toggle_init_one(TOGGLE_WHITESPACE_KEY, #ifdef ENABLE_COLOR - FALSE + IFTHELP(N_("Whitespace display"), FALSE, WHITESPACE_DISPLAY) #else - TRUE + IFTHELP(N_("Whitespace display"), TRUE, WHITESPACE_DISPLAY) #endif - , WHITESPACE_DISPLAY); + ); #endif #ifdef ENABLE_COLOR - toggle_init_one(TOGGLE_SYNTAX_KEY, N_("Color syntax highlighting"), - TRUE, NO_COLOR_SYNTAX); + toggle_init_one(TOGGLE_SYNTAX_KEY, + IFTHELP(N_("Color syntax highlighting"), TRUE, NO_COLOR_SYNTAX)); #endif - toggle_init_one(TOGGLE_SMARTHOME_KEY, N_("Smart home key"), FALSE, - SMART_HOME); + toggle_init_one(TOGGLE_SMARTHOME_KEY, IFTHELP(N_("Smart home key"), + FALSE, SMART_HOME)); - toggle_init_one(TOGGLE_AUTOINDENT_KEY, N_("Auto indent"), FALSE, - AUTOINDENT); + toggle_init_one(TOGGLE_AUTOINDENT_KEY, IFTHELP(N_("Auto indent"), + FALSE, AUTOINDENT)); - toggle_init_one(TOGGLE_CUTTOEND_KEY, N_("Cut to end"), FALSE, - CUT_TO_END); + toggle_init_one(TOGGLE_CUTTOEND_KEY, IFTHELP(N_("Cut to end"), + FALSE, CUT_TO_END)); #ifndef DISABLE_WRAPPING - toggle_init_one(TOGGLE_WRAP_KEY, N_("Long line wrapping"), FALSE, - NO_WRAP); + toggle_init_one(TOGGLE_WRAP_KEY, IFTHELP(N_("Long line wrapping"), + FALSE, NO_WRAP)); #endif toggle_init_one(TOGGLE_TABSTOSPACES_KEY, - N_("Conversion of typed tabs to spaces"), #if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_MOUSE) - !ISSET(RESTRICTED) ? TRUE : FALSE + IFTHELP(N_("Conversion of typed tabs to spaces"), + !ISSET(RESTRICTED) ? TRUE : FALSE, TABS_TO_SPACES) #else - FALSE + IFTHELP(N_("Conversion of typed tabs to spaces"), FALSE, + TABS_TO_SPACES) #endif - , TABS_TO_SPACES); + ); /* If we're using restricted mode, the backup toggle is disabled. * It's useless since backups are disabled. */ if (!ISSET(RESTRICTED)) - toggle_init_one(TOGGLE_BACKUP_KEY, N_("Backup files"), FALSE, - BACKUP_FILE); + toggle_init_one(TOGGLE_BACKUP_KEY, IFTHELP(N_("Backup files"), + FALSE, BACKUP_FILE)); #ifdef ENABLE_MULTIBUFFER /* If we're using restricted mode, the multibuffer toggle is * disabled. It's useless since inserting files is disabled. */ if (!ISSET(RESTRICTED)) toggle_init_one(TOGGLE_MULTIBUFFER_KEY, - N_("Multiple file buffers"), FALSE, MULTIBUFFER); + IFTHELP(N_("Multiple file buffers"), FALSE, + MULTIBUFFER)); #endif #ifndef DISABLE_MOUSE - toggle_init_one(TOGGLE_MOUSE_KEY, N_("Mouse support"), FALSE, - USE_MOUSE); + toggle_init_one(TOGGLE_MOUSE_KEY, IFTHELP(N_("Mouse support"), + FALSE, USE_MOUSE)); #endif /* If we're using restricted mode, the DOS/Mac conversion toggle is * disabled. It's useless since inserting files is disabled. */ if (!ISSET(RESTRICTED)) toggle_init_one(TOGGLE_NOCONVERT_KEY, - N_("No conversion from DOS/Mac format"), FALSE, - NO_CONVERT); + IFTHELP(N_("No conversion from DOS/Mac format"), FALSE, + NO_CONVERT)); /* If we're using restricted mode, the suspend toggle is disabled. * It's useless since suspending is disabled. */ if (!ISSET(RESTRICTED)) - toggle_init_one(TOGGLE_SUSPEND_KEY, N_("Suspension"), FALSE, - SUSPEND); + toggle_init_one(TOGGLE_SUSPEND_KEY, IFTHELP(N_("Suspension"), + FALSE, SUSPEND)); } #endif /* !NANO_TINY */ diff --git a/src/nano.h b/src/nano.h index c67afea8..c8498d1d 100644 --- a/src/nano.h +++ b/src/nano.h @@ -291,11 +291,12 @@ typedef struct shortcut { #ifndef DISABLE_HELP const char *help; /* The help file entry text for this function. */ -#endif bool blank_after; /* Whether there should be a blank line after the help entry * text for this function. */ - /* Key values that aren't used should be set to NANO_NO_KEY. */ +#endif + /* Note: Key values that aren't used should be set to + * NANO_NO_KEY. */ int ctrlval; /* The special sentinel key or control key we want bound, if * any. */ @@ -320,9 +321,11 @@ typedef struct toggle { const char *desc; /* The description of the toggle, e.g. "Cut to end"; we'll * append Enabled or Disabled to it. */ +#ifndef DISABLE_HELP bool blank_after; /* Whether there should be a blank line after the description of * the toggle. */ +#endif long flag; /* Which flag actually gets toggled. */ struct toggle *next; diff --git a/src/proto.h b/src/proto.h index b9bb4079..e17efac4 100644 --- a/src/proto.h +++ b/src/proto.h @@ -342,16 +342,19 @@ void save_history(void); /* Public functions in global.c. */ size_t length_of_list(const shortcut *s); #ifndef NANO_TINY -void toggle_init_one(int val, const char *desc, bool blank_after, long - flag); +void toggle_init_one(int val +#ifndef DISABLE_HELP + , const char *desc, bool blank_after +#endif + , long flag); void toggle_init(void); #endif -void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc, +void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc #ifndef DISABLE_HELP - const char *help, + , const char *help, bool blank_after #endif - bool blank_after, int metaval, int funcval, int miscval, bool - view, void (*func)(void)); + , int metaval, int funcval, int miscval, bool view, void + (*func)(void)); void shortcut_init(bool unjustify); void free_shortcutage(shortcut **shortcutage); #ifdef DEBUG