"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.5/src/help.c" (1 Dec 2020, 44023 Bytes) of package /linux/misc/tin-2.4.5.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.4_vs_2.4.5.

    1 /*
    2  *  Project   : tin - a Usenet reader
    3  *  Module    : help.c
    4  *  Author    : I. Lea
    5  *  Created   : 1991-04-01
    6  *  Updated   : 2020-06-10
    7  *  Notes     :
    8  *
    9  * Copyright (c) 1991-2021 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_thread_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 url_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_url_first_url, GLOBAL_FIRST_PAGE },
  608     { txt_help_url_last_url, GLOBAL_LAST_PAGE },
  609     { txt_help_url_goto_url, NOT_ASSIGNED },
  610     { txt_help_empty_line, NOT_ASSIGNED },
  611     { txt_help_title_url_ops, NOT_ASSIGNED },
  612     { txt_help_url_select, URL_SELECT },
  613     { txt_help_empty_line, NOT_ASSIGNED },
  614     { txt_help_url_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
  615     { txt_help_url_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
  616     { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
  617     { txt_help_empty_line, NOT_ASSIGNED },
  618     { txt_help_title_disp, NOT_ASSIGNED },
  619     { txt_help_url_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 
  634 static void
  635 make_help_page(
  636     FILE *fp,
  637     const t_help_page *helppage,
  638     const struct keylist keys)
  639 {
  640     char *buf;
  641     char *last;
  642     char key[MAXKEYLEN];
  643     /*
  644      * length is only needed to pass it to expand_ctrl_chars()
  645      * we have no need for the value
  646      */
  647     size_t length;
  648     size_t i;
  649 
  650     if (!helppage)
  651         return;
  652 
  653     buf = my_malloc(LEN);
  654     last = my_malloc(LEN);
  655 
  656     last[0] = '\0';
  657 
  658     while (helppage->helptext) {
  659         if (helppage->func == NOT_ASSIGNED) {
  660             /*
  661              * as expand_ctrl_chars() may has shrunk buf
  662              * make sure buf is large enough to contain the helpline
  663              */
  664             buf = my_realloc(buf, LEN);
  665 
  666             if (!strlen(helppage->helptext))    /* avoid translation of empty strings */
  667                 strcpy(buf, "\n");
  668             else
  669                 strncpy(buf, _(helppage->helptext), LEN);
  670             buf[LEN - 1] = '\0';
  671             expand_ctrl_chars(&buf, &length, 8);
  672             fprintf(fp, "%s\n", buf);
  673         } else {
  674             for (i = 0; i < keys.used; i++) {
  675                 if (keys.list[i].function == helppage->func && keys.list[i].key) {
  676                     buf = my_realloc(buf, LEN);
  677                     snprintf(buf, LEN, "%s\t  %s", printascii(key, keys.list[i].key), _(helppage->helptext));
  678                     expand_ctrl_chars(&buf, &length, 8);
  679                     if (strcmp(last, buf)) {
  680                         fprintf(fp, "%s\n", buf);
  681                         strncpy(last, buf, LEN - 1);
  682                     }
  683                 }
  684             }
  685         }
  686         helppage++;
  687     }
  688 
  689     free(buf);
  690     free(last);
  691 }
  692 
  693 
  694 void
  695 show_help_page(
  696     const int level,
  697     const char *title)
  698 {
  699     FILE *fp;
  700 
  701     if (!(fp = tmpfile()))
  702         return;
  703 
  704     switch (level) {
  705         case ATTACHMENT_LEVEL:
  706             make_help_page(fp, attachment_help_page, attachment_keys);
  707             break;
  708 
  709         case ATTRIB_LEVEL:
  710             make_help_page(fp, attrib_help_page, option_menu_keys);
  711             break;
  712 
  713         case CONFIG_LEVEL:
  714             make_help_page(fp, config_help_page, option_menu_keys);
  715             break;
  716 
  717         case SCOPE_LEVEL:
  718             make_help_page(fp, scope_help_page, scope_keys);
  719             break;
  720 
  721         case SELECT_LEVEL:
  722             make_help_page(fp, select_help_page, select_keys);
  723             break;
  724 
  725         case GROUP_LEVEL:
  726             make_help_page(fp, group_help_page, group_keys);
  727             break;
  728 
  729         case THREAD_LEVEL:
  730             make_help_page(fp, thread_help_page, thread_keys);
  731             break;
  732 
  733         case PAGE_LEVEL:
  734             make_help_page(fp, page_help_page, page_keys);
  735             break;
  736 
  737         case URL_LEVEL:
  738             make_help_page(fp, url_help_page, url_keys);
  739             break;
  740 
  741         case INFO_PAGER:
  742         default: /* should not happen */
  743             error_message(2, _(txt_error_unknown_dlevel));
  744             fclose(fp);
  745             return;
  746     }
  747 
  748     info_pager(fp, title, TRUE);
  749     fclose(fp);
  750     info_pager(NULL, NULL, TRUE); /* free mem */
  751 }
  752 
  753 
  754 void
  755 show_mini_help(
  756     int level)
  757 {
  758     char buf[LEN];
  759     char key[20][MAXKEYLEN];
  760     int line;
  761     size_t bufs;
  762 
  763     if (!tinrc.beginner_level)
  764         return;
  765 
  766     line = NOTESLINES + MINI_HELP_LINES - 2;
  767     bufs = sizeof(buf) - 1;
  768 
  769 #ifdef HAVE_COLOR
  770     fcol(tinrc.col_minihelp);
  771 #endif /* HAVE_COLOR */
  772 
  773     switch (level) {
  774         case ATTACHMENT_LEVEL:
  775             snprintf(buf, bufs, _(txt_mini_attachment_1),
  776                 printascii(key[0], func_to_key(GLOBAL_LINE_DOWN, attachment_keys)),
  777                 printascii(key[1], func_to_key(GLOBAL_LINE_UP, attachment_keys)),
  778                 printascii(key[2], func_to_key(GLOBAL_HELP, attachment_keys)),
  779                 printascii(key[3], func_to_key(GLOBAL_QUIT, attachment_keys)));
  780             center_line(line, FALSE, buf);
  781 #ifndef DONT_HAVE_PIPING
  782             snprintf(buf, bufs, _(txt_mini_attachment_2),
  783                 printascii(key[0], func_to_key(ATTACHMENT_SELECT, attachment_keys)),
  784                 printascii(key[5], func_to_key(ATTACHMENT_PIPE, attachment_keys)),
  785                 printascii(key[6], func_to_key(GLOBAL_PIPE, attachment_keys)),
  786                 printascii(key[1], func_to_key(ATTACHMENT_SAVE, attachment_keys)),
  787                 printascii(key[2], func_to_key(ATTACHMENT_TAG, attachment_keys)),
  788                 printascii(key[3], func_to_key(ATTACHMENT_TAG_PATTERN, attachment_keys)),
  789                 printascii(key[4], func_to_key(ATTACHMENT_UNTAG, attachment_keys)));
  790 #else
  791             snprintf(buf, bufs, _(txt_mini_attachment_2),
  792                 printascii(key[0], func_to_key(ATTACHMENT_SELECT, attachment_keys)),
  793                 printascii(key[1], func_to_key(ATTACHMENT_SAVE, attachment_keys)),
  794                 printascii(key[2], func_to_key(ATTACHMENT_TAG, attachment_keys)),
  795                 printascii(key[3], func_to_key(ATTACHMENT_TAG_PATTERN, attachment_keys)),
  796                 printascii(key[4], func_to_key(ATTACHMENT_UNTAG, attachment_keys)));
  797 #endif /* !DONT_HAVE_PIPING */
  798             center_line(line + 1, FALSE, buf);
  799             snprintf(buf, bufs, _(txt_mini_attachment_3),
  800                 printascii(key[1], func_to_key(ATTACHMENT_TOGGLE_TAGGED, attachment_keys)),
  801                 printascii(key[2], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, attachment_keys)),
  802                 printascii(key[3], func_to_key(GLOBAL_SEARCH_SUBJECT_BACKWARD, attachment_keys)),
  803                 printascii(key[4], func_to_key(GLOBAL_SEARCH_REPEAT, attachment_keys)));
  804             center_line(line + 2, FALSE, buf);
  805             break;
  806 
  807         case SCOPE_LEVEL:
  808             snprintf(buf, bufs, _(txt_mini_scope_1),
  809                 printascii(key[0], func_to_key(SCOPE_ADD, scope_keys)),
  810                 printascii(key[1], func_to_key(SCOPE_MOVE, scope_keys)),
  811                 printascii(key[2], func_to_key(SCOPE_RENAME, scope_keys)),
  812                 printascii(key[3], func_to_key(SCOPE_DELETE, scope_keys)));
  813             center_line(line, FALSE, buf);
  814             snprintf(buf, bufs, _(txt_mini_scope_2),
  815                 printascii(key[0], func_to_key(GLOBAL_LINE_DOWN, scope_keys)),
  816                 printascii(key[1], func_to_key(GLOBAL_LINE_UP, scope_keys)),
  817                 printascii(key[2], func_to_key(GLOBAL_HELP, scope_keys)),
  818                 printascii(key[3], func_to_key(GLOBAL_QUIT, scope_keys)));
  819             center_line(line + 1, FALSE, buf);
  820             break;
  821 
  822         case SELECT_LEVEL:
  823             snprintf(buf, bufs, _(txt_mini_select_1),
  824                 printascii(key[0], func_to_key(SELECT_ENTER_NEXT_UNREAD_GROUP, select_keys)),
  825                 printascii(key[1], func_to_key(SELECT_GOTO, select_keys)),
  826                 printascii(key[2], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, select_keys)),
  827                 printascii(key[3], func_to_key(CATCHUP, select_keys)));
  828             center_line(line, FALSE, buf);
  829             snprintf(buf, bufs, _(txt_mini_select_2),
  830                 printascii(key[0], func_to_key(GLOBAL_LINE_DOWN, select_keys)),
  831                 printascii(key[1], func_to_key(GLOBAL_LINE_UP, select_keys)),
  832                 printascii(key[2], func_to_key(GLOBAL_HELP, select_keys)),
  833                 printascii(key[3], func_to_key(SELECT_MOVE_GROUP, select_keys)),
  834                 printascii(key[4], func_to_key(GLOBAL_QUIT, select_keys)),
  835                 printascii(key[5], func_to_key(SELECT_TOGGLE_READ_DISPLAY, select_keys)));
  836             center_line(line + 1, FALSE, buf);
  837             snprintf(buf, bufs, _(txt_mini_select_3),
  838                 printascii(key[0], func_to_key(SELECT_SUBSCRIBE, select_keys)),
  839                 printascii(key[1], func_to_key(SELECT_SUBSCRIBE_PATTERN, select_keys)),
  840                 printascii(key[2], func_to_key(SELECT_UNSUBSCRIBE, select_keys)),
  841                 printascii(key[3], func_to_key(SELECT_UNSUBSCRIBE_PATTERN, select_keys)),
  842                 printascii(key[4], func_to_key(SELECT_YANK_ACTIVE, select_keys)));
  843             center_line(line + 2, FALSE, buf);
  844             break;
  845 
  846         case GROUP_LEVEL:
  847             snprintf(buf, bufs, _(txt_mini_group_1),
  848                 printascii(key[0], func_to_key(GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP, group_keys)),
  849                 printascii(key[1], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, group_keys)),
  850                 printascii(key[2], func_to_key(GLOBAL_MENU_FILTER_KILL, group_keys)));
  851             center_line(line, FALSE, buf);
  852             snprintf(buf, bufs, _(txt_mini_group_2),
  853                 printascii(key[0], func_to_key(GLOBAL_SEARCH_AUTHOR_FORWARD, group_keys)),
  854                 printascii(key[1], func_to_key(CATCHUP, group_keys)),
  855                 printascii(key[2], func_to_key(GLOBAL_LINE_DOWN, group_keys)),
  856                 printascii(key[3], func_to_key(GLOBAL_LINE_UP, group_keys)),
  857                 printascii(key[4], func_to_key(GROUP_MARK_THREAD_READ, group_keys)),
  858                 printascii(key[5], func_to_key(GROUP_LIST_THREAD, group_keys)));
  859             center_line(line + 1, FALSE, buf);
  860 
  861 #if defined(DONT_HAVE_PIPING) && defined(DISABLE_PRINTING)
  862             snprintf(buf, bufs, _(txt_mini_group_3),
  863                 printascii(key[3], func_to_key(GLOBAL_QUIT, group_keys)),
  864                 printascii(key[4], func_to_key(GROUP_TOGGLE_READ_UNREAD, group_keys)),
  865                 printascii(key[5], func_to_key(GROUP_SAVE, group_keys)),
  866                 printascii(key[6], func_to_key(GROUP_TAG, group_keys)),
  867                 printascii(key[7], func_to_key(GLOBAL_POST, group_keys)));
  868 #else
  869 #   ifdef DONT_HAVE_PIPING
  870             snprintf(buf, bufs, _(txt_mini_group_3),
  871                 printascii(key[1], func_to_key(GROUP_MAIL, group_keys)),
  872                 printascii(key[2], func_to_key(GLOBAL_PRINT, group_keys)),
  873                 printascii(key[3], func_to_key(GLOBAL_QUIT, group_keys)),
  874                 printascii(key[4], func_to_key(GROUP_TOGGLE_READ_UNREAD, group_keys)),
  875                 printascii(key[5], func_to_key(GROUP_SAVE, group_keys)),
  876                 printascii(key[6], func_to_key(GROUP_TAG, group_keys)),
  877                 printascii(key[7], func_to_key(GLOBAL_POST, group_keys)));
  878 #   else
  879 #       ifdef DISABLE_PRINTING
  880             snprintf(buf, bufs, _(txt_mini_group_3),
  881                 printascii(key[0], func_to_key(GLOBAL_PIPE, group_keys)),
  882                 printascii(key[1], func_to_key(GROUP_MAIL, group_keys)),
  883                 printascii(key[3], func_to_key(GLOBAL_QUIT, group_keys)),
  884                 printascii(key[4], func_to_key(GROUP_TOGGLE_READ_UNREAD, group_keys)),
  885                 printascii(key[5], func_to_key(GROUP_SAVE, group_keys)),
  886                 printascii(key[6], func_to_key(GROUP_TAG, group_keys)),
  887                 printascii(key[7], func_to_key(GLOBAL_POST, group_keys)));
  888 #       else
  889             snprintf(buf, bufs, _(txt_mini_group_3),
  890                 printascii(key[0], func_to_key(GLOBAL_PIPE, group_keys)),
  891                 printascii(key[1], func_to_key(GROUP_MAIL, group_keys)),
  892                 printascii(key[2], func_to_key(GLOBAL_PRINT, group_keys)),
  893                 printascii(key[3], func_to_key(GLOBAL_QUIT, group_keys)),
  894                 printascii(key[4], func_to_key(GROUP_TOGGLE_READ_UNREAD, group_keys)),
  895                 printascii(key[5], func_to_key(GROUP_SAVE, group_keys)),
  896                 printascii(key[6], func_to_key(GROUP_TAG, group_keys)),
  897                 printascii(key[7], func_to_key(GLOBAL_POST, group_keys)));
  898 #       endif /* DISABLE_PRINTING */
  899 #   endif /* DONT_HAVE_PIPING */
  900 #endif /* DONT_HAVE_PIPING && DISABLE_PRINTING */
  901 
  902             center_line(line + 2, FALSE, buf);
  903             break;
  904 
  905         case THREAD_LEVEL:
  906             snprintf(buf, bufs, _(txt_mini_thread_1),
  907                 printascii(key[0], func_to_key(THREAD_READ_NEXT_ARTICLE_OR_THREAD, thread_keys)),
  908                 printascii(key[1], func_to_key(CATCHUP, thread_keys)),
  909                 printascii(key[2], func_to_key(THREAD_TOGGLE_SUBJECT_DISPLAY, thread_keys)));
  910             center_line(line, FALSE, buf);
  911             snprintf(buf, bufs, _(txt_mini_thread_2),
  912                 printascii(key[0], func_to_key(GLOBAL_HELP, thread_keys)),
  913                 printascii(key[1], func_to_key(GLOBAL_LINE_DOWN, thread_keys)),
  914                 printascii(key[2], func_to_key(GLOBAL_LINE_UP, thread_keys)),
  915                 printascii(key[3], func_to_key(GLOBAL_QUIT, thread_keys)),
  916                 printascii(key[4], func_to_key(THREAD_TAG, thread_keys)),
  917                 printascii(key[5], func_to_key(MARK_ARTICLE_UNREAD, thread_keys)));
  918             center_line(line + 1, FALSE, buf);
  919             break;
  920 
  921         case PAGE_LEVEL:
  922             snprintf(buf, bufs, _(txt_mini_page_1),
  923                 printascii(key[0], func_to_key(PAGE_NEXT_UNREAD, page_keys)),
  924                 printascii(key[1], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, page_keys)),
  925                 printascii(key[2], func_to_key(GLOBAL_MENU_FILTER_KILL, page_keys)));
  926             center_line(line, FALSE, buf);
  927             snprintf(buf, bufs, _(txt_mini_page_2),
  928                 printascii(key[0], func_to_key(GLOBAL_SEARCH_AUTHOR_FORWARD, page_keys)),
  929                 printascii(key[1], func_to_key(GLOBAL_SEARCH_BODY, page_keys)),
  930                 printascii(key[2], func_to_key(CATCHUP, page_keys)),
  931                 printascii(key[3], func_to_key(PAGE_FOLLOWUP_QUOTE, page_keys)),
  932                 printascii(key[4], func_to_key(PAGE_MARK_THREAD_READ, page_keys)));
  933             center_line(line + 1, FALSE, buf);
  934 
  935 #if defined(DONT_HAVE_PIPING) && defined(DISABLE_PRINTING)
  936             snprintf(buf, bufs, _(txt_mini_page_3),
  937                 printascii(key[1], func_to_key(PAGE_MAIL, page_keys)),
  938                 printascii(key[3], func_to_key(GLOBAL_QUIT, page_keys)),
  939                 printascii(key[4], func_to_key(PAGE_REPLY_QUOTE, page_keys)),
  940                 printascii(key[5], func_to_key(PAGE_SAVE, page_keys)),
  941                 printascii(key[6], func_to_key(PAGE_TAG, page_keys)),
  942                 printascii(key[7], func_to_key(GLOBAL_POST, page_keys)));
  943 #else
  944 #   ifdef DONT_HAVE_PIPING
  945             snprintf(buf, bufs, _(txt_mini_page_3),
  946                 printascii(key[1], func_to_key(PAGE_MAIL, page_keys)),
  947                 printascii(key[2], func_to_key(GLOBAL_PRINT, page_keys)),
  948                 printascii(key[3], func_to_key(GLOBAL_QUIT, page_keys)),
  949                 printascii(key[4], func_to_key(PAGE_REPLY_QUOTE, page_keys)),
  950                 printascii(key[5], func_to_key(PAGE_SAVE, page_keys)),
  951                 printascii(key[6], func_to_key(PAGE_TAG, page_keys)),
  952                 printascii(key[7], func_to_key(GLOBAL_POST, page_keys)));
  953 #   else
  954 #       ifdef DISABLE_PRINTING
  955             snprintf(buf, bufs, _(txt_mini_page_3),
  956                 printascii(key[0], func_to_key(GLOBAL_PIPE, page_keys)),
  957                 printascii(key[1], func_to_key(PAGE_MAIL, page_keys)),
  958                 printascii(key[3], func_to_key(GLOBAL_QUIT, page_keys)),
  959                 printascii(key[4], func_to_key(PAGE_REPLY_QUOTE, page_keys)),
  960                 printascii(key[5], func_to_key(PAGE_SAVE, page_keys)),
  961                 printascii(key[6], func_to_key(PAGE_TAG, page_keys)),
  962                 printascii(key[7], func_to_key(GLOBAL_POST, page_keys)));
  963 #       else
  964             snprintf(buf, bufs, _(txt_mini_page_3),
  965                 printascii(key[0], func_to_key(GLOBAL_PIPE, page_keys)),
  966                 printascii(key[1], func_to_key(PAGE_MAIL, page_keys)),
  967                 printascii(key[2], func_to_key(GLOBAL_PRINT, page_keys)),
  968                 printascii(key[3], func_to_key(GLOBAL_QUIT, page_keys)),
  969                 printascii(key[4], func_to_key(PAGE_REPLY_QUOTE, page_keys)),
  970                 printascii(key[5], func_to_key(PAGE_SAVE, page_keys)),
  971                 printascii(key[6], func_to_key(PAGE_TAG, page_keys)),
  972                 printascii(key[7], func_to_key(GLOBAL_POST, page_keys)));
  973 #       endif /* DISABLE_PRINTING */
  974 #   endif /* DONT_HAVE_PIPING */
  975 #endif /* DONT_HAVE_PIPING && DISABLE_PRINTING */
  976 
  977             center_line(line + 2, FALSE, buf);
  978             break;
  979 
  980         case URL_LEVEL:
  981             snprintf(buf, bufs, _(txt_mini_url_1),
  982                 printascii(key[0], func_to_key(GLOBAL_LINE_DOWN, url_keys)),
  983                 printascii(key[1], func_to_key(GLOBAL_LINE_UP, url_keys)),
  984                 printascii(key[2], func_to_key(GLOBAL_HELP, url_keys)),
  985                 printascii(key[3], func_to_key(GLOBAL_QUIT, url_keys)));
  986             center_line(line, FALSE, buf);
  987             snprintf(buf, bufs, _(txt_mini_url_2),
  988                 printascii(key[2], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, url_keys)),
  989                 printascii(key[3], func_to_key(GLOBAL_SEARCH_SUBJECT_BACKWARD, url_keys)),
  990                 printascii(key[4], func_to_key(GLOBAL_SEARCH_REPEAT, url_keys)));
  991             center_line(line + 1, FALSE, buf);
  992             break;
  993 
  994         case INFO_PAGER:
  995             snprintf(buf, bufs, _(txt_mini_info_1),
  996                 printascii(key[0], func_to_key(GLOBAL_LINE_UP, info_keys)),
  997                 printascii(key[1], func_to_key(GLOBAL_LINE_DOWN, info_keys)),
  998                 printascii(key[2], func_to_key(GLOBAL_PAGE_UP, info_keys)),
  999                 printascii(key[3], func_to_key(GLOBAL_PAGE_DOWN, info_keys)),
 1000                 printascii(key[4], func_to_key(GLOBAL_FIRST_PAGE, info_keys)),
 1001                 printascii(key[5], func_to_key(GLOBAL_LAST_PAGE, info_keys)));
 1002             center_line(line, FALSE, buf);
 1003             snprintf(buf, bufs, _(txt_mini_info_2),
 1004                 printascii(key[0], func_to_key(GLOBAL_SEARCH_SUBJECT_FORWARD, info_keys)),
 1005                 printascii(key[1], func_to_key(GLOBAL_SEARCH_SUBJECT_BACKWARD, info_keys)),
 1006                 printascii(key[2], func_to_key(GLOBAL_QUIT, info_keys)));
 1007             center_line(line + 1, FALSE, buf);
 1008             break;
 1009 
 1010         default: /* should not happen */
 1011             error_message(2, _(txt_error_unknown_dlevel));
 1012             break;
 1013     }
 1014 #ifdef HAVE_COLOR
 1015     fcol(tinrc.col_normal);
 1016 #endif /* HAVE_COLOR */
 1017 }
 1018 
 1019 
 1020 void
 1021 toggle_mini_help(
 1022     int level)
 1023 {
 1024     tinrc.beginner_level = bool_not(tinrc.beginner_level);
 1025     set_noteslines(cLINES);
 1026     show_mini_help(level);
 1027 }