Index: composer/e-msg-composer.c
===================================================================
--- composer/e-msg-composer.c	(revision 35015)
+++ composer/e-msg-composer.c	(working copy)
@@ -1917,7 +1917,6 @@
 	e_msg_composer_show_help (composer);
 }
 
-
 static void
 add_to_bar (EMsgComposer *composer, GSList *names, int is_inline)
 {
@@ -2257,6 +2256,31 @@
 	}
 }
 
+static void
+attach_recent_docs_cb  (BonoboUIComponent *uic, 
+			gpointer user_data, 
+			const char *cname)
+{
+	EMsgComposer *composer = E_MSG_COMPOSER (user_data);
+	EMsgComposerPrivate *p = composer->priv;
+	gchar *command = NULL, *uri = NULL;
+	GSList *names = NULL, *l;
+
+	command = g_strdup_printf ("/commands/%s", cname);
+	uri = bonobo_ui_component_get_prop (p->uic, command, "uri", NULL);
+	g_free (command);
+
+	if (uri && *uri) {
+		names = g_slist_append (names, uri);
+		add_to_bar (composer, names, FALSE);
+		e_msg_composer_show_attachments_ui (composer);
+	}
+
+	for (l = names; l; l = l->next)
+		g_free (l->data);
+	g_slist_free (names);
+}
+
 
 static BonoboUIVerb verbs [] = {
 
@@ -2292,7 +2316,6 @@
 	E_PIXMAP_END
 };
 
