<<< Date Index >>>     <<< Thread Index >>>

[PATCH] compose to sender



Hi,

I have created a patch that starts a new message to the sender of
the currently selected message.  I think i updated The Manual
correctly, but don't know b/c I don't think I have the necessary
tools to generate The Manual.

Suggestions/Thoughts/Criticism are welcome.

-- 
~~`^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-., \|/  (___)  \|/ _,.-=~'`^`
                                      @~./'O o`\.~@
      "Knowledge is Power"           /__( \___/ )__\  *PPPFFBT!*
         -- Francis Bacon               `\__`U_/'
 _.-=~'``'~=-._.-=~'``'~=-._.-=~'`^`'~= <____|'  ^^`'~=-.,__,.-=
~~'^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-.,__,.-==--^'~=-.,__,.-=~'`^`
--- mutt-1.4.2.1/OPS    Thu Apr 25 08:26:56 2002
+++ mutt-1.4.2.1-mine/OPS       Fri Mar 12 20:49:50 2004
@@ -35,6 +35,7 @@
 OP_COMPOSE_TOGGLE_RECODE "toggle recoding of this attachment"
 OP_COMPOSE_POSTPONE_MESSAGE "save this message to send later"
 OP_COMPOSE_RENAME_FILE "rename/move an attached file"
+OP_COMPOSE_SENDER "compose new message to sender"
 OP_COMPOSE_SEND_MESSAGE "send the message"
 OP_COMPOSE_TOGGLE_DISPOSITION "toggle disposition between inline/attachment"
 OP_COMPOSE_TOGGLE_UNLINK "toggle whether to delete file after sending it"
--- mutt-1.4.2.1/PATCHES        Mon Nov 26 13:16:52 2001
+++ mutt-1.4.2.1-mine/PATCHES   Fri Mar 12 22:08:17 2004
@@ -0,0 +1 @@
+patch-1.4.2.1.bpm.compose_sender.1
--- mutt-1.4.2.1/curs_main.c    Wed Jan 16 14:44:25 2002
+++ mutt-1.4.2.1-mine/curs_main.c       Fri Mar 12 21:32:14 2004
@@ -1758,7 +1758,11 @@
        break;
 
 
+      case OP_COMPOSE_SENDER:
 
+       mutt_compose_sender(CURHDR);
+       menu->redraw = REDRAW_FULL;
+       break;
 
 
 
--- mutt-1.4.2.1/doc/manual.sgml.head   Thu Oct 10 04:43:11 2002
+++ mutt-1.4.2.1-mine/doc/manual.sgml.head      Fri Mar 12 22:18:59 2004
@@ -363,6 +363,10 @@
 is similar to the <ref id="edit-type" name="edit-type"> function's
 effect.
 
+<p><bf/compose-sender/<label id="compose-sender"> (default: not bound)<newline>
+
+This starts a new message with the "To" field defaulted to the sender
+of the current message.
 
 <p><bf/display-toggle-weed/<label id="display-toggle-weed"> (default: 
h)<newline>
 
--- mutt-1.4.2.1/doc/manual.sgml.tail   Thu Apr 25 08:26:58 2002
+++ mutt-1.4.2.1-mine/doc/manual.sgml.tail      Fri Mar 12 22:20:45 2004
@@ -53,6 +53,7 @@
 change-folder-readonly ESC c   open a different folder in read only mode
 check-traditional-pgp  ESC P   check for classic pgp
 clear-flag                 W   clear a status flag from a message
+compose-sender     not bound   compose new message to sender
 copy-message               C   copy a message to a file/mailbox
 create-alias               a   create an alias from a message sender
 decode-copy            ESC C   decode a message and copy it to a file/mailbox
@@ -124,6 +125,7 @@
 change-folder              c   open a different folder
 change-folder-readonly ESC c   open a different folder in read only mode
 check-traditional-pgp  ESC P   check for classic pgp
+compose-sender     not bound   compose new message to sender
 copy-message               C   copy a message to a file/mailbox
 create-alias               a   create an alias from a message sender
 decode-copy            ESC C   decode a message and copy it to a file/mailbox
--- mutt-1.4.2.1/functions.h    Tue Sep 11 06:20:34 2001
+++ mutt-1.4.2.1-mine/functions.h       Fri Mar 12 21:01:08 2004
@@ -111,6 +111,7 @@
   { "read-thread",             OP_MAIN_READ_THREAD,            "\022" },
   { "read-subthread",          OP_MAIN_READ_SUBTHREAD,         "\033r" },
   { "resend-message",          OP_RESEND,                      "\033e" },
+  { "compose-sender",       OP_COMPOSE_SENDER, NULL },
   { "save-message",            OP_SAVE,                        "s" },
   { "tag-pattern",             OP_MAIN_TAG_PATTERN,            "T" },
   { "tag-subthread",           OP_TAG_SUBTHREAD,               NULL },
@@ -189,6 +190,7 @@
   { "read-thread",     OP_MAIN_READ_THREAD,            "\022" },
   { "read-subthread",  OP_MAIN_READ_SUBTHREAD,         "\033r" },
   { "resend-message",  OP_RESEND,                      "\033e" },
+  { "compose-sender",       OP_COMPOSE_SENDER, NULL },
   { "save-message",    OP_SAVE,                        "s" },
   { "skip-quoted",     OP_PAGER_SKIP_QUOTED,           "S" },
   { "decode-save",     OP_DECODE_SAVE,                 "\033s" },
--- mutt-1.4.2.1/pager.c        Sun Jan 13 02:52:15 2002
+++ mutt-1.4.2.1-mine/pager.c   Fri Mar 12 21:31:21 2004
@@ -2141,7 +2141,12 @@
          mutt_resend_message (NULL, extra->ctx, extra->hdr);
         redraw = REDRAW_FULL;
         break;
-      
+
+      case OP_COMPOSE_SENDER:
+        mutt_compose_sender(extra->hdr);
+        redraw = REDRAW_FULL;
+      break;
+
       case OP_CREATE_ALIAS:
        CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra));
         if (IsMsgAttach (extra))
--- mutt-1.4.2.1/protos.h       Mon Apr 29 12:12:18 2002
+++ mutt-1.4.2.1-mine/protos.h  Fri Mar 12 21:29:29 2004
@@ -263,6 +263,7 @@
 int mutt_parent_message (CONTEXT *, HEADER *);
 int mutt_prepare_template(FILE*, CONTEXT *, HEADER *, HEADER *, short);
 int mutt_resend_message (FILE *, CONTEXT *, HEADER *);
+int mutt_compose_sender(HEADER *);
 #define mutt_enter_fname(A,B,C,D,E) _mutt_enter_fname(A,B,C,D,E,0,NULL,NULL)
 int _mutt_enter_fname (const char *, char *, size_t, int *, int, int, char 
***, int *);
 int  mutt_enter_string (char *buf, size_t buflen, int y, int x, int flags);
--- mutt-1.4.2.1/send.c Wed Jan 30 16:50:59 2002
+++ mutt-1.4.2.1-mine/send.c    Fri Mar 12 21:29:57 2004
@@ -1011,6 +1011,15 @@
   }
 }
 
+int mutt_compose_sender (HEADER *cur)
+{
+  HEADER *msg = mutt_new_header ();
+  msg->env = mutt_new_envelope ();
+  msg->env->to = rfc822_cpy_adr(cur->env->from);
+
+  return ci_send_message (NULL, msg, NULL, NULL, NULL);
+}
+
 int mutt_resend_message (FILE *fp, CONTEXT *ctx, HEADER *cur)
 {
   HEADER *msg = mutt_new_header ();