diff options
author | Eduardo Chappa <chappa@washington.edu> | 2016-08-27 09:32:23 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2016-08-27 09:32:23 -0600 |
commit | 33dbd12738cc42efbdf0442050dd2ddfbff253e0 (patch) | |
tree | 159334ae3432bbec09b0ececf2576a4fc9d6bd1e /pith | |
parent | 0556fa1fb3098640340b10ebe045600531336581 (diff) | |
download | alpine-33dbd12738cc42efbdf0442050dd2ddfbff253e0.tar.xz |
* New configuration option Alternate Reply Menu which adds more ways
to control features and variables when you start to reply to a
message.
Diffstat (limited to 'pith')
-rw-r--r-- | pith/conf.c | 2 | ||||
-rw-r--r-- | pith/conftype.h | 1 | ||||
-rw-r--r-- | pith/pine.hlp | 89 | ||||
-rw-r--r-- | pith/reply.c | 32 | ||||
-rw-r--r-- | pith/state.h | 12 |
5 files changed, 116 insertions, 20 deletions
diff --git a/pith/conf.c b/pith/conf.c index 9868013e..82b539b5 100644 --- a/pith/conf.c +++ b/pith/conf.c @@ -2838,6 +2838,8 @@ feature_list(int index) F_ALWAYS_SPELL_CHECK, h_config_always_spell_check, PREF_COMP, 0}, /* Reply Prefs */ + {"alternate-reply-menu", NULL, + F_ALT_REPLY_MENU, h_config_alt_reply_menu, PREF_RPLY, 0}, {"copy-to-address-to-from-if-it-is-us", "Copy To Address to From if it is Us", F_COPY_TO_TO_FROM, h_config_copy_to_to_from, PREF_RPLY, 0}, {"enable-reply-indent-string-editing", NULL, diff --git a/pith/conftype.h b/pith/conftype.h index 9549e49d..2d81f2bf 100644 --- a/pith/conftype.h +++ b/pith/conftype.h @@ -508,6 +508,7 @@ typedef enum { 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, diff --git a/pith/pine.hlp b/pith/pine.hlp index 2a7159fd..7590d850 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 162 2016-08-26 16:30:49 +Alpine Commit 163 2016-08-27 09:32:18 ============= h_news ================= <HTML> <HEAD> @@ -188,6 +188,11 @@ Additions include: <LI> Unix-Alpine: Connect securely to a LDAP server on a secure port. Based on a contribution by Wang Kang. + <LI> New configuration option + <a href="h_config_alt_reply_menu"><!--#echo var="FEAT_alternate-reply-menu"--></a> + which adds more ways to control features and variables when you + start to reply to a message. + <LI> Added support for RFC 2971 - IMAP ID extension. <LI> Add configuration <A href="h_config_ignore_size"><!--#echo var="FEAT_ignore-size-changes"--></A> @@ -3744,6 +3749,7 @@ There are also additional details on <li><a href="h_config_allow_talk">FEATURE: <!--#echo var="FEAT_allow-talk"--></a> <li><a href="h_config_alt_compose_menu">FEATURE: <!--#echo var="FEAT_alternate-compose-menu"--></a> <li><a href="h_config_alt_role_menu">FEATURE: <!--#echo var="FEAT_alternate-role-menu"--></a> +<li><a href="h_config_alt_reply_menu">FEATURE: <!--#echo var="FEAT_alternate-reply-menu"--></a> <li><a href="h_config_force_low_speed">FEATURE: <!--#echo var="FEAT_assume-slow-link"--></a> <li><a href="h_config_auto_read_msgs">FEATURE: <!--#echo var="FEAT_auto-move-read-msgs"--></a> <li><a href="h_config_auto_open_unread">FEATURE: <!--#echo var="FEAT_auto-open-next-unread"--></a> @@ -29398,6 +29404,87 @@ of flowed text. <End of help on this topic> </BODY> </HTML> +====== h_config_alt_reply_menu ===== +<HTML> +<HEAD> +<TITLE>FEATURE: <!--#echo var="FEAT_alternate-reply-menu"--></TITLE> +</HEAD> +<BODY> +<H1>FEATURE: <!--#echo var="FEAT_alternate-reply-menu"--></H1> + +Note that if this option is enabled, then the option +<A HREF="h_config_auto_include_reply"><!--#echo var="FEAT_include-text-in-reply"--></A> +is ignored. See below to understand why. +<P> +When you reply to a message, a series of questions are asked that +determines how your reply will be handled by Alpine. This feature only +affects the result of the first question you are asked, and its purpose is +to set values that could override defaults set in Alpine's main +configuration screen. As a result, this menu allows you to configure even +more features than you would be able to do without this option. For +example, this menu always allows you to override or select a <A +HREF="h_rules_roles">Role</A> if you have defined one, or allows you to +override your indent string, regardless of if you have enabled +<A HREF="h_config_prefix_editing"><!--#echo var="FEAT_enable-reply-indent-string-editing"--></A>. +The full list of options can be found below. +<P> +Here is an example of how this option works. After you press Reply, +if you see "A Inc Attach" in the menu, it means that +if you press "A", then Alpine will include the attachments +of the original message, and the default is not to include them. +Conversely, if you see "A No Attach" +then by pressing "A" Alpine will not include +attachments in your reply, and the default is that Alpine will +include them in your reply. The value that you see when you +start your reply is controlled by the option +<A HREF="h_config_attach_in_reply"> +<!--#echo var="FEAT_include-attachments-in-reply"--> +</A>. If the feature is enabled, then Alpine will display +"A No Attach" to override the default behavior. You can +toggle between the two values of this option by pressing "A". +Remember that the value that you see in the menu is the action that will +be done when you press the associated command. +<P> +Below are your options: +<OL> +<LI><B>A</B>: This determines if Alpine will include or not the +attachments sent to you in the message that you are replying to. The default +is to use the value of the configuration option +<A HREF="h_config_attach_in_reply"><!--#echo var="FEAT_include-attachments-in-reply"--></A> and can be overriden by using this command. + +<LI><B>H</B>: This command determines if the headers of a message are +included in the body of the message that is being replied to. By default +Alpine will use the value of the configuration option +<A HREF="h_config_include_header"><!--#echo var="FEAT_include-header-in-reply"--></A>. +Observe that by toggling this option to include headers, text will be toggled +to be included by default. + +<LI><B>R</B>: Can be used to set a role different from the default. + +<LI><B>S</B>: Determines if Alpine will strip the signature from a +message. The default is to strip the signature when the message is not +viewed in headers mode, and you either have enabled +<A HREF="h_config_sigdashes"><!--#echo var="FEAT_enable-sigdashes"--></A> +or +<A HREF="h_config_strip_sigdashes"><!--#echo var="FEAT_strip-from-sigdashes-on-reply"--></A>. + +<LI><B>Ctrl-R</B>: Can be used to edit the +<A HREF="h_config_reply_indent_string">"<!--#echo var="VAR_reply-indent-string"-->"</A>. +</OL> +<P> +In order to include the text of the original message in the reply +you either need to press 'y' to include the original text, or 'n' to +exclude it from the reply. Pressing return will execute the default +action, which is to include text only if the option +<A HREF="h_config_auto_include_reply"><!--#echo var="FEAT_include-text-in-reply"--></A> +is enabled. However, notice that the default is to include text if you edit the +reply indent string or if you explicitly set through this menu that you +want headers included in the reply message. + +<P> +<End of help on this topic> +</BODY> +</HTML> ====== h_config_del_from_dot ===== <HTML> <HEAD> diff --git a/pith/reply.c b/pith/reply.c index 9361781f..fac2348b 100644 --- a/pith/reply.c +++ b/pith/reply.c @@ -135,7 +135,7 @@ reply_harvest(struct pine *ps, long int msgno, char *section, ENVELOPE *env, * nobody else. */ if(env->reply_to && !addr_lists_same(env->reply_to, env->from) - && (F_ON(F_AUTO_REPLY_TO, ps_global) + && (F_ON(F_AUTO_REPLY_TO, ps) || ((*flags) & RSF_FORCE_REPLY_TO) || (pith_opt_replyto_prompt && (*pith_opt_replyto_prompt)() == 'y'))){ rep_field = "reply-to"; @@ -408,7 +408,7 @@ reply_seed(struct pine *ps, ENVELOPE *outgoing, ENVELOPE *env, *to_tail = reply_cp_addr(ps, 0, NULL, NULL, outgoing->to, (ADDRESS *) NULL, saved_from, RCA_ALL); if(replytoall){ - if(ps->preserve){ + if(ps->reply.preserve_fields){ while(*to_tail) to_tail = &(*to_tail)->next; @@ -962,7 +962,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body, impl = 0; filtered = detoken(role, env, 0, - F_ON(F_SIG_AT_BOTTOM, ps_global) ? 1 : 0, + ps_global->reply.signature_bottom, 0, redraft_pos, &impl); if(filtered){ if(*filtered){ @@ -983,7 +983,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body, if(toplevel && (sig = reply_signature(role, env, redraft_pos, &impl)) && - F_OFF(F_SIG_AT_BOTTOM, ps_global)){ + !ps_global->reply.signature_bottom){ /* * If CURSORPOS was set explicitly in sig_file, and there was a @@ -1023,7 +1023,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body, if(!orig_body || orig_body->type == TYPETEXT || reply_raw_body - || F_OFF(F_ATTACHMENTS_IN_REPLY, ps_global)){ + || !ps_global->reply.keep_attach){ char *charset = NULL; /*------ Simple text-only message ----*/ @@ -1031,7 +1031,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body, body->type = TYPETEXT; body->contents.text.data = msgtext; reply_delimiter(env, role, pc); - if(F_ON(F_INCLUDE_HEADER, ps_global)) + if(ps_global->reply.include_header) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); @@ -1089,7 +1089,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body, if(reply_body_text(orig_body, &tmp_body)){ reply_delimiter(env, role, pc); - if(F_ON(F_INCLUDE_HEADER, ps_global)) + if(ps_global->reply.include_header) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); @@ -1127,7 +1127,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body, body->nested.part->body.subtype = cpystr("Plain"); } reply_delimiter(env, role, pc); - if(F_ON(F_INCLUDE_HEADER, ps_global)) + if(ps_global->reply.include_header) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); @@ -1150,7 +1150,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body, int partnum; reply_delimiter(env, role, pc); - if(F_ON(F_INCLUDE_HEADER, ps_global)) + if(ps_global->reply.include_header) reply_forward_header(stream, msgno, sect_prefix, env, pc, prefix); /* SECTBUFLEN = sizeof(sect_buf) */ @@ -1348,10 +1348,10 @@ reply_signature(ACTION_S *role, ENVELOPE *env, REDRAFT_POS_S **redraft_pos, int size_t l; sig = detoken(role, env, - 2, F_ON(F_SIG_AT_BOTTOM, ps_global) ? 0 : 1, 1, + 2, ps_global->reply.signature_bottom ? 0 : 1, 1, redraft_pos, impl); - if(F_OFF(F_SIG_AT_BOTTOM, ps_global) && (!sig || !*sig)){ + if(!ps_global->reply.signature_bottom && (!sig || !*sig)){ if(sig) fs_give((void **)&sig); @@ -2701,7 +2701,7 @@ get_body_part_text(MAILSTREAM *stream, struct mail_bodystruct *body, * tied our hands, alter the prefix to continue flowed * formatting... */ - if(flow_res) + if(flow_res && ps_global->reply.use_flowed) wrapflags |= GFW_FLOW_RESULT; filters[filtcnt].filter = gf_wrap; @@ -2737,9 +2737,9 @@ get_body_part_text(MAILSTREAM *stream, struct mail_bodystruct *body, * We also want to fold "> " quotes so we get the * attributions correct. */ - if(flow_res && prefix && !strucmp(prefix, "> ")) + if(flow_res && ps_global->reply.use_flowed && prefix && !strucmp(prefix, "> ")) *(prefix_p = prefix + 1) = '\0'; - + ps_global->reply.use_flowed = 1; /* reset for next call */ if(!(wrapflags & GFW_FLOWED) && flow_res){ filters[filtcnt].filter = gf_line_test; @@ -2772,9 +2772,7 @@ get_body_part_text(MAILSTREAM *stream, struct mail_bodystruct *body, } if(prefix){ - if(ps_global->full_header != 2 - && (F_ON(F_ENABLE_SIGDASHES, ps_global) - || F_ON(F_ENABLE_STRIP_SIGDASHES, ps_global))){ + if(ps_global->reply.strip_signature){ dashdata = 0; filters[filtcnt].filter = gf_line_test; filters[filtcnt++].data = gf_line_test_opt(sigdash_strip, &dashdata); diff --git a/pith/state.h b/pith/state.h index f6b85d9b..3941a7f8 100644 --- a/pith/state.h +++ b/pith/state.h @@ -251,6 +251,16 @@ struct pine { short init_context; + struct { + unsigned keep_attach:1; + unsigned strip_signature:1; + unsigned use_flowed:1; + unsigned include_header:1; + unsigned preserve_fields:1; + unsigned signature_bottom:1; + ACTION_S *role_chosen; + } reply; + int *initial_cmds; /* cmds to execute on startup */ int *free_initial_cmds; /* used to free when done */ @@ -292,8 +302,6 @@ struct pine { SortOrder def_sort, /* Default sort type */ sort_types[22]; - int preserve; - int last_expire_year, last_expire_month; int printer_category; |