-
 static void
 setup_ui (EMsgComposer *composer)
 {
@@ -3908,6 +3931,11 @@
 	g_signal_connect_after (p->attachment_expander, "activate",
 				G_CALLBACK (attachment_expander_activate_cb), composer);
 
+	/* FIXME: this should have been setup_ui, but p->attachment_bar is uninitialized then */
+	e_attachment_bar_bonobo_ui_populate_with_recent (p->uic, "/menu/Insert/RecentDocsPlaceholder", 
+							 E_ATTACHMENT_BAR (p->attachment_bar), 
+							 attach_recent_docs_cb, composer);
+
 	bonobo_window_set_contents (BONOBO_WINDOW (composer), vbox);
 	gtk_widget_show (vbox);
 
Index: widgets/misc/e-attachment-bar.c
===================================================================
--- widgets/misc/e-attachment-bar.c	(revision 35015)
+++ widgets/misc/e-attachment-bar.c	(working copy)
@@ -71,6 +71,9 @@
 struct _EAttachmentBarPrivate {
 	GtkWidget *attach;	/* attachment file dialogue, if active */
 
+	/* Recent documents. Use this widget directly when bonoboui is obsoleted */
+	GtkWidget *recent;
+
 	gboolean batch_unref;
 	GPtrArray *attachments;
 	char *path;
@@ -694,6 +697,9 @@
 		if (priv->attach)
 			gtk_widget_destroy (priv->attach);
 
+		if (priv->recent)
+			gtk_widget_destroy (priv->recent);
+
 		if (priv->path)
 			g_free (priv->path);
 
@@ -969,6 +975,7 @@
 	priv->attach = NULL;
 	priv->batch_unref = FALSE;
 	priv->attachments = g_ptr_array_new ();
+	priv->recent = gtk_recent_chooser_menu_new ();
 	priv->path = NULL;
 
 	bar->priv = priv;
@@ -1228,3 +1235,88 @@
 
 	add_from_mime_part (bar, part);
 }
+
+void 
+e_attachment_bar_bonobo_ui_populate_with_recent (BonoboUIComponent *uic, const char *path,
+						 EAttachmentBar *bar, 
+						 BonoboUIVerbFn verb_cb, gpointer user_data)
+{
+	struct _EAttachmentBarPrivate *priv;
+	GList *items, *l;
+	gint limit, i;
+	GString *menuitems;
+	char *encoded_label, *label;
+
+	g_return_if_fail (E_IS_ATTACHMENT_BAR (bar));
+
+	priv = bar->priv;
+	limit = gtk_recent_chooser_get_limit (GTK_RECENT_CHOOSER (priv->recent));
+	items = gtk_recent_chooser_get_items (GTK_RECENT_CHOOSER (priv->recent));
+
+	menuitems = g_string_new ("<submenu");
+	g_string_append (menuitems, " name=\"RecentDocsSubmenu\"");
+	g_string_append_printf (menuitems, " sensitive=\"%s\"", items ? "1" : "0");
+	g_string_append_printf (menuitems, " label=\"%s\"", _("Recent Docu_ments"));
+	g_string_append (menuitems, ">\n");
+
+	for (l = g_list_first (items), i = 1; l && i <= limit; l = l->next, ++i) {
+		GtkRecentInfo *info = ((GtkRecentInfo *)(l->data));
+		const gchar *info_dn = gtk_recent_info_get_display_name (info);
+		char *display_name, *u;
+
+		/* escape _'s in the display name so that it doesn't become an underline in a GtkLabel */
+		if ((u = strchr (info_dn, '_'))) {
+			int extra = 1;
+			char *d;
+			const char *s;
+
+			while ((u = strchr (u + 1, '_')))
+				extra++;
+
+			d = display_name = g_alloca (strlen (info_dn) + extra + 1);
+			s = info_dn;
+			while (*s != '\0') {
+				if (*s == '_')
+					*d++ = '_';
+				*d++ = *s++;
+			}
+			*d = '\0';
+		} else
+			display_name = info_dn;
+
+		/* Add menu item */
+		label = g_strdup (display_name);
+		encoded_label = bonobo_ui_util_encode_str (label);
+		g_string_append_printf (menuitems, 
+					"  <menuitem name=\"Recent-%d\" verb=\"\" label=\"%s\"/>\n",
+					i, encoded_label);
+		g_free (encoded_label);
+		g_free (label);
+	}
+
+	g_string_append (menuitems, "</submenu>\n");
+
+	bonobo_ui_component_set (uic, path, menuitems->str, NULL);
+
+	g_string_free (menuitems, TRUE);
+
+	/* Add uri prop */
+	for (l = g_list_first (items), i = 1; l && i <= limit; l = l->next, ++i) {
+		GtkRecentInfo *info = ((GtkRecentInfo *)(l->data));
+		const gchar *info_uri = gtk_recent_info_get_uri (info);
+		label = g_strdup_printf ("/commands/Recent-%d", i);
+		bonobo_ui_component_set_prop (uic, label, "uri", info_uri, NULL);
+		g_free (label);
+	}
+
+	/* Add verb */
+	for (l = g_list_first (items), i = 1; l && i <= limit; l = l->next, ++i) {
+		label = g_strdup_printf ("Recent-%d", i);
+		bonobo_ui_component_add_verb (uic, label, verb_cb, user_data);
+		g_free (label);
+	}
+
+	for (l = g_list_first (items); l; l = l->next)
+		gtk_recent_info_unref ((GtkRecentInfo *)(l->data));
+	g_list_free (items);
+}
Index: widgets/misc/e-attachment-bar.h
===================================================================
--- widgets/misc/e-attachment-bar.h	(revision 35015)
+++ widgets/misc/e-attachment-bar.h	(working copy)
@@ -27,6 +27,9 @@
 
 #include <libgnomeui/gnome-icon-list.h>
 
+#include <bonobo/bonobo-ui-node.h>
+#include <bonobo/bonobo-ui-util.h>
+
 #include <camel/camel-multipart.h>
 #include "e-attachment.h"
 
@@ -83,6 +86,10 @@
 void e_attachment_bar_set_width(EAttachmentBar *bar, int bar_width);
 GSList * e_attachment_bar_get_all_attachments (EAttachmentBar *bar);
 void e_attachment_bar_create_attachment_cache (EAttachment *attachment);
+void 
+e_attachment_bar_bonobo_ui_populate_with_recent (BonoboUIComponent *uic, const char *path,
+						 EAttachmentBar *bar, 
+						 BonoboUIVerbFn verb_cb, gpointer user_data);
 
 #ifdef __cplusplus
 }
Index: calendar/gui/dialogs/comp-editor.c
===================================================================
--- calendar/gui/dialogs/comp-editor.c	(revision 35015)
+++ calendar/gui/dialogs/comp-editor.c	(working copy)
@@ -1438,35 +1438,70 @@
 }
 
 static void
