"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.4/src/help.c" (20 Nov 2019, 43973 Bytes) of package /linux/misc/tin-2.4.4.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.4.3_vs_2.4.4.

    1 /*
    2  *  Project   : tin - a Usenet reader
    3  *  Module    : help.c
    4  *  Author    : I. Lea
    5  *  Created   : 1991-04-01
    6  *  Updated   : 2018-02-02
    7  *  Notes     :
    8  *
    9  * Copyright (c) 1991-2020 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_group_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_group_untag_thread, THREAD_UNTAG },
  451     { txt_help_empty_line, NOT_ASSIGNED },
  452     { txt_help_thread_mark_article_read, THREAD_MARK_ARTICLE_READ },
  453     { txt_help_thread_catchup, CATCHUP },
  454     { txt_help_thread_catchup_next_unread, CATCHUP_NEXT_UNREAD },
  455     { txt_help_thread_mark_article_unread, MARK_ARTICLE_UNREAD },
  456     { txt_help_thread_mark_thread_unread, MARK_THREAD_UNREAD },
  457     { txt_help_mark_feed_read, MARK_FEED_READ },
  458     { txt_help_mark_feed_unread, MARK_FEED_UNREAD },
  459     { txt_help_empty_line, NOT_ASSIGNED },
  460     { txt_help_group_select_thread, THREAD_SELECT_ARTICLE },
  461     { txt_help_group_toggle_thread_selection, THREAD_TOGGLE_ARTICLE_SELECTION },
  462     { txt_help_group_reverse_thread_selection, THREAD_REVERSE_SELECTIONS },
  463     { txt_help_group_undo_thread_selection, THREAD_UNDO_SELECTIONS },
  464     { txt_help_empty_line, NOT_ASSIGNED },
  465     { txt_help_article_autoselect, GLOBAL_MENU_FILTER_SELECT },
  466     { txt_help_article_autokill, GLOBAL_MENU_FILTER_KILL },
  467     { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER },
  468     { txt_help_empty_line, NOT_ASSIGNED },
  469     { txt_help_title_misc, NOT_ASSIGNED },
  470     { txt_help_global_previous_menu, GLOBAL_QUIT },
  471     { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
  472     { txt_help_global_help, GLOBAL_HELP },
  473     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  474     { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
  475     { txt_help_global_esc, GLOBAL_ABORT },
  476     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  477 #ifndef NO_SHELL_ESCAPE
  478     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  479 #endif /* !NO_SHELL_ESCAPE */
  480     { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
  481     { txt_help_empty_line, NOT_ASSIGNED },
  482     { txt_help_global_version, GLOBAL_VERSION },
  483     { txt_help_bug_report, GLOBAL_BUGREPORT },
  484     { NULL, NOT_ASSIGNED }
  485 };
  486 
  487 static t_help_page page_help_page[] = {
  488     { txt_help_title_navi, NOT_ASSIGNED },
  489     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  490     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  491     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  492     { txt_help_global_line_up, GLOBAL_LINE_UP },
  493     { txt_help_article_first_page, GLOBAL_FIRST_PAGE },
  494     { txt_help_article_last_page, GLOBAL_LAST_PAGE },
  495     { txt_help_empty_line, NOT_ASSIGNED },
  496     { txt_help_article_by_num, NOT_ASSIGNED },
  497     { txt_help_article_next_thread, PAGE_NEXT_THREAD },
  498     { txt_help_article_next_unread, PAGE_NEXT_UNREAD },
  499     { txt_help_article_next, PAGE_NEXT_ARTICLE },
  500     { txt_help_article_next_unread, PAGE_NEXT_UNREAD_ARTICLE },
  501     { txt_help_article_prev, PAGE_PREVIOUS_ARTICLE },
  502     { txt_help_article_prev_unread, PAGE_PREVIOUS_UNREAD_ARTICLE },
  503     { txt_help_article_first_in_thread, PAGE_TOP_THREAD },
  504     { txt_help_article_last_in_thread, PAGE_BOTTOM_THREAD },
  505     { txt_help_global_last_art, GLOBAL_LAST_VIEWED },
  506     { txt_help_group_list_thread, PAGE_LIST_THREAD },
  507     { txt_help_article_parent, PAGE_GOTO_PARENT },
  508     { txt_help_global_lookup_art, GLOBAL_LOOKUP_MESSAGEID },
  509     { txt_help_article_quit_to_select_level, PAGE_GROUP_SELECT },
  510     { txt_help_article_skip_quote, PAGE_SKIP_INCLUDED_TEXT },
  511     { txt_help_empty_line, NOT_ASSIGNED },
  512     { txt_help_article_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  513     { txt_help_article_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  514     { txt_help_global_search_auth_forwards, GLOBAL_SEARCH_AUTHOR_FORWARD },
  515     { txt_help_global_search_auth_backwards, GLOBAL_SEARCH_AUTHOR_BACKWARD },
  516     { txt_help_global_search_body, GLOBAL_SEARCH_BODY },
  517     { txt_help_global_search_body_comment, NOT_ASSIGNED },
  518     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  519     { txt_help_empty_line, NOT_ASSIGNED },
  520     { txt_help_title_disp, NOT_ASSIGNED },
  521     { txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
  522     { txt_help_article_toggle_rot13, PAGE_TOGGLE_ROT13 },
  523     { txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
  524     { txt_help_article_show_raw, PAGE_TOGGLE_RAW },
  525     { txt_help_article_toggle_headers, PAGE_TOGGLE_HEADERS },
  526 #ifdef HAVE_COLOR
  527     { txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
  528 #endif /* HAVE_COLOR */
  529     { txt_help_article_toggle_highlight, PAGE_TOGGLE_HIGHLIGHTING },
  530     { txt_help_article_toggle_tex2iso, PAGE_TOGGLE_TEX2ISO },
  531     { txt_help_article_toggle_tabwidth, PAGE_TOGGLE_TABS },
  532     { txt_help_article_toggle_uue, PAGE_TOGGLE_UUE },
  533     { txt_help_article_toggle_formfeed, PAGE_REVEAL },
  534     { txt_help_empty_line, NOT_ASSIGNED },
  535     { txt_help_title_ops, NOT_ASSIGNED },
  536 #ifndef NO_POSTING
  537     { txt_help_global_post, GLOBAL_POST },
  538     { txt_help_global_post_postponed, GLOBAL_POSTPONED },
  539     { txt_help_article_followup, PAGE_FOLLOWUP_QUOTE },
  540     { txt_help_article_followup_no_quote, PAGE_FOLLOWUP },
  541     { txt_help_article_followup_with_header, PAGE_FOLLOWUP_QUOTE_HEADERS },
  542     { txt_help_article_repost, PAGE_REPOST },
  543     { txt_help_article_cancel, PAGE_CANCEL },
  544 #endif /* NO_POSTING */
  545     { txt_help_article_reply, PAGE_REPLY_QUOTE },
  546     { txt_help_article_reply_no_quote, PAGE_REPLY },
  547     { txt_help_article_reply_with_header, PAGE_REPLY_QUOTE_HEADERS },
  548     { txt_help_article_edit, PAGE_EDIT_ARTICLE },
  549     { txt_help_empty_line, NOT_ASSIGNED },
  550     { txt_help_global_mail, PAGE_MAIL },
  551     { txt_help_global_save, PAGE_SAVE },
  552     { txt_help_global_auto_save, PAGE_AUTOSAVE },
  553 #ifndef DONT_HAVE_PIPING
  554     { txt_help_global_pipe, GLOBAL_PIPE },
  555 #endif /* !DONT_HAVE_PIPING */
  556 #ifndef DISABLE_PRINTING
  557     { txt_help_global_print, GLOBAL_PRINT },
  558 #endif /* !DISABLE_PRINTING */
  559     { txt_help_article_view_attachments, PAGE_VIEW_ATTACHMENTS },
  560     { txt_help_empty_line, NOT_ASSIGNED },
  561     { txt_help_global_tag, PAGE_TAG },
  562     { txt_help_empty_line, NOT_ASSIGNED },
  563     { txt_help_article_mark_thread_read, PAGE_MARK_THREAD_READ },
  564     { txt_help_thread_catchup, CATCHUP },
  565     { txt_help_thread_catchup_next_unread, CATCHUP_NEXT_UNREAD },
  566     { txt_help_group_mark_article_unread, MARK_ARTICLE_UNREAD },
  567     { txt_help_thread_mark_thread_unread, MARK_THREAD_UNREAD },
  568     { txt_help_empty_line, NOT_ASSIGNED },
  569     { txt_help_article_autoselect, GLOBAL_MENU_FILTER_SELECT },
  570     { txt_help_article_autokill, GLOBAL_MENU_FILTER_KILL },
  571     { txt_help_article_quick_select, GLOBAL_QUICK_FILTER_SELECT },
  572     { txt_help_article_quick_kill, GLOBAL_QUICK_FILTER_KILL },
  573     { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER },
  574     { txt_help_empty_line, NOT_ASSIGNED },
  575     { txt_help_title_misc, NOT_ASSIGNED },
  576     { txt_help_article_browse_urls, PAGE_VIEW_URL },
  577     { txt_help_global_previous_menu, GLOBAL_QUIT },
  578     { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
  579     { txt_help_global_help, GLOBAL_HELP },
  580     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  581     { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
  582     { txt_help_global_esc, GLOBAL_ABORT },
  583     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  584 #ifndef NO_SHELL_ESCAPE
  585     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  586 #endif /* !NO_SHELL_ESCAPE */
  587     { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
  588 #ifdef HAVE_PGP_GPG
  589     { txt_help_empty_line, NOT_ASSIGNED },
  590     { txt_help_article_pgp, PAGE_PGP_CHECK_ARTICLE },
  591 #endif /* HAVE_PGP_GPG */
  592     { txt_help_empty_line, NOT_ASSIGNED },
  593     { txt_help_global_version, GLOBAL_VERSION },
  594     { NULL, NOT_ASSIGNED }
  595 };
  596 
  597 static t_help_page url_help_page[] = {
  598     { txt_help_title_navi, NOT_ASSIGNED },
  599     { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
  600     { txt_help_global_page_up, GLOBAL_PAGE_UP },
  601     { txt_help_global_line_down, GLOBAL_LINE_DOWN },
  602     { txt_help_global_line_up, GLOBAL_LINE_UP },
  603     { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
  604     { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
  605     { txt_help_empty_line, NOT_ASSIGNED },
  606     { txt_help_url_first_url, GLOBAL_FIRST_PAGE },
  607     { txt_help_url_last_url, GLOBAL_LAST_PAGE },
  608     { txt_help_url_goto_url, NOT_ASSIGNED },
  609     { txt_help_empty_line, NOT_ASSIGNED },
  610     { txt_help_title_url_ops, NOT_ASSIGNED },
  611     { txt_help_url_select, URL_SELECT },
  612     { txt_help_empty_line, NOT_ASSIGNED },
  613     { txt_help_url_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  614     { txt_help_url_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  615     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  616     { txt_help_empty_line, NOT_ASSIGNED },
  617     { txt_help_title_disp, NOT_ASSIGNED },
  618     { txt_help_url_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
  619     { txt_help_empty_line, NOT_ASSIGNED },
  620     { txt_help_title_misc, NOT_ASSIGNED },
  621     { txt_help_select_quit, GLOBAL_QUIT },
  622     { txt_help_global_help, GLOBAL_HELP },
  623     { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
  624     { txt_help_global_esc, GLOBAL_ABORT },
  625     { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
  626 #ifndef NO_SHELL_ESCAPE
  627     { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
  628 #endif /* !NO_SHELL_ESCAPE */
  629     { NULL, NOT_ASSIGNED }
  630 };
  631 
  632 
  633 static void
  634 make_help_page(
  635     FILE *fp,
  636     const t_help_page *helppage,
  637     const struct keylist keys)
  638 {
  639     char *buf;
  640     char *last;
  641     char key[MAXKEYLEN];
  642     /*
  643      * length is only needed to pass it to expand_ctrl_chars()
  644      * we have no need for the value
  645      */
  646     size_t length;
  647     size_t i;
  648 
  649     if (!helppage)
  650         return;
  651 
  652     buf = my_malloc(LEN);
  653     last = my_malloc(LEN);
  654 
  655     last[0] = '\0';
  656 
  657     while (helppage->helptext) {
  658         if (helppage->func == NOT_ASSIGNED) {
  659             /*
  660              * as expand_ctrl_chars() may has shrunk buf
  661              * make sure buf is large enough to contain the helpline
  662              */
  663             buf = my_realloc(buf, LEN);
  664 
  665             if (!strlen(helppage->helptext))    /* avoid translation of empty strings */
  666                 strcpy(buf, "\n");
  667             else
  668                 strncpy(buf, _(helppage->helptext), LEN);
  669             buf[LEN - 1] = '\0';
  670             expand_ctrl_chars(&buf, &length, 8);
  671             fprintf(fp, "%s\n", buf);
  672         } else {
  673             for (i = 0; i < keys.used; i++) {
  674                 if (keys.list[i].function == helppage->func && keys.list[i].key) {
  675                     buf = my_realloc(buf, LEN);
  676                     snprintf(buf, LEN, "%s\t  %s", printascii(key, keys.list[i].key), _(helppage->helptext));
  677                     expand_ctrl_chars(&buf, &length, 8);
  678                     if (strcmp(last, buf)) {
  679                         fprintf(fp, "%s\n", buf);
  680                         strncpy(last, buf, LEN - 1);
  681                     }
  682                 }
  683             }
  684         }
  685         helppage++;
  686     }
  687 
  688     free(buf);
  689     free(last);
  690 }
  691 
  692 
  693 void
  694 show_help_page(
  695     const int level,
  696     const char *title)
  697 {
  698     FILE *fp;
  699 
  700     if (!(fp = tmpfile()))
  701         return;
  702 
  703     switch (level) {
  704         case ATTACHMENT_LEVEL:
  705             make_help_page(fp, attachment_help_page, attachment_keys);
  706             break;
  707 
  708         case ATTRIB_LEVEL:
  709             make_help_page(fp, attrib_help_page, option_menu_keys);
  710             break;
  711 
  712         case CONFIG_LEVEL:
  713             make_help_page(fp, config_help_page, option_menu_keys);
  714             break;
  715 
  716         case SCOPE_LEVEL:
  717             make_help_page(fp, scope_help_page, scope_keys);
  718             break;
  719 
  720         case SELECT_LEVEL:
  721             make_help_page(fp, select_help_page, select_keys);
  722             break;
  723 
  724         case GROUP_LEVEL:
  725             make_help_page(fp, group_help_page, group_keys);
  726             break;
  727 
  728         case THREAD_LEVEL:
  729             make_help_page(fp, thread_help_page, thread_keys);
  730             break;
  731 
  732         case PAGE_LEVEL:
  733             make_help_page(fp, page_help_page, page_keys);
  734             break;
  735 
  736         case URL_LEVEL:
  737             make_help_page(fp, url_help_page, url_keys);
  738             break;
  739 
  740         case INFO_PAGER:
  741         default: /* should not happen */
  742             error_message(2, _(txt_error_unknown_dlevel));
  743             fclose(fp);
  744             return;
  745     }
  746 
  747     info_pager(fp, title, TRUE);
  748     fclose(fp);
  749     info_pager(NULL, NULL, TRUE); /* free mem */
  750 }
  751 
  752 
  753 void
  754 show_mini_help(
  755     int level)
  756 {
  757     char buf[LEN];
  758     char key[20][MAXKEYLEN];
  759     int line;
  760     size_t bufs;
  761 
  762     if (!tinrc.beginner_level)
  763         return;
  764 
  765     line = NOTESLINES + MINI_HELP_LINES - 2;
  766     bufs = sizeof(buf) - 1;
  767 
  768 #ifdef HAVE_COLOR
  769     fcol(tinrc.col_minihelp);
  770 #endif /* HAVE_COLOR */
  771 
  772     switch (level) {
  773         case ATTACHMENT_LEVEL:
  774             snprintf(buf, bufs, _(txt_mini_attachment_1),
  775                 printascii(key[0], func_to_key(GLOBAL_LINE_DOWN, attachment_keys)),
  776                 printascii(key[1], func_to_key(GLOBAL_LINE_UP, attachment_keys)),
  777                 printascii(key[2], func_to_key(GLOBAL_HELP, attachment_keys)),
  778                 printascii(key[3], func_to_key(GLOBAL_QUIT, attachment_keys)));
  779             center_line(line, FALSE, buf);
  780 #ifndef DONT_HAVE_PIPING
  781             snprintf(buf, bufs, _(txt_mini_attachment_2),
  782                 printascii(key[0], func_to_key(ATTACHMENT_SELECT, attachment_keys)),
  783                 printascii(key[5], func_to_key(ATTACHMENT_PIPE, attachment_keys)),
  784                 printascii(key[6], func_to_key(GLOBAL_PIPE, attachment_keys)),
  785                 printascii(key[1], func_to_key(ATTACHMENT_SAVE, attachment_keys)),
  786                 printascii(key[2], func_to_key(ATTACHMENT_TAG, attachment_keys)),
  787                 printascii(key[3], func_to_key(ATTACHMENT_TAG_PATTERN, attachment_keys)),
  788                 printascii(key[4], func_to_key(ATTACHMENT_UNTAG, attachment_keys)));
  789 #else
  790             snprintf(buf, bufs, _(txt_mini_attachment_2),
  791                 printascii(key[0], func_to_key(ATTACHMENT_SELECT, attachment_keys)),
  792                 printascii(key[1], func_to_key(ATTACHMENT_SAVE, attachment_keys)),
  793                 printascii(key[2], func_to_key(ATTACHMENT_TAG, attachment_keys)),
  794                 printascii(key[3], func_to_key(ATTACHMENT_TAG_PATTERN, attachment_keys)),
  795                 printascii(key[4], func_to_key(ATTACHMENT_UNTAG, attachment_keys)));
  796 #endif /* !DONT_HAVE_PIPING */
  797             center_line(line + 1, FALSE, buf);
  798             snprintf(buf, bufs, _(txt_mini_attachment_3),
  799                 printascii(key[1], func_to_key(ATTACHMENT_TOGGLE_TAGGED, attachment_keys)),
  800                 printascii(key[2], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, attachment_keys)),
  801                 printascii(key[3], func_to_key(GLOBAL_SEARCH_SUBJECT_BACKWARD, attachment_keys)),
  802                 printascii(key[4], func_to_key(GLOBAL_SEARCH_REPEAT, attachment_keys)));
  803             center_line(line + 2, FALSE, buf);
  804             break;
  805 
  806         case SCOPE_LEVEL:
  807             snprintf(buf, bufs, _(txt_mini_scope_1),
  808                 printascii(key[0], func_to_key(SCOPE_ADD, scope_keys)),
  809                 printascii(key[1], func_to_key(SCOPE_MOVE, scope_keys)),
  810                 printascii(key[2], func_to_key(SCOPE_RENAME, scope_keys)),
  811                 printascii(key[3], func_to_key(SCOPE_DELETE, scope_keys)));
  812             center_line(line, FALSE, buf);
  813             snprintf(buf, bufs, _(txt_mini_scope_2),
  814                 printascii(key[0], func_to_key(GLOBAL_LINE_DOWN, scope_keys)),
  815                 printascii(key[1], func_to_key(GLOBAL_LINE_UP, scope_keys)),
  816                 printascii(key[2], func_to_key(GLOBAL_HELP, scope_keys)),
  817                 printascii(key[3], func_to_key(GLOBAL_QUIT, scope_keys)));
  818             center_line(line + 1, FALSE, buf);
  819             break;
  820 
  821         case SELECT_LEVEL:
  822             snprintf(buf, bufs, _(txt_mini_select_1),
  823                 printascii(key[0], func_to_key(SELECT_ENTER_NEXT_UNREAD_GROUP, select_keys)),
  824                 printascii(key[1], func_to_key(SELECT_GOTO, select_keys)),
  825                 printascii(key[2], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, select_keys)),
  826                 printascii(key[3], func_to_key(CATCHUP, select_keys)));
  827             center_line(line, FALSE, buf);
  828             snprintf(buf, bufs, _(txt_mini_select_2),
  829                 printascii(key[0], func_to_key(GLOBAL_LINE_DOWN, select_keys)),
  830                 printascii(key[1], func_to_key(GLOBAL_LINE_UP, select_keys)),
  831                 printascii(key[2], func_to_key(GLOBAL_HELP, select_keys)),
  832                 printascii(key[3], func_to_key(SELECT_MOVE_GROUP, select_keys)),
  833                 printascii(key[4], func_to_key(GLOBAL_QUIT, select_keys)),
  834                 printascii(key[5], func_to_key(SELECT_TOGGLE_READ_DISPLAY, select_keys)));
  835             center_line(line + 1, FALSE, buf);
  836             snprintf(buf, bufs, _(txt_mini_select_3),
  837                 printascii(key[0], func_to_key(SELECT_SUBSCRIBE, select_keys)),
  838                 printascii(key[1], func_to_key(SELECT_SUBSCRIBE_PATTERN, select_keys)),
  839                 printascii(key[2], func_to_key(SELECT_UNSUBSCRIBE, select_keys)),
  840                 printascii(key[3], func_to_key(SELECT_UNSUBSCRIBE_PATTERN, select_keys)),
  841                 printascii(key[4], func_to_key(SELECT_YANK_ACTIVE, select_keys)));
  842             center_line(line + 2, FALSE, buf);
  843             break;
  844 
  845         case GROUP_LEVEL:
  846             snprintf(buf, bufs, _(txt_mini_group_1),
  847                 printascii(key[0], func_to_key(GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP, group_keys)),
  848                 printascii(key[1], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, group_keys)),
  849                 printascii(key[2], func_to_key(GLOBAL_MENU_FILTER_KILL, group_keys)));
  850             center_line(line, FALSE, buf);
  851             snprintf(buf, bufs, _(txt_mini_group_2),
  852                 printascii(key[0], func_to_key(GLOBAL_SEARCH_AUTHOR_FORWARD, group_keys)),
  853                 printascii(key[1], func_to_key(CATCHUP, group_keys)),
  854                 printascii(key[2], func_to_key(GLOBAL_LINE_DOWN, group_keys)),
  855                 printascii(key[3], func_to_key(GLOBAL_LINE_UP, group_keys)),
  856                 printascii(key[4], func_to_key(GROUP_MARK_THREAD_READ, group_keys)),
  857                 printascii(key[5], func_to_key(GROUP_LIST_THREAD, group_keys)));
  858             center_line(line + 1, FALSE, buf);
  859 
  860 #if defined(DONT_HAVE_PIPING) && defined(DISABLE_PRINTING)
  861             snprintf(buf, bufs, _(txt_mini_group_3),
  862                 printascii(key[3], func_to_key(GLOBAL_QUIT, group_keys)),
  863                 printascii(key[4], func_to_key(GROUP_TOGGLE_READ_UNREAD, group_keys)),
  864                 printascii(key[5], func_to_key(GROUP_SAVE, group_keys)),
  865                 printascii(key[6], func_to_key(GROUP_TAG, group_keys)),
  866                 printascii(key[7], func_to_key(GLOBAL_POST, group_keys)));
  867 #else
  868 #   ifdef DONT_HAVE_PIPING
  869             snprintf(buf, bufs, _(txt_mini_group_3),
  870                 printascii(key[1], func_to_key(GROUP_MAIL, group_keys)),
  871                 printascii(key[2], func_to_key(GLOBAL_PRINT, group_keys)),
  872                 printascii(key[3], func_to_key(GLOBAL_QUIT, group_keys)),
  873                 printascii(key[4], func_to_key(GROUP_TOGGLE_READ_UNREAD, group_keys)),
  874                 printascii(key[5], func_to_key(GROUP_SAVE, group_keys)),
  875                 printascii(key[6], func_to_key(GROUP_TAG, group_keys)),
  876                 printascii(key[7], func_to_key(GLOBAL_POST, group_keys)));
  877 #   else
  878 #       ifdef DISABLE_PRINTING
  879             snprintf(buf, bufs, _(txt_mini_group_3),
  880                 printascii(key[0], func_to_key(GLOBAL_PIPE, group_keys)),
  881                 printascii(key[1], func_to_key(GROUP_MAIL, group_keys)),
  882                 printascii(key[3], func_to_key(GLOBAL_QUIT, group_keys)),
  883                 printascii(key[4], func_to_key(GROUP_TOGGLE_READ_UNREAD, group_keys)),
  884                 printascii(key[5], func_to_key(GROUP_SAVE, group_keys)),
  885                 printascii(key[6], func_to_key(GROUP_TAG, group_keys)),
  886                 printascii(key[7], func_to_key(GLOBAL_POST, group_keys)));
  887 #       else
  888             snprintf(buf, bufs, _(txt_mini_group_3),
  889                 printascii(key[0], func_to_key(GLOBAL_PIPE, group_keys)),
  890                 printascii(key[1], func_to_key(GROUP_MAIL, group_keys)),
  891                 printascii(key[2], func_to_key(GLOBAL_PRINT, group_keys)),
  892                 printascii(key[3], func_to_key(GLOBAL_QUIT, group_keys)),
  893                 printascii(key[4], func_to_key(GROUP_TOGGLE_READ_UNREAD, group_keys)),
  894                 printascii(key[5], func_to_key(GROUP_SAVE, group_keys)),
  895                 printascii(key[6], func_to_key(GROUP_TAG, group_keys)),
  896                 printascii(key[7], func_to_key(GLOBAL_POST, group_keys)));
  897 #       endif /* DISABLE_PRINTING */
  898 #   endif /* DONT_HAVE_PIPING */
  899 #endif /* DONT_HAVE_PIPING && DISABLE_PRINTING */
  900 
  901             center_line(line + 2, FALSE, buf);
  902             break;
  903 
  904         case THREAD_LEVEL:
  905             snprintf(buf, bufs, _(txt_mini_thread_1),
  906                 printascii(key[0], func_to_key(THREAD_READ_NEXT_ARTICLE_OR_THREAD, thread_keys)),
  907                 printascii(key[1], func_to_key(CATCHUP, thread_keys)),
  908                 printascii(key[2], func_to_key(THREAD_TOGGLE_SUBJECT_DISPLAY, thread_keys)));
  909             center_line(line, FALSE, buf);
  910             snprintf(buf, bufs, _(txt_mini_thread_2),
  911                 printascii(key[0], func_to_key(GLOBAL_HELP, thread_keys)),
  912                 printascii(key[1], func_to_key(GLOBAL_LINE_DOWN, thread_keys)),
  913                 printascii(key[2], func_to_key(GLOBAL_LINE_UP, thread_keys)),
  914                 printascii(key[3], func_to_key(GLOBAL_QUIT, thread_keys)),
  915                 printascii(key[4], func_to_key(THREAD_TAG, thread_keys)),
  916                 printascii(key[5], func_to_key(MARK_ARTICLE_UNREAD, thread_keys)));
  917             center_line(line + 1, FALSE, buf);
  918             break;
  919 
  920         case PAGE_LEVEL:
  921             snprintf(buf, bufs, _(txt_mini_page_1),
  922                 printascii(key[0], func_to_key(PAGE_NEXT_UNREAD, page_keys)),
  923                 printascii(key[1], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, page_keys)),
  924                 printascii(key[2], func_to_key(GLOBAL_MENU_FILTER_KILL, page_keys)));
  925             center_line(line, FALSE, buf);
  926             snprintf(buf, bufs, _(txt_mini_page_2),
  927                 printascii(key[0], func_to_key(GLOBAL_SEARCH_AUTHOR_FORWARD, page_keys)),
  928                 printascii(key[1], func_to_key(GLOBAL_SEARCH_BODY, page_keys)),
  929                 printascii(key[2], func_to_key(CATCHUP, page_keys)),
  930                 printascii(key[3], func_to_key(PAGE_FOLLOWUP_QUOTE, page_keys)),
  931                 printascii(key[4], func_to_key(PAGE_MARK_THREAD_READ, page_keys)));
  932             center_line(line + 1, FALSE, buf);
  933 
  934 #if defined(DONT_HAVE_PIPING) && defined(DISABLE_PRINTING)
  935             snprintf(buf, bufs, _(txt_mini_page_3),
  936                 printascii(key[1], func_to_key(PAGE_MAIL, page_keys)),
  937                 printascii(key[3], func_to_key(GLOBAL_QUIT, page_keys)),
  938                 printascii(key[4], func_to_key(PAGE_REPLY_QUOTE, page_keys)),
  939                 printascii(key[5], func_to_key(PAGE_SAVE, page_keys)),
  940                 printascii(key[6], func_to_key(PAGE_TAG, page_keys)),
  941                 printascii(key[7], func_to_key(GLOBAL_POST, page_keys)));
  942 #else
  943 #   ifdef DONT_HAVE_PIPING
  944             snprintf(buf, bufs, _(txt_mini_page_3),
  945                 printascii(key[1], func_to_key(PAGE_MAIL, page_keys)),
  946                 printascii(key[2], func_to_key(GLOBAL_PRINT, page_keys)),
  947                 printascii(key[3], func_to_key(GLOBAL_QUIT, page_keys)),
  948                 printascii(key[4], func_to_key(PAGE_REPLY_QUOTE, page_keys)),
  949                 printascii(key[5], func_to_key(PAGE_SAVE, page_keys)),
  950                 printascii(key[6], func_to_key(PAGE_TAG, page_keys)),
  951                 printascii(key[7], func_to_key(GLOBAL_POST, page_keys)));
  952 #   else
  953 #       ifdef DISABLE_PRINTING
  954             snprintf(buf, bufs, _(txt_mini_page_3),
  955                 printascii(key[0], func_to_key(GLOBAL_PIPE, page_keys)),
  956                 printascii(key[1], func_to_key(PAGE_MAIL, page_keys)),
  957                 printascii(key[3], func_to_key(GLOBAL_QUIT, page_keys)),
  958                 printascii(key[4], func_to_key(PAGE_REPLY_QUOTE, page_keys)),
  959                 printascii(key[5], func_to_key(PAGE_SAVE, page_keys)),
  960                 printascii(key[6], func_to_key(PAGE_TAG, page_keys)),
  961                 printascii(key[7], func_to_key(GLOBAL_POST, page_keys)));
  962 #       else
  963             snprintf(buf, bufs, _(txt_mini_page_3),
  964                 printascii(key[0], func_to_key(GLOBAL_PIPE, page_keys)),
  965                 printascii(key[1], func_to_key(PAGE_MAIL, page_keys)),
  966                 printascii(key[2], func_to_key(GLOBAL_PRINT, page_keys)),
  967                 printascii(key[3], func_to_key(GLOBAL_QUIT, page_keys)),
  968                 printascii(key[4], func_to_key(PAGE_REPLY_QUOTE, page_keys)),
  969                 printascii(key[5], func_to_key(PAGE_SAVE, page_keys)),
  970                 printascii(key[6], func_to_key(PAGE_TAG, page_keys)),
  971                 printascii(key[7], func_to_key(GLOBAL_POST, page_keys)));
  972 #       endif /* DISABLE_PRINTING */
  973 #   endif /* DONT_HAVE_PIPING */
  974 #endif /* DONT_HAVE_PIPING && DISABLE_PRINTING */
  975 
  976             center_line(line + 2, FALSE, buf);
  977             break;
  978 
  979         case URL_LEVEL:
  980             snprintf(buf, bufs, _(txt_mini_url_1),
  981                 printascii(key[0], func_to_key(GLOBAL_LINE_DOWN, url_keys)),
  982                 printascii(key[1], func_to_key(GLOBAL_LINE_UP, url_keys)),
  983                 printascii(key[2], func_to_key(GLOBAL_HELP, url_keys)),
  984                 printascii(key[3], func_to_key(GLOBAL_QUIT, url_keys)));
  985             center_line(line, FALSE, buf);
  986             snprintf(buf, bufs, _(txt_mini_url_2),
  987                 printascii(key[2], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, url_keys)),
  988                 printascii(key[3], func_to_key(GLOBAL_SEARCH_SUBJECT_BACKWARD, url_keys)),
  989                 printascii(key[4], func_to_key(GLOBAL_SEARCH_REPEAT, url_keys)));
  990             center_line(line + 1, FALSE, buf);
  991             break;
  992 
  993         case INFO_PAGER:
  994             snprintf(buf, bufs, _(txt_mini_info_1),
  995                 printascii(key[0], func_to_key(GLOBAL_LINE_UP, info_keys)),
  996                 printascii(key[1], func_to_key(GLOBAL_LINE_DOWN, info_keys)),
  997                 printascii(key[2], func_to_key(GLOBAL_PAGE_UP, info_keys)),
  998                 printascii(key[3], func_to_key(GLOBAL_PAGE_DOWN, info_keys)),
  999                 printascii(key[4], func_to_key(GLOBAL_FIRST_PAGE, info_keys)),
 1000                 printascii(key[5], func_to_key(GLOBAL_LAST_PAGE, info_keys)));
 1001             center_line(line, FALSE, buf);
 1002             snprintf(buf, bufs, _(txt_mini_info_2),
 1003                 printascii(key[0], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, info_keys)),
 1004                 printascii(key[1], func_to_key(GLOBAL_SEARCH_SUBJECT_BACKWARD, info_keys)),
 1005                 printascii(key[2], func_to_key(GLOBAL_QUIT, info_keys)));
 1006             center_line(line + 1, FALSE, buf);
 1007             break;
 1008 
 1009         default: /* should not happen */
 1010             error_message(2, _(txt_error_unknown_dlevel));
 1011             break;
 1012     }
 1013 #ifdef HAVE_COLOR
 1014     fcol(tinrc.col_normal);
 1015 #endif /* HAVE_COLOR */
 1016 }
 1017 
 1018 
 1019 void
 1020 toggle_mini_help(
 1021     int level)
 1022 {
 1023     tinrc.beginner_level = bool_not(tinrc.beginner_level);
 1024     set_noteslines(cLINES);
 1025     show_mini_help(level);
 1026 }