diff -u oldmutt/mutt-0.95.6/OPS mutt-0.95.6/OPS
--- oldmutt/mutt-0.95.6/OPS	Sun May 23 13:31:08 1999
+++ mutt-0.95.6/OPS	Fri Aug 20 13:32:34 1999
@@ -77,6 +77,7 @@
 OP_JUMP "jump to an index number"
 OP_LAST_ENTRY "move to the last entry"
 OP_LIST_REPLY "reply to specified mailing list"
+OP_LINK_THREAD "link threads"
 OP_MACRO "execute a macro"
 OP_MAIL "compose a new mail message"
 OP_MAIN_CHANGE_FOLDER "open a different folder"
diff -u oldmutt/mutt-0.95.6/copy.c mutt-0.95.6/copy.c
--- oldmutt/mutt-0.95.6/copy.c	Tue Feb  2 02:56:54 1999
+++ mutt-0.95.6/copy.c	Fri Aug 20 12:03:08 1999
@@ -297,6 +297,29 @@
   {
     if ((flags & CH_NOSTATUS) == 0)
     {
+	if (h->newref)
+	{
+	    LIST *listp;
+	    if (fputs ("X-Thread-References: ", out) == EOF)
+		return(-1);
+
+	    listp = h->env->references;	    
+	    while (listp->next != NULL)
+	    {
+		if (fputs (h->env->references->data, out) == EOF)
+		    return(-1);
+
+		if (fputs (" ", out) == EOF)
+		    return(-1);	    
+		listp = listp->next;
+	    }
+	    if (fputs (listp->data, out) == EOF)
+		return(-1);
+
+	    if (fputc ('\n', out) == EOF)
+		return (-1);
+	}
+
       if (h->old || h->read)
       {
 	if (fputs ("Status: ", out) == EOF)
@@ -420,8 +443,9 @@
   if ((flags & M_CM_NOHEADER) == 0)
   {
     if (flags & M_CM_PREFIX)
-      chflags |= CH_PREFIX;
+      chflags |= CH_PREFIX;      
 
+    //    else if (hdr->attach_del && ((chflags & CH_UPDATE_LEN) || hdr->newref))
     else if (hdr->attach_del && (chflags & CH_UPDATE_LEN))
     {
       int new_lines;
@@ -429,6 +453,10 @@
       long new_length = body->length;
       char date[SHORT_STRING];
 
+
+      mutt_message(hdr->env->subject);
+      sleep(10);
+
       mutt_make_date (date, sizeof (date));
       date[5] = date[mutt_strlen (date) - 1] = '\"';
 
@@ -479,7 +507,7 @@
       }
 
       return 0;
-    }
+  }
 
     if (mutt_copy_header (fpin, hdr, fpout, chflags,
 			  (chflags & CH_PREFIX) ? prefix : NULL) == -1)
diff -u oldmutt/mutt-0.95.6/curs_main.c mutt-0.95.6/curs_main.c
--- oldmutt/mutt-0.95.6/curs_main.c	Sun Jun  6 13:45:32 1999
+++ mutt-0.95.6/curs_main.c	Fri Aug 20 12:42:38 1999
@@ -74,6 +74,7 @@
 			break; \
 		     }
 
+HEADER *tgdhdr;
 #define CURHDR Context->hdrs[Context->v2r[menu->current]]
 #define OLDHDR Context->hdrs[Context->v2r[menu->oldcurrent]]
 #define UNREAD(h) mutt_thread_contains_unread (Context, h)
@@ -815,6 +816,7 @@
       case OP_TAG:
 
 	CHECK_MSGCOUNT;
+	tgdhdr = CURHDR;
 	if (tag && !option (OPTAUTOTAG))
 	{
 	  for (j = 0; j < Context->vcount; j++)
@@ -1108,6 +1110,21 @@
 	    menu->redraw |= REDRAW_CURRENT;
 	}
 	break;
+      case OP_LINK_THREAD:       
+
+	if (tgdhdr != NULL)
+	{
+	    tgdhdr->env->references = 
+		mutt_add_list(tgdhdr->env->references, strdup(CURHDR->env->message_id));
+	    tgdhdr->newref = 1;
+
+	    Context->changed = 1;
+	    mutt_message("Thread linked");
+	} else {
+	    mutt_error("Tag a message to rethread");
+	}
+
+	break;
 
       case OP_MAIN_NEXT_NEW:
       case OP_MAIN_NEXT_UNREAD:
@@ -1711,7 +1728,7 @@
       set_option (OPTWEED); /* turn header weeding back on. */
     }
 
