Index: libedataserverui/e-name-selector-entry.c
===================================================================
--- libedataserverui/e-name-selector-entry.c	(revision 9438)
+++ libedataserverui/e-name-selector-entry.c	(working copy)
@@ -39,6 +39,7 @@ enum {
 };
 static guint signals[LAST_SIGNAL] = { 0 };
 static guint COMPLETION_CUE_MIN_LEN = 0;
+static gboolean COMPLETION_FORCE_SHOW_ADDRESS = FALSE;
 #define ENS_DEBUG(x)
 
 G_DEFINE_TYPE (ENameSelectorEntry, e_name_selector_entry, GTK_TYPE_ENTRY);
@@ -64,6 +65,7 @@ static void user_insert_text (ENameSelec
 static void user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint end_pos, gpointer user_data);
 
 static void setup_default_contact_store (ENameSelectorEntry *name_selector_entry);
+static void deep_free_list (GList *list);
 
 static void
 e_name_selector_entry_get_property (GObject *object, guint prop_id,
@@ -937,6 +939,33 @@ modify_destination_at_position (ENameSel
 		generate_attribute_list (name_selector_entry);
 }
 
+static gchar *
+get_destination_textrep (EDestination *destination)
+{
+	gboolean show_email = COMPLETION_FORCE_SHOW_ADDRESS;
+	EContact *contact;
+
+	g_return_val_if_fail (destination != NULL, NULL);
+
+	contact = e_destination_get_contact (destination);
+
+	if (!show_email) {
+		if (contact && !e_contact_get (contact, E_CONTACT_IS_LIST)) {
+			GList *email_list;
+
+			email_list = e_contact_get (contact, E_CONTACT_EMAIL);
+			show_email = g_list_length (email_list) > 1;
+			deep_free_list (email_list);
+		}
+	}
+
+	/* do not show emails for contact lists even user forces it in gconf */
+	if (show_email && contact && e_contact_get (contact, E_CONTACT_IS_LIST))
+		show_email = FALSE;
+
+	return sanitize_string (e_destination_get_textrep (destination, show_email));
+}
+
 static void
 sync_destination_at_position (ENameSelectorEntry *name_selector_entry, gint range_pos, gint *cursor_pos)
 {
@@ -958,7 +987,7 @@ sync_destination_at_position (ENameSelec
 		return;
 	}
 
-	address = sanitize_string (e_destination_get_textrep (destination, FALSE));
+	address = get_destination_textrep (destination);
 	address_len = g_utf8_strlen (address, -1);
 
 	if (cursor_pos) {
@@ -1669,7 +1698,7 @@ destination_row_changed (ENameSelectorEn
 
 	gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), range_start, range_end);
 
-	text = sanitize_string (e_destination_get_textrep (destination, FALSE));
+	text = get_destination_textrep (destination);
 	gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), text, -1, &range_start);
 	g_free (text);
 
@@ -1721,7 +1750,7 @@ destination_row_inserted (ENameSelectorE
 	if (comma_before)
 		gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &insert_pos);
 
-	text = sanitize_string (e_destination_get_textrep (destination, FALSE));
+	text = get_destination_textrep (destination);
 	gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), text, -1, &insert_pos);
 	g_free (text);
 
@@ -2403,6 +2432,7 @@ e_name_selector_entry_init (ENameSelecto
 		;
 	  else COMPLETION_CUE_MIN_LEN = 3;
   }
+  COMPLETION_FORCE_SHOW_ADDRESS = gconf_client_get_bool (gconf, FORCE_SHOW_ADDRESS, NULL);
   g_object_unref (G_OBJECT (gconf));
 
   /* Edit signals */
Index: libedataserverui/e-name-selector-entry.h
===================================================================
--- libedataserverui/e-name-selector-entry.h	(revision 9438)
+++ libedataserverui/e-name-selector-entry.h	(working copy)
@@ -40,6 +40,7 @@ G_BEGIN_DECLS
 #define E_NAME_SELECTOR_ENTRY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), E_NAME_SELECTOR_ENTRY_TYPE, ENameSelectorEntryClass))
 
 #define MINIMUM_QUERY_LENGTH "/apps/evolution/addressbook/completion/minimum_query_length"
+#define FORCE_SHOW_ADDRESS   "/apps/evolution/addressbook/completion/show_address"
 
 typedef struct _ENameSelectorEntry      ENameSelectorEntry;
 typedef struct _ENameSelectorEntryClass ENameSelectorEntryClass;
Index: libedataserverui/ChangeLog
===================================================================
--- libedataserverui/ChangeLog	(revision 9438)
+++ libedataserverui/ChangeLog	(working copy)
@@ -1,3 +1,16 @@
+2008-08-27  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #272391
+
+	* e-name-selector-entry.h: (FORCE_SHOW_ADDRESS):
+	* e-name-selector-entry.c: (COMPLETION_FORCE_SHOW_ADDRESS),
+	(get_destination_textrep), (sync_destination_at_position),
+	(destination_row_changed), (destination_row_inserted),
+	(e_name_selector_entry_init):
+	Show address of the contact if it contains more than one mail
+	address and is not a list. Be able to force showing of the mail
+	for every autocompleted entry by the option in the gconf.
+
 2008-08-17  Matthew Barnes  <mbarnes@redhat.com>
 
 	** Fixes bug #547952
