--- evolution-1.4.5/mail/folder-browser-ui.c.~1~	2003-07-25 08:44:49.000000000 -0700
+++ evolution-1.4.5/mail/folder-browser-ui.c	2004-05-01 13:15:43.971833515 -0700
@@ -114,6 +114,7 @@
 	BONOBO_UI_UNSAFE_VERB ("EditPaste", folder_browser_paste),
 	BONOBO_UI_UNSAFE_VERB ("EditInvertSelection", invert_selection),
 	BONOBO_UI_UNSAFE_VERB ("EditSelectAll", select_all),
+	BONOBO_UI_UNSAFE_VERB ("EditSelectSubthread", select_subthread),
         BONOBO_UI_UNSAFE_VERB ("EditSelectThread", select_thread),
 	BONOBO_UI_UNSAFE_VERB ("ChangeFolderProperties", configure_folder),
 	BONOBO_UI_UNSAFE_VERB ("FolderExpunge", expunge_folder),
@@ -285,6 +286,7 @@
 	{ "EditCut",                  IS_NMESSAGE },
 	{ "EditCopy",                 IS_NMESSAGE },
 	{ "EditPaste",                IS_0MESSAGE },
+	{ "EditSelectSubthread",      IS_ANY_FOLDER | SELECTION_ANYTHING | IS_THREADED | HAS_FLAGS},
 	{ "EditSelectThread",	      IS_ANY_FOLDER | SELECTION_ANYTHING | IS_THREADED | HAS_FLAGS},
 
 	{ "ViewHideSelected",         IS_NMESSAGE },
--- evolution-1.4.5/mail/mail-callbacks.c.~1~	2003-09-04 08:44:43.000000000 -0700
+++ evolution-1.4.5/mail/mail-callbacks.c	2004-05-01 13:15:43.972833266 -0700
@@ -1896,31 +1896,63 @@
 	return FALSE; /*not done yet*/
 }
 
+
 static void
-thread_select_foreach (ETreePath path, gpointer user_data)
+subthread_select_foreach (ETreePath path, gpointer user_data)
 {
 	thread_select_info_t *tsi = (thread_select_info_t *) user_data;
 	ETreeModel *tm = tsi->ml->model;
-	ETreePath node;
 	
-	/* @path part of the initial selection. If it has children,
-	 * we select them as well. If it doesn't, we select its siblings and
-	 * their children (ie, the current node must be inside the thread
-	 * that the user wants to mark.
+	e_tree_model_node_traverse (tm, path, select_node, tsi);
+}
+
+
+void
+select_subthread (BonoboUIComponent *uih, void *user_data, const char *path)
+{
+	FolderBrowser *fb = FOLDER_BROWSER (user_data);
+	ETreeSelectionModel *selection_model;
+	thread_select_info_t tsi;
+	int i;
+	
+	if (FOLDER_BROWSER_IS_DESTROYED (fb))
+		return;
+	
+	/* For every selected item, select all of its responses.
+	 * We can't alter the selection while iterating through it,
+	 * so build up a list of paths.
 	 */
 	
-	if (e_tree_model_node_get_first_child (tm, path)) 
-		node = path;
-	else {
-		node = e_tree_model_node_get_parent (tm, path);
-		
-		/* Let's make an exception: if no parent, then we're about
-		 * to mark the whole tree. No. */
-		if (e_tree_model_node_is_root (tm, node)) 
-			node = path;
-	}
+	tsi.ml = fb->message_list;
+	tsi.paths = g_ptr_array_new ();
+	
+	e_tree_selected_path_foreach (fb->message_list->tree, subthread_select_foreach, &tsi);
 	
-	e_tree_model_node_traverse (tm, node, select_node, tsi);
+	selection_model = E_TREE_SELECTION_MODEL (e_tree_get_selection_model (fb->message_list->tree));
+	
+	for (i = 0; i < tsi.paths->len; i++)
+		e_tree_selection_model_add_to_selection (selection_model,
+							 tsi.paths->pdata[i]);
+	g_ptr_array_free (tsi.paths, TRUE);
+}
+
+static void
+thread_select_foreach (ETreePath path, gpointer user_data)
+{
+	thread_select_info_t *tsi = (thread_select_info_t *) user_data;
+	ETreeModel *tm = tsi->ml->model;
+	ETreePath node, last;
+	
+	node = path;
+
+	do {
+		last = node;
+		node = e_tree_model_node_get_parent(tm, node);
+	} while (!e_tree_model_node_is_root(tm, node));
+
+	g_ptr_array_add(tsi->paths, last);
+
+	e_tree_model_node_traverse (tm, last, select_node, tsi);
 }
 
 void
--- evolution-1.4.5/ui/evolution-mail-list.xml.~1~	2003-07-11 09:03:02.000000000 -0700
+++ evolution-1.4.5/ui/evolution-mail-list.xml	2004-05-01 13:15:43.973833018 -0700
@@ -22,6 +22,10 @@
      _tip="Select all visible messages"
      accel="*Control*a"/>
 
+    <cmd name="EditSelectSubthread"
+     _tip="Select all responses to the selected message"
+     accel="*Control**Shift*h"/>
+
     <cmd name="EditSelectThread"
      _tip="Select all messages in the same thread as the selected message"
      accel="*Control*h"/>
@@ -79,6 +83,7 @@
         <placeholder name="MailListEdit">
           <menuitem name="EditSelectAll" verb="" _label="Select _All"/>
           <menuitem name="EditSelectThread" verb="" _label="Select _Thread"/>
+          <menuitem name="EditSelectSubthread" verb="" _label="Select _Subthread"/>
           <menuitem name="EditInvertSelection" verb="" _label="_Invert Selection"/>
 
 	  <separator f="" name="emaillist1"/>
--- evolution-1.4.5/mail/mail-callbacks.h.~1~	2003-01-24 08:47:55.000000000 -0800
+++ evolution-1.4.5/mail/mail-callbacks.h	2004-05-01 13:24:06.967692835 -0700
@@ -95,6 +95,7 @@
 void move_msg                  (BonoboUIComponent *uih, void *user_data, const char *path);
 void copy_msg                  (BonoboUIComponent *uih, void *user_data, const char *path);
 void select_all                (BonoboUIComponent *uih, void *user_data, const char *path);
+void select_subthread          (BonoboUIComponent *uih, void *user_data, const char *path);
 void select_thread             (BonoboUIComponent *uih, void *user_data, const char *path);
 void invert_selection          (BonoboUIComponent *uih, void *user_data, const char *path);
 void mark_as_seen              (BonoboUIComponent *uih, void *user_data, const char *path);
