diff -rc pine4.64/pine/init.c pine4.64.reply/pine/init.c *** pine4.64/pine/init.c Mon Sep 12 11:53:17 2005 --- pine4.64.reply/pine/init.c Sat May 6 10:30:56 2006 *************** *** 2613,2618 **** --- 2613,2620 ---- F_STRIP_WS_BEFORE_SEND, h_config_strip_ws_before_send, PREF_COMP}, /* 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.64/pine/mailpart.c pine4.64.reply/pine/mailpart.c *** pine4.64/pine/mailpart.c Wed Apr 27 11:53:45 2005 --- pine4.64.reply/pine/mailpart.c Sat May 6 10:30:56 2006 *************** *** 3463,3469 **** /* * 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, --- 3463,3469 ---- /* * 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.64/pine/pine.h pine4.64.reply/pine/pine.h *** pine4.64/pine/pine.h Thu Sep 15 17:39:42 2005 --- pine4.64.reply/pine/pine.h Sat May 6 10:30:56 2006 *************** *** 1314,1319 **** --- 1314,1320 ---- F_MAILDROPS_PRESERVE_STATE, F_EXPOSE_HIDDEN_CONFIG, F_ALT_COMPOSE_MENU, + F_ALT_REPLY_MENU, F_ALT_ROLE_MENU, F_ALWAYS_SPELL_CHECK, F_QUELL_TIMEZONE, *************** *** 5161,5167 **** 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 **)); --- 5162,5168 ---- 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.64/pine/pine.hlp pine4.64.reply/pine/pine.hlp *** pine4.64/pine/pine.hlp Wed Sep 28 10:56:29 2005 --- pine4.64.reply/pine/pine.hlp Sat May 6 10:30:56 2006 *************** *** 26435,26440 **** --- 26435,26505 ---- <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 the associated command. For example, if you read the + text "S Strip Sig", it means that if you press the letter + "S" the signature will be stripped off the message you are + replying. Observer that the menu will change to + "S No Strip", which means that if you press "S", the + signature will not be stripped off from the message. Your choices are + activated when you press RETURN. + +

+ Another way to remember what Pine will do, is that what will be done is + exactly the opposite of what you read in the menu. + +

+ The possible options are: + +

    +
  1. A: This determines if Pine will include or not the attachments sent to + you in the message that you are replying. By default Pine will use the value + of the configuration option + include-attachments-in-reply, but + you can use this option to override such behavior in a per message basis. + +
  2. F: To decide if you want to send flowed text or not. This option appears + unless you have quelled sending flowed text. + +
  3. H: This option determines if the headers of a message are to be + included in the body of the message that is being replied. By default Pine + will use the value of the configuration option + include-header-in-reply, but + you can use this option to override such behavior in a per message basis. + +
  4. 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. + +
  5. 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. + +
+

+ <End of help on this topic> + + ====== h_config_del_from_dot ===== diff -rc pine4.64/pine/reply.c pine4.64.reply/pine/reply.c *** pine4.64/pine/reply.c Mon Sep 12 15:04:25 2005 --- pine4.64.reply/pine/reply.c Sat May 6 10:30:56 2006 *************** *** 62,67 **** --- 62,69 ---- #include "headers.h" + ACTION_S *role_chosen; + int strip, send_flowed = 1, attach, inchdr; /* *************** *** 276,282 **** 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? */ --- 278,284 ---- 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? */ *************** *** 332,343 **** goto done_early; /* Setup possible role */ ! if(role_arg) ! role = copy_action(role_arg); if(!role){ rflags = ROLE_REPLY; ! if(nonempty_patterns(rflags, &dummy)){ /* setup default role */ nrole = NULL; j = mn_first_cur(pine_state->msgmap); --- 334,347 ---- goto done_early; /* Setup possible role */ ! if (role_chosen) ! role = role_chosen; ! else if(role_arg) ! role = copy_action(role_arg); if(!role){ rflags = ROLE_REPLY; ! if(!role_chosen && nonempty_patterns(rflags, &dummy)){ /* setup default role */ nrole = NULL; j = mn_first_cur(pine_state->msgmap); *************** *** 518,524 **** if(orig_body == NULL || orig_body->type == TYPETEXT || reply_raw_body) { reply_delimiter(env, role, pc); ! if(F_ON(F_INCLUDE_HEADER, pine_state)) reply_forward_header(pine_state->mail_stream, mn_m2raw(pine_state->msgmap,msgno), NULL, env, pc, prefix); --- 522,528 ---- if(orig_body == NULL || orig_body->type == TYPETEXT || reply_raw_body) { reply_delimiter(env, role, pc); ! if(inchdr) reply_forward_header(pine_state->mail_stream, mn_m2raw(pine_state->msgmap,msgno), NULL, env, pc, prefix); *************** *** 536,542 **** && orig_body->nested.part->body.type == TYPETEXT) { /*---- First part of the message is text -----*/ reply_delimiter(env, role, pc); ! if(F_ON(F_INCLUDE_HEADER, pine_state)) reply_forward_header(pine_state->mail_stream, mn_m2raw(pine_state->msgmap, msgno), --- 540,546 ---- && orig_body->nested.part->body.type == TYPETEXT) { /*---- First part of the message is text -----*/ reply_delimiter(env, role, pc); ! if(inchdr) reply_forward_header(pine_state->mail_stream, mn_m2raw(pine_state->msgmap, msgno), *************** *** 1693,1738 **** * 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, NULL)){ --- 1697,1812 ---- * 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; ! int orig_sf; ! ! orig_sf = send_flowed = *prefix && **prefix ? (F_OFF(F_QUELL_FLOWED_TEXT, ps) ! && F_OFF(F_STRIP_WS_BEFORE_SEND, ps) ! && (strcmp(*prefix, "> ") == 0 ! || strcmp(*prefix, ">") == 0)) : 0; ! ! role_chosen = NULL; ! strip = ps->full_header == 0 ! && (F_ON(F_ENABLE_STRIP_SIGDASHES, ps) ! || F_ON(F_ENABLE_SIGDASHES, ps)); ! attach = F_ON(F_ATTACHMENTS_IN_REPLY, ps); ! inchdr = F_ON(F_INCLUDE_HEADER, 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"; ! compose_style[ekey_num++].label = strip ? "No Strip": "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(orig_sf){ ! compose_style[ekey_num].ch = 'f'; ! compose_style[ekey_num].rval = 'F'; ! compose_style[ekey_num].name = "F"; ! compose_style[ekey_num++].label = send_flowed ? "Quell Flow" ! : "Send Flowd"; ! } ! ! compose_style[ekey_num].ch = 'a'; ! compose_style[ekey_num].rval = 'A'; ! compose_style[ekey_num].name = "A"; ! compose_style[ekey_num++].label = attach ? "No Attach" ! : "Inc Attac"; ! ! compose_style[ekey_num].ch = 'h'; ! compose_style[ekey_num].rval = 'H'; ! compose_style[ekey_num].name = "H"; ! compose_style[ekey_num++].label = inchdr ? "No Header" ! : "Inc Head"; ! ! } ! 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, NULL)){ *************** *** 1740,1745 **** --- 1814,1859 ---- cmd_cancelled("Reply"); return(-1); + case 'F': + send_flowed = (send_flowed + 1) % 2; + break; + + case 'S': + strip = (strip + 1) % 2; + break; + + case 'A': + attach = (attach + 1) % 2; + break; + + case 'H': + inchdr = (inchdr + 1) % 2; + 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; + if (ps->redrawer) + (*ps->redrawer)(); + continue; + } + ps->next_screen = prev_screen; + ps->redrawer = redraw; + if(role_chosen) + role_chosen = combine_inherited_role(role_chosen); + } + if (ps->redrawer) + (*ps->redrawer)(); + break; + case 'r': if(prefix && *prefix){ int done = 0; *************** *** 1763,1770 **** if(flags & OE_USER_MODIFIED){ fs_give((void **)prefix); removing_double_quotes(*prefix = cpystr(buf)); ! edited = 1; ! } done++; break; --- 1877,1890 ---- if(flags & OE_USER_MODIFIED){ fs_give((void **)prefix); removing_double_quotes(*prefix = cpystr(buf)); ! orig_sf = *prefix && **prefix ? ! (F_OFF(F_QUELL_FLOWED_TEXT, ps) ! && F_OFF(F_STRIP_WS_BEFORE_SEND, ps) ! && (strcmp(*prefix, "> ") == 0 ! || strcmp(*prefix, ">") == 0)) : 0; ! send_flowed = orig_sf; ! edited = 1; ! } done++; break; *************** *** 1921,1933 **** if(!orig_body || orig_body->type == TYPETEXT || reply_raw_body ! || F_OFF(F_ATTACHMENTS_IN_REPLY, ps_global)){ /*------ Simple text-only message ----*/ body = mail_newbody(); body->type = TYPETEXT; body->contents.text.data = msgtext; reply_delimiter(env, role, pc); ! if(F_ON(F_INCLUDE_HEADER, ps_global)) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); --- 2041,2053 ---- if(!orig_body || orig_body->type == TYPETEXT || reply_raw_body ! || !attach){ /*------ Simple text-only message ----*/ body = mail_newbody(); body->type = TYPETEXT; body->contents.text.data = msgtext; reply_delimiter(env, role, pc); ! if(inchdr) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); *************** *** 1965,1971 **** if(reply_body_text(orig_body, &tmp_body)){ reply_delimiter(env, role, pc); ! if(F_ON(F_INCLUDE_HEADER, ps_global)) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); --- 2085,2091 ---- if(reply_body_text(orig_body, &tmp_body)){ reply_delimiter(env, role, pc); ! if(inchdr) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); *************** *** 2000,2006 **** body->nested.part->body.subtype = cpystr("Plain"); } reply_delimiter(env, role, pc); ! if(F_ON(F_INCLUDE_HEADER, ps_global)) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); --- 2120,2126 ---- body->nested.part->body.subtype = cpystr("Plain"); } reply_delimiter(env, role, pc); ! if(inchdr) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); *************** *** 2020,2026 **** int partnum; reply_delimiter(env, role, pc); ! if(F_ON(F_INCLUDE_HEADER, ps_global)) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); --- 2140,2146 ---- int partnum; reply_delimiter(env, role, pc); ! if(inchdr) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); *************** *** 4873,4879 **** * tied our hands, alter the prefix to continue flowed * formatting... */ ! if(flow_res) wrapflags |= GFW_FLOW_RESULT; filters[i].filter = gf_wrap; --- 4993,4999 ---- * tied our hands, alter the prefix to continue flowed * formatting... */ ! if(flow_res && send_flowed) wrapflags |= GFW_FLOW_RESULT; filters[i].filter = gf_wrap; *************** *** 4909,4916 **** * We also want to fold "> " quotes so we get the * attributions correct. */ ! if(flow_res && prefix && !strucmp(prefix, "> ")) *(prefix_p = prefix + 1) = '\0'; if(!(wrapflags & GFW_FLOWED) && flow_res){ filters[i].filter = gf_line_test; --- 5029,5037 ---- * We also want to fold "> " quotes so we get the * attributions correct. */ ! if(flow_res && send_flowed && prefix && !strucmp(prefix, "> ")) *(prefix_p = prefix + 1) = '\0'; + send_flowed = 1; /* reset for next call */ if(!(wrapflags & GFW_FLOWED) && flow_res){ filters[i].filter = gf_line_test; *************** *** 4938,4945 **** } 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); --- 5059,5065 ---- } if(prefix){ ! if(strip){ dashdata = 0; filters[i].filter = gf_line_test; filters[i++].data = gf_line_test_opt(sigdash_strip, &dashdata); *************** *** 6377,6379 **** --- 6497,6500 ---- free_pcolors(&pbf->colors); } } +