]> granicus.if.org Git - neomutt/commitdiff
Introducing $forward_edit.
authorMichael Elkins <me@sigpipe.org>
Mon, 9 Sep 2002 20:20:20 +0000 (20:20 +0000)
committerMichael Elkins <me@sigpipe.org>
Mon, 9 Sep 2002 20:20:20 +0000 (20:20 +0000)
init.h
mutt.h
send.c

diff --git a/init.h b/init.h
index aacc98d53bea7ded14b2fc8c2a4b9c0af0590726..1d16c3482b90150d676ad9e50670eb0f369e8e99 100644 (file)
--- a/init.h
+++ b/init.h
@@ -588,6 +588,13 @@ struct option_t MuttVars[] = {
   { "forw_decode",     DT_SYN,  R_NONE, UL "forward_decode", 0 },
   /*
   */
+  { "forward_edit",    DT_QUAD, R_NONE, OPT_FORWEDIT, M_YES },
+  /*
+  ** .pp
+  ** This quadoption controls whether or not the user is automatically
+  ** placed in the editor when forwarding messages.  For those who always want
+  ** to forward with no modification, use a setting to ``no''.
+  */
   { "forward_format",  DT_STR,  R_NONE, UL &ForwFmt, UL "[%a: %s]" },
   /*
   ** .pp
diff --git a/mutt.h b/mutt.h
index f87d718402c155c5e5d74eb9d2fcdcf72def4bb7..39f8d9c1f83f12c6c3a77a1cfec73e2aedce3634 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -294,6 +294,7 @@ enum
   OPT_RECALL,
   OPT_SUBJECT,
   OPT_MIMEFWDREST,
+  OPT_FORWEDIT,
   OPT_MAX
 };
 
diff --git a/send.c b/send.c
index 4489629c57a9cc1482fc6db903cb622c80590b22..85186b56a2acc8f4486581d7d129e73fafd285da 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1297,9 +1297,22 @@ ci_send_message (int flags,              /* send mode */
     
     mutt_update_encoding (msg->content);
 
-    /* If the this isn't a text message, look for a mailcap edit command */
-    if(! (flags & SENDKEY))
+    /*
+     * Select whether or not the user's editor should be called now.  We
+     * don't want to do this when:
+     * 1) we are sending a key/cert
+     * 2) we are forwarding a message and the user doesn't want to edit it.
+     *    This is controled by the quadoption $forward_edit.  However, if
+     *    both $edit_headers and $autoedit are set, we want to ignore the
+     *    setting of $forward_edit because the user probably needs to add the
+     *    recipients.
+     */
+    if (! (flags & SENDKEY) &&
+       ((flags & SENDFORWARD) == 0 ||
+        (option (OPTEDITHDRS) && option (OPTAUTOEDIT)) ||
+        query_quadoption (OPT_FORWEDIT, _("Edit forwarded message?")) == M_YES))
     {
+      /* If the this isn't a text message, look for a mailcap edit command */
       if (mutt_needs_mailcap (msg->content))
        mutt_edit_attachment (msg->content);
       else if (!Editor || mutt_strcmp ("builtin", Editor) == 0)