-    if (done) break;
+    if (done) break; 
   }
 
   mutt_menuDestroy (&menu);
diff -u oldmutt/mutt-0.95.6/functions.h mutt-0.95.6/functions.h
--- oldmutt/mutt-0.95.6/functions.h	Thu Jan  7 01:14:40 1999
+++ mutt-0.95.6/functions.h	Fri Aug 20 12:42:31 1999
@@ -127,8 +127,7 @@
   { "previous-new",		OP_MAIN_PREV_NEW,		"\033\t" },
   { "next-unread",		OP_MAIN_NEXT_UNREAD,		NULL },
   { "previous-unread",		OP_MAIN_PREV_UNREAD,		NULL },
-
-
+  { "link-thread",		OP_LINK_THREAD,		        "'"},
 
 #ifdef _PGPPATH
   { "extract-keys",		OP_EXTRACT_KEYS,		"\013" },
diff -u oldmutt/mutt-0.95.6/keymap_defs.h mutt-0.95.6/keymap_defs.h
--- oldmutt/mutt-0.95.6/keymap_defs.h	Wed Jul  7 15:58:55 1999
+++ mutt-0.95.6/keymap_defs.h	Fri Aug 20 12:46:25 1999
@@ -164,6 +164,7 @@
 	N_("view the key's user id"),
 	N_("make decrypted copy and delete"),
 	N_("make decrypted copy"),
+	N_("link threads"),
 	NULL
 };
 #endif /* MAIN_C */
@@ -331,5 +332,6 @@
 	OP_VIEW_ID,
 	OP_DECRYPT_SAVE,
 	OP_DECRYPT_COPY,
+	OP_LINK_THREAD,
 	OP_MAX
 };
diff -u oldmutt/mutt-0.95.6/mbox.c mutt-0.95.6/mbox.c
--- oldmutt/mutt-0.95.6/mbox.c	Mon Feb 22 03:07:29 1999
+++ mutt-0.95.6/mbox.c	Thu Aug 19 18:45:58 1999
@@ -727,7 +727,7 @@
    * rewriting the mailbox from the point where it has actually changed.
    */
   for (i = 0 ; i < ctx->msgcount && !ctx->hdrs[i]->deleted && 
-               !ctx->hdrs[i]->changed && !ctx->hdrs[i]->attach_del; i++)
+               !ctx->hdrs[i]->changed && !ctx->hdrs[i]->attach_del && !ctx->hdrs[i]->newref; i++)
     ;
   if (i == ctx->msgcount)
   { 
diff -u oldmutt/mutt-0.95.6/mutt.h mutt-0.95.6/mutt.h
--- oldmutt/mutt-0.95.6/mutt.h	Sun May 23 13:31:09 1999
+++ mutt-0.95.6/mutt.h	Thu Aug 19 17:35:16 1999
@@ -85,6 +85,7 @@
 #define CH_UPDATE_LEN	(1<<10) /* update Lines: and Content-Length: */
 #define CH_TXTPLAIN	(1<<11) /* generate text/plain MIME headers */
 #define CH_NOLEN	(1<<12) /* don't write Content-Length: and Lines: */
+#define CH_NEWREFERENCE	(1<<13) /* Update the references */
 
 /* flags for mutt_enter_string() */
 #define  M_ALIAS   1      /* do alias "completion" by calling up the alias-menu */
@@ -542,6 +543,7 @@
   unsigned int threaded : 1;        /* message has been threaded */
   unsigned int recip_valid : 1;  /* is_recipient is valid */
   unsigned int active : 1;	    /* message is not to be removed */
+  unsigned int newref: 1;        /* added new reference to 'edit' thread  */
   
   /* timezone of the sender of this message */
   unsigned int zhours : 5;
diff -u oldmutt/mutt-0.95.6/parse.c mutt-0.95.6/parse.c
--- oldmutt/mutt-0.95.6/parse.c	Tue Mar  2 12:28:18 1999
+++ mutt-0.95.6/parse.c	Fri Aug 20 12:02:47 1999
@@ -1138,7 +1138,13 @@
 	break;
 
       case 'x':
-	if (mutt_strcasecmp (line+1, "-status") == 0)
+	if (!mutt_strcasecmp (line + 1, "-Thread-References"))
+	{
+	  mutt_free_list (&e->references);
+	  e->references = mutt_parse_references (p);
+	  matched = 1;
+	}
+	else if (mutt_strcasecmp (line+1, "-status") == 0)
 	{
 	  if (hdr)
 	  {
