"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.6.1/src/help.c" (22 Dec 2021, 44980 Bytes) of package /linux/misc/tin-2.6.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "help.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.6.0_vs_2.6.1.

    1 /*
    2  *  Project   : tin - a Usenet reader
    3  *  Module    : help.c
    4  *  Author    : I. Lea
    5  *  Created   : 1991-04-01
    6  *  Updated   : 2021-10-29
    7  *  Notes     :
    8  *
    9  * Copyright (c) 1991-2022 Iain Lea <iain@bricbrac.de>
   10  * All rights reserved.
   11  *
   12  * Redistribution and use in source and binary forms, with or without
   13  * modification, are permitted provided that the following conditions
   14  * are met:
   15  *
   16  * 1. Redistributions of source code must retain the above copyright notice,
   17  *    this list of conditions and the following disclaimer.
   18  *
   19  * 2. Redistributions in binary form must reproduce the above copyright
   20  *    notice, this list of conditions and the following disclaimer in the
   21  *    documentation and/or other materials provided with the distribution.
   22  *
   23  * 3. Neither the name of the copyright holder nor the names of its
   24  *    contributors may be used to endorse or promote products derived from
   25  *    this software without specific prior written permission.
   26  *
   27  * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   28  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   29  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   30  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   31  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   37  * POSSIBILITY OF SUCH DAMAGE.
   38  */
   39 
   40 
   41 #ifndef TIN_H
   42 #   include "tin.h"
   43 #endif /* !TIN_H */
   44 #ifndef TCURSES_H
   45 #   include "tcurses.h"
   46 #endif /* !TCURSES_H */
   47 
   48 
   49 typedef struct thp {
   50     constext *helptext;
   51     t_function func;
   52 } t_help_page;
   53 
   54 /*
   55  * local prototypes
   56  */
   57 static void make_help_page(FILE *fp, const t_help_page *helppage, const struct keylist keys);
   58 
   59 
   60 static constext txt_help_empty_line[] = "";
   61 
   62 static t_help_page attachment_help_page[] = {
   63     { txt_help_title_navi, NOT_ASSIGNED },
   64     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
   65     { txt_help_global_page_up, GLOBAL_PAGE_UP },
   66     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
   67     { txt_help_global_line_up, GLOBAL_LINE_UP },
   68     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
   69     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
   70     { txt_help_empty_line, NOT_ASSIGNED },
   71     { txt_help_attachment_first, GLOBAL_FIRST_PAGE },
   72     { txt_help_attachment_last, GLOBAL_LAST_PAGE },
   73     { txt_help_attachment_goto, NOT_ASSIGNED },
   74     { txt_help_empty_line, NOT_ASSIGNED },
   75     { txt_help_title_disp, NOT_ASSIGNED },
   76     { txt_help_attachment_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
   77     { txt_help_empty_line, NOT_ASSIGNED },
   78     { txt_help_title_attachment_ops, NOT_ASSIGNED },
   79     { txt_help_attachment_select, ATTACHMENT_SELECT },
   80 #ifndef DONT_HAVE_PIPING
   81     { txt_help_attachment_pipe, ATTACHMENT_PIPE },
   82     { txt_help_attachment_pipe_raw, GLOBAL_PIPE },
   83 #endif /* !DONT_HAVE_PIPING */
   84     { txt_help_attachment_save, ATTACHMENT_SAVE },
   85     { txt_help_attachment_tag, ATTACHMENT_TAG },
   86     { txt_help_attachment_tag_pattern, ATTACHMENT_TAG_PATTERN },
   87     { txt_help_attachment_toggle_tagged, ATTACHMENT_TOGGLE_TAGGED },
   88     { txt_help_attachment_untag, ATTACHMENT_UNTAG },
   89     { txt_help_empty_line, NOT_ASSIGNED },
   90     { txt_help_attachment_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
   91     { txt_help_attachment_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
   92     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
   93     { txt_help_empty_line, NOT_ASSIGNED },
   94     { txt_help_title_misc, NOT_ASSIGNED },
   95     { txt_help_select_quit, GLOBAL_QUIT },
   96     { txt_help_global_help, GLOBAL_HELP },
   97     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
   98     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
   99 #ifndef NO_SHELL_ESCAPE
  100     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  101 #endif /* !NO_SHELL_ESCAPE */
  102     { NULL, NOT_ASSIGNED }
  103 };
  104 
  105 static t_help_page attrib_help_page[] = {
  106     { txt_help_title_navi, NOT_ASSIGNED },
  107     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  108     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  109     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  110     { txt_help_global_line_up, GLOBAL_LINE_UP },
  111     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
  112     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
  113     { txt_help_empty_line, NOT_ASSIGNED },
  114     { txt_help_attrib_first_opt, GLOBAL_FIRST_PAGE },
  115     { txt_help_attrib_last_opt, GLOBAL_LAST_PAGE },
  116     { txt_help_attrib_goto_opt, NOT_ASSIGNED },
  117     { txt_help_empty_line, NOT_ASSIGNED },
  118     { txt_help_attrib_search_opt_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  119     { txt_help_attrib_search_opt_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  120     { txt_help_select_search_group_comment, NOT_ASSIGNED },
  121     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  122     { txt_help_empty_line, NOT_ASSIGNED },
  123     { txt_help_title_attrib_ops, NOT_ASSIGNED },
  124     { txt_help_attrib_reset_attrib, CONFIG_RESET_ATTRIB },
  125     { txt_help_attrib_select, CONFIG_SELECT },
  126     { txt_help_attrib_toggle_attrib, CONFIG_TOGGLE_ATTRIB },
  127     { txt_help_empty_line, NOT_ASSIGNED },
  128     { txt_help_title_misc, NOT_ASSIGNED },
  129     { txt_help_select_quit, GLOBAL_QUIT },
  130     { txt_help_select_quit_no_write, CONFIG_NO_SAVE },
  131     { txt_help_global_help, GLOBAL_HELP },
  132     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  133 #ifndef NO_SHELL_ESCAPE
  134     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  135 #endif /* !NO_SHELL_ESCAPE */
  136     { txt_help_empty_line, NOT_ASSIGNED },
  137     { txt_help_global_version, GLOBAL_VERSION },
  138     { NULL, NOT_ASSIGNED }
  139 };
  140 
  141 static t_help_page config_help_page[] = {
  142     { txt_help_title_navi, NOT_ASSIGNED },
  143     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  144     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  145     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  146     { txt_help_global_line_up, GLOBAL_LINE_UP },
  147     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
  148     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
  149     { txt_help_empty_line, NOT_ASSIGNED },
  150     { txt_help_config_first_opt, GLOBAL_FIRST_PAGE },
  151     { txt_help_config_last_opt, GLOBAL_LAST_PAGE },
  152     { txt_help_config_goto_opt, NOT_ASSIGNED },
  153     { txt_help_empty_line, NOT_ASSIGNED },
  154     { txt_help_config_search_opt_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  155     { txt_help_config_search_opt_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  156     { txt_help_select_search_group_comment, NOT_ASSIGNED },
  157     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  158     { txt_help_empty_line, NOT_ASSIGNED },
  159     { txt_help_title_config_ops, NOT_ASSIGNED },
  160     { txt_help_config_select, CONFIG_SELECT },
  161     { txt_help_config_toggle_attrib, CONFIG_TOGGLE_ATTRIB },
  162     { txt_help_config_scope_menu, CONFIG_SCOPE_MENU },
  163     { txt_help_empty_line, NOT_ASSIGNED },
  164     { txt_help_title_misc, NOT_ASSIGNED },
  165     { txt_help_select_quit, GLOBAL_QUIT },
  166     { txt_help_select_quit_no_write, CONFIG_NO_SAVE },
  167     { txt_help_global_help, GLOBAL_HELP },
  168     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  169 #ifndef NO_SHELL_ESCAPE
  170     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  171 #endif /* !NO_SHELL_ESCAPE */
  172     { txt_help_empty_line, NOT_ASSIGNED },
  173     { txt_help_global_version, GLOBAL_VERSION },
  174     { NULL, NOT_ASSIGNED }
  175 };
  176 
  177 static t_help_page scope_help_page[] = {
  178     { txt_help_title_navi, NOT_ASSIGNED },
  179     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  180     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  181     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  182     { txt_help_global_line_up, GLOBAL_LINE_UP },
  183     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
  184     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
  185     { txt_help_empty_line, NOT_ASSIGNED },
  186     { txt_help_scope_first_scope, GLOBAL_FIRST_PAGE },
  187     { txt_help_scope_last_scope, GLOBAL_LAST_PAGE },
  188     { txt_help_scope_goto_scope, NOT_ASSIGNED },
  189     { txt_help_empty_line, NOT_ASSIGNED },
  190     { txt_help_title_scope_ops, NOT_ASSIGNED },
  191     { txt_help_scope_add, SCOPE_ADD },
  192     { txt_help_scope_move, SCOPE_MOVE },
  193     { txt_help_scope_rename, SCOPE_RENAME },
  194     { txt_help_scope_del, SCOPE_DELETE },
  195     { txt_help_scope_select, SCOPE_SELECT },
  196     { txt_help_empty_line, NOT_ASSIGNED },
  197     { txt_help_scope_edit_attrib_file, SCOPE_EDIT_ATTRIBUTES_FILE },
  198     { txt_help_empty_line, NOT_ASSIGNED },
  199     { txt_help_title_misc, NOT_ASSIGNED },
  200     { txt_help_select_quit, GLOBAL_QUIT },
  201     { txt_help_global_help, GLOBAL_HELP },
  202     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  203     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  204 #ifndef NO_SHELL_ESCAPE
  205     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  206 #endif /* !NO_SHELL_ESCAPE */
  207     { NULL, NOT_ASSIGNED }
  208 };
  209 
  210 static t_help_page select_help_page[] = {
  211     { txt_help_title_navi, NOT_ASSIGNED },
  212     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  213     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  214     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  215     { txt_help_global_line_up, GLOBAL_LINE_UP },
  216     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
  217     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
  218     { txt_help_empty_line, NOT_ASSIGNED },
  219     { txt_help_select_first_group, GLOBAL_FIRST_PAGE },
  220     { txt_help_select_last_group, GLOBAL_LAST_PAGE },
  221     { txt_help_select_group_by_num, NOT_ASSIGNED },
  222     { txt_help_select_goto_group, SELECT_GOTO },
  223     { txt_help_select_next_unread_group, SELECT_NEXT_UNREAD_GROUP },
  224 #ifdef NNTP_ABLE
  225     { txt_help_select_lookup_group, GLOBAL_LOOKUP_MESSAGEID },
  226     { txt_help_select_lookup_group_comment, NOT_ASSIGNED },
  227 #endif /* NNTP_ABLE */
  228     { txt_help_empty_line, NOT_ASSIGNED },
  229     { txt_help_select_search_group_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  230     { txt_help_select_search_group_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  231     { txt_help_select_search_group_comment, NOT_ASSIGNED },
  232     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  233     { txt_help_empty_line, NOT_ASSIGNED },
  234     { txt_help_title_disp, NOT_ASSIGNED },
  235     { txt_help_select_toggle_read_groups, SELECT_TOGGLE_READ_DISPLAY },
  236     { txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
  237     { txt_help_select_toggle_descriptions, SELECT_TOGGLE_DESCRIPTIONS },
  238     { txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
  239 #ifdef HAVE_COLOR
  240     { txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
  241 #endif /* HAVE_COLOR */
  242     { txt_help_empty_line, NOT_ASSIGNED },
  243     { txt_help_select_sort_active, SELECT_SORT_ACTIVE },
  244     { txt_help_select_yank_active, SELECT_YANK_ACTIVE },
  245     { txt_help_select_sync_with_active, SELECT_SYNC_WITH_ACTIVE },
  246     { txt_help_empty_line, NOT_ASSIGNED },
  247     { txt_help_title_ops, NOT_ASSIGNED },
  248     { txt_help_select_read_group, SELECT_ENTER_GROUP },
  249     { txt_help_select_next_unread_group, SELECT_ENTER_NEXT_UNREAD_GROUP },
  250 #ifndef NO_POSTING
  251     { txt_help_global_post, GLOBAL_POST },
  252     { txt_help_global_post_postponed, GLOBAL_POSTPONED },
  253 #endif /* NO_POSTING */
  254     { txt_help_empty_line, NOT_ASSIGNED },
  255     { txt_help_select_group_range, GLOBAL_SET_RANGE },
  256     { txt_help_empty_line, NOT_ASSIGNED },
  257     { txt_help_select_catchup, CATCHUP },
  258     { txt_help_select_catchup_next_unread, CATCHUP_NEXT_UNREAD },
  259     { txt_help_select_mark_group_unread, SELECT_MARK_GROUP_UNREAD },
  260     { txt_help_select_subscribe, SELECT_SUBSCRIBE },
  261     { txt_help_select_unsubscribe, SELECT_UNSUBSCRIBE },
  262     { txt_help_select_subscribe_pattern, SELECT_SUBSCRIBE_PATTERN },
  263     { txt_help_select_unsubscribe_pattern, SELECT_UNSUBSCRIBE_PATTERN },
  264     { txt_help_select_move_group, SELECT_MOVE_GROUP },
  265     { txt_help_empty_line, NOT_ASSIGNED },
  266     { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER},
  267     { txt_help_empty_line, NOT_ASSIGNED },
  268     { txt_help_title_misc, NOT_ASSIGNED },
  269     { txt_help_select_quit, GLOBAL_QUIT },
  270     { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
  271     { txt_help_select_quit_no_write, SELECT_QUIT_NO_WRITE },
  272     { txt_help_global_help, GLOBAL_HELP },
  273     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  274     { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
  275     { txt_help_global_esc, GLOBAL_ABORT },
  276     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  277 #ifndef NO_SHELL_ESCAPE
  278     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  279 #endif /* !NO_SHELL_ESCAPE */
  280     { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
  281     { txt_help_select_reset_newsrc, SELECT_RESET_NEWSRC },
  282     { txt_help_empty_line, NOT_ASSIGNED },
  283     { txt_help_global_version, GLOBAL_VERSION },
  284     { txt_help_bug_report, GLOBAL_BUGREPORT },
  285     { NULL, NOT_ASSIGNED }
  286 };
  287 
  288 static t_help_page group_help_page[] = {
  289     { txt_help_title_navi, NOT_ASSIGNED },
  290     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  291     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  292     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  293     { txt_help_global_line_up, GLOBAL_LINE_UP },
  294     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
  295     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
  296     { txt_help_empty_line, NOT_ASSIGNED },
  297     { txt_help_group_first_thread, GLOBAL_FIRST_PAGE },
  298     { txt_help_group_last_thread, GLOBAL_LAST_PAGE },
  299     { txt_help_group_thread_by_num, NOT_ASSIGNED },
  300     { txt_help_select_goto_group, GROUP_GOTO },
  301     { txt_help_group_next, GROUP_NEXT_GROUP },
  302     { txt_help_group_prev, GROUP_PREVIOUS_GROUP },
  303     { txt_help_article_next_unread, GROUP_NEXT_UNREAD_ARTICLE },
  304     { txt_help_article_prev_unread, GROUP_PREVIOUS_UNREAD_ARTICLE },
  305     { txt_help_global_last_art, GLOBAL_LAST_VIEWED },
  306     { txt_help_global_lookup_art, GLOBAL_LOOKUP_MESSAGEID },
  307     { txt_help_group_list_thread, GROUP_LIST_THREAD },
  308     { txt_help_empty_line, NOT_ASSIGNED },
  309     { txt_help_global_search_subj_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  310     { txt_help_global_search_subj_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  311     { txt_help_global_search_auth_forwards, GLOBAL_SEARCH_AUTHOR_FORWARD },
  312     { txt_help_global_search_auth_backwards, GLOBAL_SEARCH_AUTHOR_BACKWARD },
  313     { txt_help_global_search_body, GLOBAL_SEARCH_BODY },
  314     { txt_help_global_search_body_comment, NOT_ASSIGNED },
  315     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  316     { txt_help_empty_line, NOT_ASSIGNED },
  317     { txt_help_title_disp, NOT_ASSIGNED },
  318     { txt_help_group_toggle_read_articles, GROUP_TOGGLE_READ_UNREAD },
  319     { txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
  320     { txt_help_select_toggle_descriptions, SELECT_TOGGLE_DESCRIPTIONS },
  321     { txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
  322 #ifdef HAVE_COLOR
  323     { txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
  324 #endif /* HAVE_COLOR */
  325     { txt_help_empty_line, NOT_ASSIGNED },
  326     { txt_help_global_toggle_subj_display, GROUP_TOGGLE_SUBJECT_DISPLAY},
  327     { txt_help_group_toggle_threading, GROUP_TOGGLE_THREADING },
  328     { txt_help_group_mark_unsel_art_read, GROUP_MARK_UNSELECTED_ARTICLES_READ },
  329     { txt_help_group_toggle_getart_limit, GROUP_TOGGLE_GET_ARTICLES_LIMIT },
  330     { txt_help_empty_line, NOT_ASSIGNED },
  331     { txt_help_title_ops, NOT_ASSIGNED },
  332     { txt_help_thread_read_article, GROUP_READ_BASENOTE },
  333     { txt_help_article_next_unread, GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP },
  334 #ifndef NO_POSTING
  335     { txt_help_global_post, GLOBAL_POST },
  336     { txt_help_global_post_postponed, GLOBAL_POSTPONED },
  337     { txt_help_article_repost, GROUP_REPOST },
  338     { txt_help_article_cancel, GROUP_CANCEL },
  339 #endif /* NO_POSTING */
  340     { txt_help_empty_line, NOT_ASSIGNED },
  341     { txt_help_global_article_range, GLOBAL_SET_RANGE },
  342     { txt_help_empty_line, NOT_ASSIGNED },
  343     { txt_help_global_mail, GROUP_MAIL },
  344     { txt_help_global_save, GROUP_SAVE },
  345     { txt_help_global_auto_save, GROUP_AUTOSAVE },
  346 #ifndef DONT_HAVE_PIPING
  347     { txt_help_global_pipe, GLOBAL_PIPE },
  348 #endif /* !DONT_HAVE_PIPING */
  349 #ifndef DISABLE_PRINTING
  350     { txt_help_global_print, GLOBAL_PRINT },
  351 #endif /* !DISABLE_PRINTING */
  352     { txt_help_empty_line, NOT_ASSIGNED },
  353     { txt_help_global_tag, GROUP_TAG },
  354     { txt_help_tag_parts, GROUP_TAG_PARTS },
  355     { txt_help_group_untag_thread, GROUP_UNTAG },
  356     { txt_help_empty_line, NOT_ASSIGNED },
  357     { txt_help_group_mark_thread_read, GROUP_MARK_THREAD_READ },
  358     { txt_help_group_catchup, CATCHUP },
  359     { txt_help_group_catchup_next, CATCHUP_NEXT_UNREAD },
  360     { txt_help_group_mark_article_unread, MARK_ARTICLE_UNREAD },
  361     { txt_help_group_mark_thread_unread, MARK_THREAD_UNREAD },
  362     { txt_help_mark_feed_read, MARK_FEED_READ },
  363     { txt_help_mark_feed_unread, MARK_FEED_UNREAD },
  364     { txt_help_empty_line, NOT_ASSIGNED },
  365     { txt_help_group_select_all, GROUP_DO_AUTOSELECT },
  366     { txt_help_group_select_thread, GROUP_SELECT_THREAD },
  367     { txt_help_group_select_thread_pattern, GROUP_SELECT_PATTERN },
  368     { txt_help_group_select_thread_if_unread_selected, GROUP_SELECT_THREAD_IF_UNREAD_SELECTED },
  369     { txt_help_group_toggle_thread_selection, GROUP_TOGGLE_SELECT_THREAD },
  370     { txt_help_group_reverse_thread_selection, GROUP_REVERSE_SELECTIONS },
  371     { txt_help_group_undo_thread_selection, GROUP_UNDO_SELECTIONS },
  372     { txt_help_empty_line, NOT_ASSIGNED },
  373     { txt_help_article_autoselect, GLOBAL_MENU_FILTER_SELECT },
  374     { txt_help_article_autokill, GLOBAL_MENU_FILTER_KILL },
  375     { txt_help_article_quick_select, GLOBAL_QUICK_FILTER_SELECT },
  376     { txt_help_article_quick_kill, GLOBAL_QUICK_FILTER_KILL },
  377     { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER},
  378     { txt_help_empty_line, NOT_ASSIGNED },
  379     { txt_help_title_misc, NOT_ASSIGNED },
  380     { txt_help_global_previous_menu, GLOBAL_QUIT },
  381     { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
  382     { txt_help_global_help, GLOBAL_HELP },
  383     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  384     { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
  385     { txt_help_global_esc, GLOBAL_ABORT },
  386     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  387 #ifndef NO_SHELL_ESCAPE
  388     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  389 #endif /* !NO_SHELL_ESCAPE */
  390     { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
  391     { txt_help_empty_line, NOT_ASSIGNED },
  392     { txt_help_global_version, GLOBAL_VERSION },
  393     { txt_help_bug_report, GLOBAL_BUGREPORT },
  394     { NULL, NOT_ASSIGNED }
  395 };
  396 
  397 static t_help_page thread_help_page[] = {
  398     { txt_help_title_navi, NOT_ASSIGNED },
  399     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  400     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  401     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  402     { txt_help_global_line_up, GLOBAL_LINE_UP },
  403     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
  404     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
  405     { txt_help_empty_line, NOT_ASSIGNED },
  406     { txt_help_thread_first_article, GLOBAL_FIRST_PAGE },
  407     { txt_help_thread_last_article, GLOBAL_LAST_PAGE },
  408     { txt_help_thread_article_by_num, NOT_ASSIGNED },
  409     { txt_help_global_last_art, GLOBAL_LAST_VIEWED },
  410     { txt_help_global_lookup_art, GLOBAL_LOOKUP_MESSAGEID },
  411     { txt_help_empty_line, NOT_ASSIGNED },
  412     { txt_help_global_search_subj_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  413     { txt_help_global_search_subj_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  414     { txt_help_global_search_auth_forwards, GLOBAL_SEARCH_AUTHOR_FORWARD },
  415     { txt_help_global_search_auth_backwards, GLOBAL_SEARCH_AUTHOR_BACKWARD },
  416     { txt_help_global_search_body, GLOBAL_SEARCH_BODY },
  417     { txt_help_global_search_body_comment, NOT_ASSIGNED },
  418     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  419     { txt_help_empty_line, NOT_ASSIGNED },
  420     { txt_help_title_disp, NOT_ASSIGNED },
  421     { txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
  422     { txt_help_global_toggle_subj_display, THREAD_TOGGLE_SUBJECT_DISPLAY},
  423     { txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
  424 #ifdef HAVE_COLOR
  425     { txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
  426 #endif /* HAVE_COLOR */
  427     { txt_help_empty_line, NOT_ASSIGNED },
  428     { txt_help_title_ops, NOT_ASSIGNED },
  429     { txt_help_thread_read_article, THREAD_READ_ARTICLE },
  430     { txt_help_article_next_unread, THREAD_READ_NEXT_ARTICLE_OR_THREAD },
  431 #ifndef NO_POSTING
  432     { txt_help_global_post, GLOBAL_POST },
  433     { txt_help_global_post_postponed, GLOBAL_POSTPONED },
  434     { txt_help_article_cancel, THREAD_CANCEL },
  435 #endif /* NO_POSTING */
  436     { txt_help_empty_line, NOT_ASSIGNED },
  437     { txt_help_global_article_range, GLOBAL_SET_RANGE },
  438     { txt_help_empty_line, NOT_ASSIGNED },
  439     { txt_help_global_mail, THREAD_MAIL },
  440     { txt_help_global_save, THREAD_SAVE },
  441     { txt_help_global_auto_save, THREAD_AUTOSAVE },
  442 #ifndef DONT_HAVE_PIPING
  443     { txt_help_global_pipe, GLOBAL_PIPE },
  444 #endif /* !DONT_HAVE_PIPING */
  445 #ifndef DISABLE_PRINTING
  446     { txt_help_global_print, GLOBAL_PRINT },
  447 #endif /* !DISABLE_PRINTING */
  448     { txt_help_empty_line, NOT_ASSIGNED },
  449     { txt_help_global_tag, THREAD_TAG },
  450     { txt_help_tag_parts, THREAD_TAG_PARTS },
  451     { txt_help_group_untag_thread, THREAD_UNTAG },
  452     { txt_help_empty_line, NOT_ASSIGNED },
  453     { txt_help_thread_mark_article_read, THREAD_MARK_ARTICLE_READ },
  454     { txt_help_thread_catchup, CATCHUP },
  455     { txt_help_thread_catchup_next_unread, CATCHUP_NEXT_UNREAD },
  456     { txt_help_thread_mark_article_unread, MARK_ARTICLE_UNREAD },
  457     { txt_help_thread_mark_thread_unread, MARK_THREAD_UNREAD },
  458     { txt_help_mark_feed_read, MARK_FEED_READ },
  459     { txt_help_mark_feed_unread, MARK_FEED_UNREAD },
  460     { txt_help_empty_line, NOT_ASSIGNED },
  461     { txt_help_group_select_thread, THREAD_SELECT_ARTICLE },
  462     { txt_help_group_toggle_thread_selection, THREAD_TOGGLE_ARTICLE_SELECTION },
  463     { txt_help_group_reverse_thread_selection, THREAD_REVERSE_SELECTIONS },
  464     { txt_help_group_undo_thread_selection, THREAD_UNDO_SELECTIONS },
  465     { txt_help_empty_line, NOT_ASSIGNED },
  466     { txt_help_article_autoselect, GLOBAL_MENU_FILTER_SELECT },
  467     { txt_help_article_autokill, GLOBAL_MENU_FILTER_KILL },
  468     { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER },
  469     { txt_help_empty_line, NOT_ASSIGNED },
  470     { txt_help_title_misc, NOT_ASSIGNED },
  471     { txt_help_global_previous_menu, GLOBAL_QUIT },
  472     { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
  473     { txt_help_global_help, GLOBAL_HELP },
  474     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  475     { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
  476     { txt_help_global_esc, GLOBAL_ABORT },
  477     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  478 #ifndef NO_SHELL_ESCAPE
  479     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  480 #endif /* !NO_SHELL_ESCAPE */
  481     { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
  482     { txt_help_empty_line, NOT_ASSIGNED },
  483     { txt_help_global_version, GLOBAL_VERSION },
  484     { txt_help_bug_report, GLOBAL_BUGREPORT },
  485     { NULL, NOT_ASSIGNED }
  486 };
  487 
  488 static t_help_page page_help_page[] = {
  489     { txt_help_title_navi, NOT_ASSIGNED },
  490     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  491     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  492     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  493     { txt_help_global_line_up, GLOBAL_LINE_UP },
  494     { txt_help_article_first_page, GLOBAL_FIRST_PAGE },
  495     { txt_help_article_last_page, GLOBAL_LAST_PAGE },
  496     { txt_help_empty_line, NOT_ASSIGNED },
  497     { txt_help_article_by_num, NOT_ASSIGNED },
  498     { txt_help_article_next_thread, PAGE_NEXT_THREAD },
  499     { txt_help_article_next_unread, PAGE_NEXT_UNREAD },
  500     { txt_help_article_next, PAGE_NEXT_ARTICLE },
  501     { txt_help_article_next_unread, PAGE_NEXT_UNREAD_ARTICLE },
  502     { txt_help_article_prev, PAGE_PREVIOUS_ARTICLE },
  503     { txt_help_article_prev_unread, PAGE_PREVIOUS_UNREAD_ARTICLE },
  504     { txt_help_article_first_in_thread, PAGE_TOP_THREAD },
  505     { txt_help_article_last_in_thread, PAGE_BOTTOM_THREAD },
  506     { txt_help_global_last_art, GLOBAL_LAST_VIEWED },
  507     { txt_help_group_list_thread, PAGE_LIST_THREAD },
  508     { txt_help_article_parent, PAGE_GOTO_PARENT },
  509     { txt_help_global_lookup_art, GLOBAL_LOOKUP_MESSAGEID },
  510     { txt_help_article_quit_to_select_level, PAGE_GROUP_SELECT },
  511     { txt_help_article_skip_quote, PAGE_SKIP_INCLUDED_TEXT },
  512     { txt_help_empty_line, NOT_ASSIGNED },
  513     { txt_help_article_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  514     { txt_help_article_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  515     { txt_help_global_search_auth_forwards, GLOBAL_SEARCH_AUTHOR_FORWARD },
  516     { txt_help_global_search_auth_backwards, GLOBAL_SEARCH_AUTHOR_BACKWARD },
  517     { txt_help_global_search_body, GLOBAL_SEARCH_BODY },
  518     { txt_help_global_search_body_comment, NOT_ASSIGNED },
  519     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  520     { txt_help_empty_line, NOT_ASSIGNED },
  521     { txt_help_title_disp, NOT_ASSIGNED },
  522     { txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
  523     { txt_help_article_toggle_rot13, PAGE_TOGGLE_ROT13 },
  524     { txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
  525     { txt_help_article_show_raw, PAGE_TOGGLE_RAW },
  526     { txt_help_article_toggle_headers, PAGE_TOGGLE_HEADERS },
  527 #ifdef HAVE_COLOR
  528     { txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
  529 #endif /* HAVE_COLOR */
  530     { txt_help_article_toggle_highlight, PAGE_TOGGLE_HIGHLIGHTING },
  531     { txt_help_article_toggle_tex2iso, PAGE_TOGGLE_TEX2ISO },
  532     { txt_help_article_toggle_tabwidth, PAGE_TOGGLE_TABS },
  533     { txt_help_article_toggle_uue, PAGE_TOGGLE_UUE },
  534     { txt_help_article_toggle_formfeed, PAGE_REVEAL },
  535     { txt_help_empty_line, NOT_ASSIGNED },
  536     { txt_help_title_ops, NOT_ASSIGNED },
  537 #ifndef NO_POSTING
  538     { txt_help_global_post, GLOBAL_POST },
  539     { txt_help_global_post_postponed, GLOBAL_POSTPONED },
  540     { txt_help_article_followup, PAGE_FOLLOWUP_QUOTE },
  541     { txt_help_article_followup_no_quote, PAGE_FOLLOWUP },
  542     { txt_help_article_followup_with_header, PAGE_FOLLOWUP_QUOTE_HEADERS },
  543     { txt_help_article_repost, PAGE_REPOST },
  544     { txt_help_article_cancel, PAGE_CANCEL },
  545 #endif /* NO_POSTING */
  546     { txt_help_article_reply, PAGE_REPLY_QUOTE },
  547     { txt_help_article_reply_no_quote, PAGE_REPLY },
  548     { txt_help_article_reply_with_header, PAGE_REPLY_QUOTE_HEADERS },
  549     { txt_help_article_edit, PAGE_EDIT_ARTICLE },
  550     { txt_help_empty_line, NOT_ASSIGNED },
  551     { txt_help_global_mail, PAGE_MAIL },
  552     { txt_help_global_save, PAGE_SAVE },
  553     { txt_help_global_auto_save, PAGE_AUTOSAVE },
  554 #ifndef DONT_HAVE_PIPING
  555     { txt_help_global_pipe, GLOBAL_PIPE },
  556 #endif /* !DONT_HAVE_PIPING */
  557 #ifndef DISABLE_PRINTING
  558     { txt_help_global_print, GLOBAL_PRINT },
  559 #endif /* !DISABLE_PRINTING */
  560     { txt_help_article_view_attachments, PAGE_VIEW_ATTACHMENTS },
  561     { txt_help_empty_line, NOT_ASSIGNED },
  562     { txt_help_global_tag, PAGE_TAG },
  563     { txt_help_empty_line, NOT_ASSIGNED },
  564     { txt_help_article_mark_thread_read, PAGE_MARK_THREAD_READ },
  565     { txt_help_thread_catchup, CATCHUP },
  566     { txt_help_thread_catchup_next_unread, CATCHUP_NEXT_UNREAD },
  567     { txt_help_group_mark_article_unread, MARK_ARTICLE_UNREAD },
  568     { txt_help_thread_mark_thread_unread, MARK_THREAD_UNREAD },
  569     { txt_help_empty_line, NOT_ASSIGNED },
  570     { txt_help_article_autoselect, GLOBAL_MENU_FILTER_SELECT },
  571     { txt_help_article_autokill, GLOBAL_MENU_FILTER_KILL },
  572     { txt_help_article_quick_select, GLOBAL_QUICK_FILTER_SELECT },
  573     { txt_help_article_quick_kill, GLOBAL_QUICK_FILTER_KILL },
  574     { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER },
  575     { txt_help_empty_line, NOT_ASSIGNED },
  576     { txt_help_title_misc, NOT_ASSIGNED },
  577     { txt_help_article_browse_urls, PAGE_VIEW_URL },
  578     { txt_help_global_previous_menu, GLOBAL_QUIT },
  579     { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
  580     { txt_help_global_help, GLOBAL_HELP },
  581     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  582     { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
  583     { txt_help_global_esc, GLOBAL_ABORT },
  584     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  585 #ifndef NO_SHELL_ESCAPE
  586     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  587 #endif /* !NO_SHELL_ESCAPE */
  588     { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
  589 #ifdef HAVE_PGP_GPG
  590     { txt_help_empty_line, NOT_ASSIGNED },
  591     { txt_help_article_pgp, PAGE_PGP_CHECK_ARTICLE },
  592 #endif /* HAVE_PGP_GPG */
  593     { txt_help_empty_line, NOT_ASSIGNED },
  594     { txt_help_global_version, GLOBAL_VERSION },
  595     { NULL, NOT_ASSIGNED }
  596 };
  597 
  598 static t_help_page post_hist_help_page[] = {
  599     { txt_help_title_navi, NOT_ASSIGNED },
  600     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  601     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  602     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  603     { txt_help_global_line_up, GLOBAL_LINE_UP },
  604     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
  605     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
  606     { txt_help_empty_line, NOT_ASSIGNED },
  607     { txt_help_thread_first_article, GLOBAL_FIRST_PAGE },
  608     { txt_help_thread_last_article, GLOBAL_LAST_PAGE },
  609     { txt_help_thread_article_by_num, NOT_ASSIGNED },
  610     { txt_help_empty_line, NOT_ASSIGNED },
  611     { txt_help_post_hist_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  612     { txt_help_post_hist_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  613     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  614     { txt_help_empty_line, NOT_ASSIGNED },
  615     { txt_help_title_post_hist_ops, NOT_ASSIGNED },
  616     { txt_help_post_hist_select, POSTED_SELECT },
  617     { txt_help_empty_line, NOT_ASSIGNED },
  618     { txt_help_title_disp, NOT_ASSIGNED },
  619     { txt_help_post_hist_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
  620     { txt_help_empty_line, NOT_ASSIGNED },
  621     { txt_help_title_misc, NOT_ASSIGNED },
  622     { txt_help_select_quit, GLOBAL_QUIT },
  623     { txt_help_global_help, GLOBAL_HELP },
  624     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  625     { txt_help_global_esc, GLOBAL_ABORT },
  626     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  627 #ifndef NO_SHELL_ESCAPE
  628     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  629 #endif /* !NO_SHELL_ESCAPE */
  630     { NULL, NOT_ASSIGNED }
  631 };
  632 
  633 static t_help_page url_help_page[] = {
  634     { txt_help_title_navi, NOT_ASSIGNED },
  635     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  636     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  637     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  638     { txt_help_global_line_up, GLOBAL_LINE_UP },
  639     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
  640     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
  641     { txt_help_empty_line, NOT_ASSIGNED },
  642     { txt_help_url_first_url, GLOBAL_FIRST_PAGE },
  643     { txt_help_url_last_url, GLOBAL_LAST_PAGE },
  644     { txt_help_url_goto_url, NOT_ASSIGNED },
  645     { txt_help_empty_line, NOT_ASSIGNED },
  646     { txt_help_title_url_ops, NOT_ASSIGNED },
  647     { txt_help_url_select, URL_SELECT },
  648     { txt_help_empty_line, NOT_ASSIGNED },
  649     { txt_help_url_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  650     { txt_help_url_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  651     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  652     { txt_help_empty_line, NOT_ASSIGNED },
  653     { txt_help_title_disp, NOT_ASSIGNED },
  654     { txt_help_url_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
  655     { txt_help_empty_line, NOT_ASSIGNED },
  656     { txt_help_title_misc, NOT_ASSIGNED },
  657     { txt_help_select_quit, GLOBAL_QUIT },
  658     { txt_help_global_help, GLOBAL_HELP },
  659     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  660     { txt_help_global_esc, GLOBAL_ABORT },
  661     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  662 #ifndef NO_SHELL_ESCAPE
  663     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  664 #endif /* !NO_SHELL_ESCAPE */
  665     { NULL, NOT_ASSIGNED }
  666 };
  667 
  668 
  669 static void
  670 make_help_page(
  671     FILE *fp,
  672     const t_help_page *helppage,
  673     const struct keylist keys)
  674 {
  675     char *buf;
  676     char *last;
  677     char key[MAXKEYLEN];
  678     /*
  679      * length is only needed to pass it to expand_ctrl_chars()
  680      * we have no need for the value
  681      */
  682     size_t length;
  683     size_t i;
  684 
  685     if (!helppage)
  686         return;
  687 
  688     buf = my_malloc(LEN);
  689     last = my_malloc(LEN);
  690 
  691     last[0] = '\0';
  692 
  693     while (helppage->helptext) {
  694         if (helppage->func == NOT_ASSIGNED) {
  695             /*
  696              * as expand_ctrl_chars() may has shrunk buf
  697              * make sure buf is large enough to contain the helpline
  698              */
  699             buf = my_realloc(buf, LEN);
  700 
  701             if (!strlen(helppage->helptext))    /* avoid translation of empty strings */
  702                 strcpy(buf, "\n");
  703             else
  704                 strncpy(buf, _(helppage->helptext), LEN);
  705             buf[LEN - 1] = '\0';
  706             expand_ctrl_chars(&buf, &length, 8);
  707             fprintf(fp, "%s\n", buf);
  708         } else {
  709             for (i = 0; i < keys.used; i++) {
  710                 if (keys.list[i].function == helppage->func && keys.list[i].key) {
  711                     buf = my_realloc(buf, LEN);
  712 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
  713                     snprintf(buf, LEN, "%s\t  %s", printascii(key, (wint_t) keys.list[i].key), _(helppage->helptext));
  714 #else
  715                     snprintf(buf, LEN, "%s\t  %s", printascii(key, keys.list[i].key), _(helppage->helptext));
  716 #endif /* MULTIBYTE_ABLE &&! NO_LOCALE*/
  717                     expand_ctrl_chars(&buf, &length, 8);
  718                     if (strcmp(last, buf)) {
  719                         fprintf(fp, "%s\n", buf);
  720                         strncpy(last, buf, LEN - 1);
  721                     }
  722                 }
  723             }
  724         }
  725         helppage++;
  726     }
  727 
  728     free(buf);
  729     free(last);
  730 }
  731 
  732 
  733 void
  734 show_help_page(
  735     const int level,
  736     const char *title)
  737 {
  738     FILE *fp;
  739 
  740     if (!(fp = tmpfile()))
  741         return;
  742 
  743     switch (level) {
  744         case ATTACHMENT_LEVEL:
  745             make_help_page(fp, attachment_help_page, attachment_keys);
  746             break;
  747 
  748         case ATTRIB_LEVEL:
  749             make_help_page(fp, attrib_help_page, option_menu_keys);
  750             break;
  751 
  752         case CONFIG_LEVEL:
  753             make_help_page(fp, config_help_page, option_menu_keys);
  754             break;
  755 
  756         case SCOPE_LEVEL:
  757             make_help_page(fp, scope_help_page, scope_keys);
  758             break;
  759 
  760         case SELECT_LEVEL:
  761             make_help_page(fp, select_help_page, select_keys);
  762             break;
  763 
  764         case GROUP_LEVEL:
  765             make_help_page(fp, group_help_page, group_keys);
  766             break;
  767 
  768         case THREAD_LEVEL:
  769             make_help_page(fp, thread_help_page, thread_keys);
  770             break;
  771 
  772         case PAGE_LEVEL:
  773             make_help_page(fp, page_help_page, page_keys);
  774             break;
  775 
  776         case POSTED_LEVEL:
  777             make_help_page(fp, post_hist_help_page, post_hist_keys);
  778             break;
  779 
  780         case URL_LEVEL:
  781             make_help_page(fp, url_help_page, url_keys);
  782             break;
  783 
  784         case INFO_PAGER:
  785         default: /* should not happen */
  786             error_message(2, _(txt_error_unknown_dlevel));
  787             fclose(fp);
  788             return;
  789     }
  790 
  791     info_pager(fp, title, TRUE);
  792     fclose(fp);
  793     info_pager(NULL, NULL, TRUE); /* free mem */
  794 }
  795 
  796 
  797 void
  798 show_mini_help(
  799     int level)
  800 {
  801     char buf[LEN];
  802     char key[20][MAXKEYLEN];
  803     int line;
  804     size_t bufs;
  805 
  806     if (!tinrc.beginner_level)
  807         return;
  808 
  809     line = NOTESLINES + MINI_HELP_LINES - 2;
  810     bufs = sizeof(buf) - 1;
  811 
  812 #ifdef HAVE_COLOR
  813     fcol(tinrc.col_minihelp);
  814 #endif /* HAVE_COLOR */
  815 
  816     switch (level) {
  817         case ATTACHMENT_LEVEL:
  818             snprintf(buf, bufs, _(txt_mini_attachment_1),
  819                 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, attachment_keys),
  820                 PrintFuncKey(key[1], GLOBAL_LINE_UP, attachment_keys),
  821                 PrintFuncKey(key[2], GLOBAL_HELP, attachment_keys),
  822                 PrintFuncKey(key[3], GLOBAL_QUIT, attachment_keys));
  823             center_line(line, FALSE, buf);
  824 #ifndef DONT_HAVE_PIPING
  825             snprintf(buf, bufs, _(txt_mini_attachment_2),
  826                 PrintFuncKey(key[0], ATTACHMENT_SELECT, attachment_keys),
  827                 PrintFuncKey(key[5], ATTACHMENT_PIPE, attachment_keys),
  828                 PrintFuncKey(key[6], GLOBAL_PIPE, attachment_keys),
  829                 PrintFuncKey(key[1], ATTACHMENT_SAVE, attachment_keys),
  830                 PrintFuncKey(key[2], ATTACHMENT_TAG, attachment_keys),
  831                 PrintFuncKey(key[3], ATTACHMENT_TAG_PATTERN, attachment_keys),
  832                 PrintFuncKey(key[4], ATTACHMENT_UNTAG, attachment_keys));
  833 #else
  834             snprintf(buf, bufs, _(txt_mini_attachment_2),
  835                 PrintFuncKey(key[0], ATTACHMENT_SELECT, attachment_keys),
  836                 PrintFuncKey(key[1], ATTACHMENT_SAVE, attachment_keys),
  837                 PrintFuncKey(key[2], ATTACHMENT_TAG, attachment_keys),
  838                 PrintFuncKey(key[3], ATTACHMENT_TAG_PATTERN, attachment_keys),
  839                 PrintFuncKey(key[4], ATTACHMENT_UNTAG, attachment_keys));
  840 #endif /* !DONT_HAVE_PIPING */
  841             center_line(line + 1, FALSE, buf);
  842             snprintf(buf, bufs, _(txt_mini_attachment_3),
  843                 PrintFuncKey(key[1], ATTACHMENT_TOGGLE_TAGGED, attachment_keys),
  844                 PrintFuncKey(key[2], GLOBAL_SEARCH_SUBJECT_FORWARD, attachment_keys),
  845                 PrintFuncKey(key[3], GLOBAL_SEARCH_SUBJECT_BACKWARD, attachment_keys),
  846                 PrintFuncKey(key[4], GLOBAL_SEARCH_REPEAT, attachment_keys));
  847             center_line(line + 2, FALSE, buf);
  848             break;
  849 
  850         case SCOPE_LEVEL:
  851             snprintf(buf, bufs, _(txt_mini_scope_1),
  852                 PrintFuncKey(key[0], SCOPE_ADD, scope_keys),
  853                 PrintFuncKey(key[1], SCOPE_MOVE, scope_keys),
  854                 PrintFuncKey(key[2], SCOPE_RENAME, scope_keys),
  855                 PrintFuncKey(key[3], SCOPE_DELETE, scope_keys));
  856             center_line(line, FALSE, buf);
  857             snprintf(buf, bufs, _(txt_mini_scope_2),
  858                 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, scope_keys),
  859                 PrintFuncKey(key[1], GLOBAL_LINE_UP, scope_keys),
  860                 PrintFuncKey(key[2], GLOBAL_HELP, scope_keys),
  861                 PrintFuncKey(key[3], GLOBAL_QUIT, scope_keys));
  862             center_line(line + 1, FALSE, buf);
  863             break;
  864 
  865         case SELECT_LEVEL:
  866             snprintf(buf, bufs, _(txt_mini_select_1),
  867                 PrintFuncKey(key[0], SELECT_ENTER_NEXT_UNREAD_GROUP, select_keys),
  868                 PrintFuncKey(key[1], SELECT_GOTO, select_keys),
  869                 PrintFuncKey(key[2], GLOBAL_SEARCH_SUBJECT_FORWARD, select_keys),
  870                 PrintFuncKey(key[3], CATCHUP, select_keys));
  871             center_line(line, FALSE, buf);
  872             snprintf(buf, bufs, _(txt_mini_select_2),
  873                 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, select_keys),
  874                 PrintFuncKey(key[1], GLOBAL_LINE_UP, select_keys),
  875                 PrintFuncKey(key[2], GLOBAL_HELP, select_keys),
  876                 PrintFuncKey(key[3], SELECT_MOVE_GROUP, select_keys),
  877                 PrintFuncKey(key[4], GLOBAL_QUIT, select_keys),
  878                 PrintFuncKey(key[5], SELECT_TOGGLE_READ_DISPLAY, select_keys));
  879             center_line(line + 1, FALSE, buf);
  880             snprintf(buf, bufs, _(txt_mini_select_3),
  881                 PrintFuncKey(key[0], SELECT_SUBSCRIBE, select_keys),
  882                 PrintFuncKey(key[1], SELECT_SUBSCRIBE_PATTERN, select_keys),
  883                 PrintFuncKey(key[2], SELECT_UNSUBSCRIBE, select_keys),
  884                 PrintFuncKey(key[3], SELECT_UNSUBSCRIBE_PATTERN, select_keys),
  885                 PrintFuncKey(key[4], SELECT_YANK_ACTIVE, select_keys));
  886             center_line(line + 2, FALSE, buf);
  887             break;
  888 
  889         case GROUP_LEVEL:
  890             snprintf(buf, bufs, _(txt_mini_group_1),
  891                 PrintFuncKey(key[0], GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP, group_keys),
  892                 PrintFuncKey(key[1], GLOBAL_SEARCH_SUBJECT_FORWARD, group_keys),
  893                 PrintFuncKey(key[2], GLOBAL_MENU_FILTER_KILL, group_keys));
  894             center_line(line, FALSE, buf);
  895             snprintf(buf, bufs, _(txt_mini_group_2),
  896                 PrintFuncKey(key[0], GLOBAL_SEARCH_AUTHOR_FORWARD, group_keys),
  897                 PrintFuncKey(key[1], CATCHUP, group_keys),
  898                 PrintFuncKey(key[2], GLOBAL_LINE_DOWN, group_keys),
  899                 PrintFuncKey(key[3], GLOBAL_LINE_UP, group_keys),
  900                 PrintFuncKey(key[4], GROUP_MARK_THREAD_READ, group_keys),
  901                 PrintFuncKey(key[5], GROUP_LIST_THREAD, group_keys));
  902             center_line(line + 1, FALSE, buf);
  903 
  904 #if defined(DONT_HAVE_PIPING) && defined(DISABLE_PRINTING)
  905             snprintf(buf, bufs, _(txt_mini_group_3),
  906                 PrintFuncKey(key[3], GLOBAL_QUIT, group_keys),
  907                 PrintFuncKey(key[4], GROUP_TOGGLE_READ_UNREAD, group_keys),
  908                 PrintFuncKey(key[5], GROUP_SAVE, group_keys),
  909                 PrintFuncKey(key[6], GROUP_TAG, group_keys),
  910                 PrintFuncKey(key[7], GLOBAL_POST, group_keys));
  911 #else
  912 #   ifdef DONT_HAVE_PIPING
  913             snprintf(buf, bufs, _(txt_mini_group_3),
  914                 PrintFuncKey(key[1], GROUP_MAIL, group_keys),
  915                 PrintFuncKey(key[2], GLOBAL_PRINT, group_keys),
  916                 PrintFuncKey(key[3], GLOBAL_QUIT, group_keys),
  917                 PrintFuncKey(key[4], GROUP_TOGGLE_READ_UNREAD, group_keys),
  918                 PrintFuncKey(key[5], GROUP_SAVE, group_keys),
  919                 PrintFuncKey(key[6], GROUP_TAG, group_keys),
  920                 PrintFuncKey(key[7], GLOBAL_POST, group_keys));
  921 #   else
  922 #       ifdef DISABLE_PRINTING
  923             snprintf(buf, bufs, _(txt_mini_group_3),
  924                 PrintFuncKey(key[0], GLOBAL_PIPE, group_keys),
  925                 PrintFuncKey(key[1], GROUP_MAIL, group_keys),
  926                 PrintFuncKey(key[3], GLOBAL_QUIT, group_keys),
  927                 PrintFuncKey(key[4], GROUP_TOGGLE_READ_UNREAD, group_keys),
  928                 PrintFuncKey(key[5], GROUP_SAVE, group_keys),
  929                 PrintFuncKey(key[6], GROUP_TAG, group_keys),
  930                 PrintFuncKey(key[7], GLOBAL_POST, group_keys));
  931 #       else
  932             snprintf(buf, bufs, _(txt_mini_group_3),
  933                 PrintFuncKey(key[0], GLOBAL_PIPE, group_keys),
  934                 PrintFuncKey(key[1], GROUP_MAIL, group_keys),
  935                 PrintFuncKey(key[2], GLOBAL_PRINT, group_keys),
  936                 PrintFuncKey(key[3], GLOBAL_QUIT, group_keys),
  937                 PrintFuncKey(key[4], GROUP_TOGGLE_READ_UNREAD, group_keys),
  938                 PrintFuncKey(key[5], GROUP_SAVE, group_keys),
  939                 PrintFuncKey(key[6], GROUP_TAG, group_keys),
  940                 PrintFuncKey(key[7], GLOBAL_POST, group_keys));
  941 #       endif /* DISABLE_PRINTING */
  942 #   endif /* DONT_HAVE_PIPING */
  943 #endif /* DONT_HAVE_PIPING && DISABLE_PRINTING */
  944 
  945             center_line(line + 2, FALSE, buf);
  946             break;
  947 
  948         case THREAD_LEVEL:
  949             snprintf(buf, bufs, _(txt_mini_thread_1),
  950                 PrintFuncKey(key[0], THREAD_READ_NEXT_ARTICLE_OR_THREAD, thread_keys),
  951                 PrintFuncKey(key[1], CATCHUP, thread_keys),
  952                 PrintFuncKey(key[2], THREAD_TOGGLE_SUBJECT_DISPLAY, thread_keys));
  953             center_line(line, FALSE, buf);
  954             snprintf(buf, bufs, _(txt_mini_thread_2),
  955                 PrintFuncKey(key[0], GLOBAL_HELP, thread_keys),
  956                 PrintFuncKey(key[1], GLOBAL_LINE_DOWN, thread_keys),
  957                 PrintFuncKey(key[2], GLOBAL_LINE_UP, thread_keys),
  958                 PrintFuncKey(key[3], GLOBAL_QUIT, thread_keys),
  959                 PrintFuncKey(key[4], THREAD_TAG, thread_keys),
  960                 PrintFuncKey(key[5], MARK_ARTICLE_UNREAD, thread_keys));
  961             center_line(line + 1, FALSE, buf);
  962             break;
  963 
  964         case PAGE_LEVEL:
  965             snprintf(buf, bufs, _(txt_mini_page_1),
  966                 PrintFuncKey(key[0], PAGE_NEXT_UNREAD, page_keys),
  967                 PrintFuncKey(key[1], GLOBAL_SEARCH_SUBJECT_FORWARD, page_keys),
  968                 PrintFuncKey(key[2], GLOBAL_MENU_FILTER_KILL, page_keys));
  969             center_line(line, FALSE, buf);
  970             snprintf(buf, bufs, _(txt_mini_page_2),
  971                 PrintFuncKey(key[0], GLOBAL_SEARCH_AUTHOR_FORWARD, page_keys),
  972                 PrintFuncKey(key[1], GLOBAL_SEARCH_BODY, page_keys),
  973                 PrintFuncKey(key[2], CATCHUP, page_keys),
  974                 PrintFuncKey(key[3], PAGE_FOLLOWUP_QUOTE, page_keys),
  975                 PrintFuncKey(key[4], PAGE_MARK_THREAD_READ, page_keys));
  976             center_line(line + 1, FALSE, buf);
  977 
  978 #if defined(DONT_HAVE_PIPING) && defined(DISABLE_PRINTING)
  979             snprintf(buf, bufs, _(txt_mini_page_3),
  980                 PrintFuncKey(key[1], PAGE_MAIL, page_keys),
  981                 PrintFuncKey(key[3], GLOBAL_QUIT, page_keys),
  982                 PrintFuncKey(key[4], PAGE_REPLY_QUOTE, page_keys),
  983                 PrintFuncKey(key[5], PAGE_SAVE, page_keys),
  984                 PrintFuncKey(key[6], PAGE_TAG, page_keys),
  985                 PrintFuncKey(key[7], GLOBAL_POST, page_keys));
  986 #else
  987 #   ifdef DONT_HAVE_PIPING
  988             snprintf(buf, bufs, _(txt_mini_page_3),
  989                 PrintFuncKey(key[1], PAGE_MAIL, page_keys),
  990                 PrintFuncKey(key[2], GLOBAL_PRINT, page_keys),
  991                 PrintFuncKey(key[3], GLOBAL_QUIT, page_keys),
  992                 PrintFuncKey(key[4], PAGE_REPLY_QUOTE, page_keys),
  993                 PrintFuncKey(key[5], PAGE_SAVE, page_keys),
  994                 PrintFuncKey(key[6], PAGE_TAG, page_keys),
  995                 PrintFuncKey(key[7], GLOBAL_POST, page_keys));
  996 #   else
  997 #       ifdef DISABLE_PRINTING
  998             snprintf(buf, bufs, _(txt_mini_page_3),
  999                 PrintFuncKey(key[0], GLOBAL_PIPE, page_keys),
 1000                 PrintFuncKey(key[1], PAGE_MAIL, page_keys),
 1001                 PrintFuncKey(key[3], GLOBAL_QUIT, page_keys),
 1002                 PrintFuncKey(key[4], PAGE_REPLY_QUOTE, page_keys),
 1003                 PrintFuncKey(key[5], PAGE_SAVE, page_keys),
 1004                 PrintFuncKey(key[6], PAGE_TAG, page_keys),
 1005                 PrintFuncKey(key[7], GLOBAL_POST, page_keys));
 1006 #       else
 1007             snprintf(buf, bufs, _(txt_mini_page_3),
 1008                 PrintFuncKey(key[0], GLOBAL_PIPE, page_keys),
 1009                 PrintFuncKey(key[1], PAGE_MAIL, page_keys),
 1010                 PrintFuncKey(key[2], GLOBAL_PRINT, page_keys),
 1011                 PrintFuncKey(key[3], GLOBAL_QUIT, page_keys),
 1012                 PrintFuncKey(key[4], PAGE_REPLY_QUOTE, page_keys),
 1013                 PrintFuncKey(key[5], PAGE_SAVE, page_keys),
 1014                 PrintFuncKey(key[6], PAGE_TAG, page_keys),
 1015                 PrintFuncKey(key[7], GLOBAL_POST, page_keys));
 1016 #       endif /* DISABLE_PRINTING */
 1017 #   endif /* DONT_HAVE_PIPING */
 1018 #endif /* DONT_HAVE_PIPING && DISABLE_PRINTING */
 1019 
 1020             center_line(line + 2, FALSE, buf);
 1021             break;
 1022 
 1023         case POSTED_LEVEL:
 1024             snprintf(buf, bufs, _(txt_mini_post_hist_1),
 1025                 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, post_hist_keys),
 1026                 PrintFuncKey(key[1], GLOBAL_LINE_UP, post_hist_keys),
 1027                 PrintFuncKey(key[2], GLOBAL_HELP, post_hist_keys),
 1028                 PrintFuncKey(key[3], GLOBAL_QUIT, post_hist_keys));
 1029             center_line(line, FALSE, buf);
 1030             snprintf(buf, bufs, _(txt_mini_post_hist_2),
 1031                 PrintFuncKey(key[2], GLOBAL_SEARCH_SUBJECT_FORWARD, post_hist_keys),
 1032                 PrintFuncKey(key[3], GLOBAL_SEARCH_SUBJECT_BACKWARD, post_hist_keys),
 1033                 PrintFuncKey(key[4], GLOBAL_SEARCH_REPEAT, post_hist_keys));
 1034             center_line(line + 1, FALSE, buf);
 1035             break;
 1036 
 1037         case URL_LEVEL:
 1038             snprintf(buf, bufs, _(txt_mini_url_1),
 1039                 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, url_keys),
 1040                 PrintFuncKey(key[1], GLOBAL_LINE_UP, url_keys),
 1041                 PrintFuncKey(key[2], GLOBAL_HELP, url_keys),
 1042                 PrintFuncKey(key[3], GLOBAL_QUIT, url_keys));
 1043             center_line(line, FALSE, buf);
 1044             snprintf(buf, bufs, _(txt_mini_url_2),
 1045                 PrintFuncKey(key[2], GLOBAL_SEARCH_SUBJECT_FORWARD, url_keys),
 1046                 PrintFuncKey(key[3], GLOBAL_SEARCH_SUBJECT_BACKWARD, url_keys),
 1047                 PrintFuncKey(key[4], GLOBAL_SEARCH_REPEAT, url_keys));
 1048             center_line(line + 1, FALSE, buf);
 1049             break;
 1050 
 1051         case INFO_PAGER:
 1052             snprintf(buf, bufs, _(txt_mini_info_1),
 1053                 PrintFuncKey(key[0], GLOBAL_LINE_UP, info_keys),
 1054                 PrintFuncKey(key[1], GLOBAL_LINE_DOWN, info_keys),
 1055                 PrintFuncKey(key[2], GLOBAL_PAGE_UP, info_keys),
 1056                 PrintFuncKey(key[3], GLOBAL_PAGE_DOWN, info_keys),
 1057                 PrintFuncKey(key[4], GLOBAL_FIRST_PAGE, info_keys),
 1058                 PrintFuncKey(key[5], GLOBAL_LAST_PAGE, info_keys));
 1059             center_line(line, FALSE, buf);
 1060             snprintf(buf, bufs, _(txt_mini_info_2),
 1061                 PrintFuncKey(key[0], GLOBAL_SEARCH_SUBJECT_FORWARD, info_keys),
 1062                 PrintFuncKey(key[1], GLOBAL_SEARCH_SUBJECT_BACKWARD, info_keys),
 1063                 PrintFuncKey(key[2], GLOBAL_QUIT, info_keys));
 1064             center_line(line + 1, FALSE, buf);
 1065             break;
 1066 
 1067         default: /* should not happen */
 1068             error_message(2, _(txt_error_unknown_dlevel));
 1069             break;
 1070     }
 1071 #ifdef HAVE_COLOR
 1072     fcol(tinrc.col_normal);
 1073 #endif /* HAVE_COLOR */
 1074 }
 1075 
 1076 
 1077 void
 1078 toggle_mini_help(
 1079     int level)
 1080 {
 1081     tinrc.beginner_level = bool_not(tinrc.beginner_level);
 1082     set_noteslines(cLINES);
 1083     show_mini_help(level);
 1084 }