+add_to_bar (CompEditor *editor, GPtrArray *file_list, int is_inline)
+{
+	CompEditorPrivate *priv = editor->priv;
+	int i;
+
+	for (i = 0; i < file_list->len; i++) {
+		CamelURL *url;
+
+		if (!(url = camel_url_new (file_list->pdata[i], NULL)))
+			continue;
+
+		if (!g_ascii_strcasecmp (url->protocol, "file")) {
+			e_attachment_bar_attach((EAttachmentBar *)priv->attachment_bar, url->path, is_inline ? "inline" : "attachment");
+		} else {
+			e_attachment_bar_attach_remote_file ((EAttachmentBar *)priv->attachment_bar, file_list->pdata[i], is_inline ? "inline" : "attachment");
+		}
+
+		camel_url_free (url);
+	}
+}
+
+static void
 menu_insert_attachment_cb (BonoboUIComponent *uic,
 		   	   void *data,
 		   	   const char *path)
 {
 	CompEditor *editor = (CompEditor *) data;
-	EAttachmentBar *bar = (EAttachmentBar *)editor->priv->attachment_bar;
 	GPtrArray *file_list;
 	gboolean is_inline = FALSE;
 	int i;
 
 	file_list = comp_editor_select_file_attachments (editor, &is_inline);
-	/*TODO add a good implementation here */
-	if (!file_list)
-		return;
-	for (i = 0; i < file_list->len; i++) {
-		CamelURL *url;
 
-		url = camel_url_new (file_list->pdata[i], NULL);
-		if (url == NULL)
-			continue;
+	if (file_list) {
+		add_to_bar (editor, file_list, is_inline);
 
-		if (!g_ascii_strcasecmp (url->protocol, "file"))
-			 e_attachment_bar_attach (bar, url->path, is_inline ? "inline" : "attachment");
-		else
-			 e_attachment_bar_attach_remote_file (bar, file_list->pdata[i], is_inline ? "inline" : "attachment");
-		g_free (file_list->pdata[i]);
-		camel_url_free (url);
+		for (i = 0; i < file_list->len; i++)
+			g_free (file_list->pdata[i]);
+
+		g_ptr_array_free (file_list, TRUE);
 	}
+}
 
+static void
+menu_insert_attach_recent_docs_cb (BonoboUIComponent *uic,
+				   gpointer user_data,
+				   const char *cname)
+{
+	CompEditor *editor = (CompEditor *) user_data;
+	gchar *command = NULL, *uri = NULL;
+	GPtrArray *file_list = g_ptr_array_new ();
+	int i;
+
+	command = g_strdup_printf ("/commands/%s", cname);
+	uri = bonobo_ui_component_get_prop (editor->uic, command, "uri", NULL);
+	g_free (command);
+
+	if (uri && *uri) {
+		g_ptr_array_add (file_list, uri);
+		add_to_bar (editor, file_list, FALSE);
+	}
+
+	for (i = 0; i < file_list->len; i++)
+		g_free (file_list->pdata[i]);
 	g_ptr_array_free (file_list, TRUE);
 }
 
@@ -1642,6 +1677,11 @@
 
 	bonobo_ui_component_set_prop (editor->uic, "/commands/FileSave", "sensitive", "0", NULL);
 
+	/* FIXME: this should have been setup_widgets, but editor->uic is uninitialized then */
+	e_attachment_bar_bonobo_ui_populate_with_recent (editor->uic, "/menu/Insert/RecentDocsPlaceholder", 
+							 E_ATTACHMENT_BAR (priv->attachment_bar), 
+							 menu_insert_attach_recent_docs_cb, editor);
+
 	/* DND support */
 	gtk_drag_dest_set (GTK_WIDGET (editor), GTK_DEST_DEFAULT_ALL,  drop_types, num_drop_types, GDK_ACTION_COPY|GDK_ACTION_ASK|GDK_ACTION_MOVE);
 	g_signal_connect(editor, "drag_data_received", G_CALLBACK (drag_data_received), NULL);
Index: ui/evolution-message-composer.xml
===================================================================
--- ui/evolution-message-composer.xml	(revision 35015)
+++ ui/evolution-message-composer.xml	(working copy)
@@ -134,6 +134,7 @@
                 <submenu name="Insert" _label="I_nsert">
 	                <menuitem name="FileAttach" verb=""
 	                _label="_Attachment..."/>
+			<placeholder f="" name="RecentDocsPlaceholder"/>
 			<separator/>
 			<menuitem name="InsertXSendOptions" verb="" _label="_Send Options"/>
 			<separator/>
Index: ui/evolution-editor.xml
===================================================================
--- ui/evolution-editor.xml	(revision 35015)
+++ ui/evolution-editor.xml	(working copy)
@@ -41,6 +41,7 @@
       <placeholder name="Attachments">
 	      <menuitem name="InsertAttachments" verb="" _label="_Attachment..."/>
       </placeholder>
+      <placeholder f="" name="RecentDocsPlaceholder"/>
      </submenu>
 
     <submenu name="Options" _label="_Options">
