diff -rc pine4.42/pine/init.c pine4.42.reply/pine/init.c *** pine4.42/pine/init.c Fri Nov 16 10:54:58 2001 --- pine4.42.reply/pine/init.c Thu Nov 22 01:57:25 2001 *************** *** 2421,2426 **** --- 2421,2428 ---- /* Reply Prefs */ + {"alternate-reply-menu", + F_ALT_REPLY_MENU, h_config_alt_reply_menu, PREF_RPLY}, {"enable-reply-indent-string-editing", F_ENABLE_EDIT_REPLY_INDENT, h_config_prefix_editing, PREF_RPLY}, {"include-attachments-in-reply", diff -rc pine4.42/pine/mailpart.c pine4.42.reply/pine/mailpart.c *** pine4.42/pine/mailpart.c Tue Oct 16 16:29:28 2001 --- pine4.42.reply/pine/mailpart.c Thu Nov 22 01:57:26 2001 *************** *** 3215,3221 **** /* * For consistency, the first question is always "include text?" */ ! if((include_text = reply_text_query(ps_global, 1, &prefix)) >= 0 && reply_news_test(a->body->nested.msg->env, outgoing) > 0 && reply_harvest(ps_global, msgno, a->number, a->body->nested.msg->env, &saved_from, --- 3215,3221 ---- /* * For consistency, the first question is always "include text?" */ ! if((include_text = reply_text_query(ps_global, 1, NULL, &prefix)) >= 0 && reply_news_test(a->body->nested.msg->env, outgoing) > 0 && reply_harvest(ps_global, msgno, a->number, a->body->nested.msg->env, &saved_from, diff -rc pine4.42/pine/pine.h pine4.42.reply/pine/pine.h *** pine4.42/pine/pine.h Tue Nov 20 14:06:33 2001 --- pine4.42.reply/pine/pine.h Thu Nov 22 01:57:26 2001 *************** *** 1012,1017 **** --- 1012,1018 ---- F_DISABLE_SHARED_NAMESPACES, F_EXPOSE_HIDDEN_CONFIG, F_ALT_COMPOSE_MENU, + F_ALT_REPLY_MENU, #ifdef _WINDOWS F_ENABLE_TRAYICON, F_QUELL_SSL_LARGEBLOCKS, *************** *** 3872,3878 **** ENVELOPE *, ADDRESS **, ADDRESS **, ADDRESS **, ADDRESS **,int *)); int reply_news_test PROTO((ENVELOPE *, ENVELOPE *)); ! int reply_text_query PROTO((struct pine *, long, char **)); BODY *reply_body PROTO((MAILSTREAM *, ENVELOPE *, BODY *, long, char *, void *, char *, int, ACTION_S *, int, REDRAFT_POS_S **)); --- 3873,3879 ---- ENVELOPE *, ADDRESS **, ADDRESS **, ADDRESS **, ADDRESS **,int *)); int reply_news_test PROTO((ENVELOPE *, ENVELOPE *)); ! int reply_text_query PROTO((struct pine *, long, ENVELOPE *, char **)); BODY *reply_body PROTO((MAILSTREAM *, ENVELOPE *, BODY *, long, char *, void *, char *, int, ACTION_S *, int, REDRAFT_POS_S **)); diff -rc pine4.42/pine/pine.hlp pine4.42.reply/pine/pine.hlp *** pine4.42/pine/pine.hlp Tue Nov 20 15:59:55 2001 --- pine4.42.reply/pine/pine.hlp Thu Nov 22 01:57:28 2001 *************** *** 18648,18653 **** --- 18648,18698 ---- <End of help on this topic> + ====== h_config_alt_reply_menu ===== + + + FEATURE: alternate-reply-menu + + +

FEATURE: alternate-reply-menu

+ + This feature controls the menu that is displayed when Reply is selected. + If set, a list of options will be presented, with each option representing + the type of composition that could be used. This feature is most useful + for users who want to avoid being prompted with each option separately, or + would like to override some defaults set in your configuration for the + message that you are replying (e.g. you may have set the option to strip + signatures, but for the message you are answering you would like not to do + that) + +

+ The way this feature works is as follows. Initially you get the question + if you want to include the message, and in the menu you will see several + options, each option is accompanied by some text explaining what will + happen if you press return to continue. For example, if you read the text + "S Strip Sig", it means that if you press return the signature will be + stripped off the message you are replying, if you press "S", then the + message will change to "S No Strip", which means that if you press RETURN, + the signature will not be stripped off from the message. + +

+ The possible options are: + +

    +
  1. T : To use the reply-to field, instead of the From: field to direct your + replied message. +
  2. S : To strip the signature from a message, only available is the feature + enable-sigdashes or the + strip-from-sigdashes-on-reply option are + enabled. + +
  3. R : To set a role, if you do not want Pine to set one automatically for you + or would like to set one when you can not select any. +
+

+ <End of help on this topic> + + ====== h_config_del_from_dot ===== diff -rc pine4.42/pine/reply.c pine4.42.reply/pine/reply.c *** pine4.42/pine/reply.c Tue Nov 20 15:47:31 2001 --- pine4.42.reply/pine/reply.c Thu Nov 22 01:57:29 2001 *************** *** 62,67 **** --- 62,70 ---- #include "headers.h" + static ACTION_S *role_chosen; + static int strip; + static int use_reply_to; /* * Internal Prototypes *************** *** 268,274 **** if(!times){ /* only first time */ char *p = cpystr(prefix); ! if((include_text=reply_text_query(pine_state,totalm,&prefix)) < 0) goto done_early; /* edited prefix? */ --- 271,277 ---- if(!times){ /* only first time */ char *p = cpystr(prefix); ! if((include_text=reply_text_query(pine_state,totalm,env,&prefix)) < 0) goto done_early; /* edited prefix? */ *************** *** 331,337 **** /* Setup possible role */ rflags = ROLE_REPLY; ! if(nonempty_patterns(rflags, &dummy)){ if(!times) /* setup default role */ role = set_role_from_msg(pine_state, rflags, seq[times], NULL); --- 334,341 ---- /* Setup possible role */ rflags = ROLE_REPLY; ! role = role_chosen; ! if(!role_chosen && nonempty_patterns(rflags, &dummy)){ if(!times) /* setup default role */ role = set_role_from_msg(pine_state, rflags, seq[times], NULL); *************** *** 677,685 **** * nobody else. */ if(env->reply_to && !addr_lists_same(env->reply_to, env->from) ! && (F_ON(F_AUTO_REPLY_TO, ps_global) || ((*flags) & RSF_FORCE_REPLY_TO) ! || (ret = want_to(FRM_PMT,'y','x',NO_HELP,WT_SEQ_SENSITIVE)) == 'y')) ap = reply_cp_addr(ps, msgno, section, "reply-to", *saved_from, (ADDRESS *) NULL, env->reply_to, 1); else --- 681,690 ---- * nobody else. */ if(env->reply_to && !addr_lists_same(env->reply_to, env->from) ! && use_reply_to && (F_ON(F_AUTO_REPLY_TO, ps_global) || ((*flags) & RSF_FORCE_REPLY_TO) ! ||((use_reply_to) || ! (ret = want_to(FRM_PMT,'y','x',NO_HELP,WT_SEQ_SENSITIVE)) == 'y'))) ap = reply_cp_addr(ps, msgno, section, "reply-to", *saved_from, (ADDRESS *) NULL, env->reply_to, 1); else *************** *** 1609,1654 **** * 0 if we're NOT to include the text * -1 on cancel or error */ int ! reply_text_query(ps, many, prefix) struct pine *ps; long many; char **prefix; { int ret, edited = 0; ! static ESCKEY_S rtq_opts[] = { ! {'y', 'y', "Y", "Yes"}, ! {'n', 'n', "N", "No"}, ! {-1, 0, NULL, NULL}, /* may be overridden below */ ! {-1, 0, NULL, NULL} ! }; if(F_ON(F_AUTO_INCLUDE_IN_REPLY, ps) ! && F_OFF(F_ENABLE_EDIT_REPLY_INDENT, ps)) return(1); while(1){ ! sprintf(tmp_20k_buf, "Include %s%soriginal message%s in Reply%s%s%s? ", (many > 1L) ? comatose(many) : "", (many > 1L) ? " " : "", (many > 1L) ? "s" : "", F_ON(F_ENABLE_EDIT_REPLY_INDENT, ps) ? " (using \"" : "", F_ON(F_ENABLE_EDIT_REPLY_INDENT, ps) ? *prefix : "", F_ON(F_ENABLE_EDIT_REPLY_INDENT, ps) ? "\")" : ""); ! if(F_ON(F_ENABLE_EDIT_REPLY_INDENT, ps)){ ! rtq_opts[2].ch = ctrl('R'); ! rtq_opts[2].rval = 'r'; ! rtq_opts[2].name = "^R"; ! rtq_opts[2].label = "Edit Indent String"; } ! else ! rtq_opts[2].ch = -1; switch(ret = radio_buttons(tmp_20k_buf, ps->ttyo->screen_rows > 4 ? -FOOTER_ROWS(ps_global) : -1, ! rtq_opts, (edited || F_ON(F_AUTO_INCLUDE_IN_REPLY, ps)) ? 'y' : 'n', 'x', NO_HELP, RB_SEQ_SENSITIVE)){ --- 1614,1712 ---- * 0 if we're NOT to include the text * -1 on cancel or error */ + + #define MAX_REPLY_OPTIONS 8 + int ! reply_text_query(ps, many, env, prefix) struct pine *ps; long many; + ENVELOPE *env; char **prefix; { int ret, edited = 0; ! static ESCKEY_S compose_style[MAX_REPLY_OPTIONS]; ! int ekey_num; + role_chosen = NULL; + strip = 1; + use_reply_to = F_ON(F_AUTO_REPLY_TO, ps); + if(F_ON(F_AUTO_INCLUDE_IN_REPLY, ps) ! && F_OFF(F_ENABLE_EDIT_REPLY_INDENT, ps) && F_OFF(F_ALT_REPLY_MENU,ps)) return(1); while(1){ ! sprintf(tmp_20k_buf,"Include %s%soriginal message%s in Reply%s%s%s%s%s? ", (many > 1L) ? comatose(many) : "", (many > 1L) ? " " : "", (many > 1L) ? "s" : "", F_ON(F_ENABLE_EDIT_REPLY_INDENT, ps) ? " (using \"" : "", F_ON(F_ENABLE_EDIT_REPLY_INDENT, ps) ? *prefix : "", + role_chosen ? "\" and role \"" : "", + role_chosen ? role_chosen->nick : "", F_ON(F_ENABLE_EDIT_REPLY_INDENT, ps) ? "\")" : ""); ! ekey_num = 0; ! compose_style[ekey_num].ch = 'y'; ! compose_style[ekey_num].rval = 'y'; ! compose_style[ekey_num].name = "Y"; ! compose_style[ekey_num++].label = "Yes"; ! ! compose_style[ekey_num].ch = 'n'; ! compose_style[ekey_num].rval = 'n'; ! compose_style[ekey_num].name = "N"; ! compose_style[ekey_num++].label = "No"; ! ! if (F_ON(F_ENABLE_EDIT_REPLY_INDENT, ps)){ ! compose_style[ekey_num].ch = ctrl('R'); ! compose_style[ekey_num].rval = 'r'; ! compose_style[ekey_num].name = "^R"; ! compose_style[ekey_num++].label = "Indent Str" ; ! } ! ! ! ! /***** Alternate Reply Menu ********/ ! ! if (F_ON(F_ALT_REPLY_MENU, ps)){ ! unsigned which_help; ! ! if (F_ON(F_ENABLE_STRIP_SIGDASHES, ps) || ! F_ON(F_ENABLE_SIGDASHES, ps)){ ! compose_style[ekey_num].ch = 's'; ! compose_style[ekey_num].rval = 's'; ! compose_style[ekey_num].name = "S"; ! if (!strip) ! compose_style[ekey_num++].label = "No Strip"; ! else ! compose_style[ekey_num++].label = "Strip Sig"; ! } ! ! compose_style[ekey_num].ch = 'r'; ! compose_style[ekey_num].rval = 'R'; ! compose_style[ekey_num].name = "R"; ! compose_style[ekey_num++].label = "Set Role"; ! ! if(env && env->reply_to && !addr_lists_same(env->reply_to, env->from)){ ! compose_style[ekey_num].ch = 't'; ! compose_style[ekey_num].rval = 't'; ! compose_style[ekey_num].name = "T"; ! compose_style[ekey_num++].label = use_reply_to ? "UseRepTo" ! : "NoRepTo"; ! } } ! compose_style[ekey_num].ch = -1; ! compose_style[ekey_num].name = NULL; ! compose_style[ekey_num].label = NULL; + + /***** End Alt Reply Menu *********/ + switch(ret = radio_buttons(tmp_20k_buf, ps->ttyo->screen_rows > 4 ? -FOOTER_ROWS(ps_global) : -1, ! compose_style, (edited || F_ON(F_AUTO_INCLUDE_IN_REPLY, ps)) ? 'y' : 'n', 'x', NO_HELP, RB_SEQ_SENSITIVE)){ *************** *** 1656,1661 **** --- 1714,1753 ---- cmd_cancelled("Reply"); return(-1); + case 't': + use_reply_to = (use_reply_to + 1) % 2; + break; + + case 's': + if (F_ON(F_ENABLE_STRIP_SIGDASHES, ps) || + F_ON(F_ENABLE_SIGDASHES, ps)){ + strip = (strip + 1) % 2; + } + else + q_status_message1(SM_ORDER, 3, 4, + "Invalid rval \'%s\'", pretty_command(ret)); + break; + + case 'R': + { + void (*prev_screen)() = ps->prev_screen, + (*redraw)() = ps->redrawer; + ps->redrawer = NULL; + ps->next_screen = SCREEN_FUN_NULL; + if(role_select_screen(ps, &role_chosen, 1) < 0){ + cmd_cancelled("Reply"); + ps->next_screen = prev_screen; + ps->redrawer = redraw; + return -1; + } + ps->next_screen = prev_screen; + ps->redrawer = redraw; + if(role_chosen) + role_chosen = combine_inherited_role(role_chosen); + } + (*ps->redrawer)(); + break; + case 'r': if(prefix && *prefix){ int done = 0; *************** *** 4587,4594 **** } if(prefix){ ! if(F_ON(F_ENABLE_SIGDASHES, ps_global) || ! F_ON(F_ENABLE_STRIP_SIGDASHES, ps_global)){ dashdata = 0; filters[i].filter = gf_line_test; filters[i++].data = gf_line_test_opt(sigdash_strip, &dashdata); --- 4679,4686 ---- } if(prefix){ ! if(strip && (F_ON(F_ENABLE_SIGDASHES, ps_global) || ! F_ON(F_ENABLE_STRIP_SIGDASHES, ps_global))){ dashdata = 0; filters[i].filter = gf_line_test; filters[i++].data = gf_line_test_opt(sigdash_strip, &dashdata);