Index: embed/ephy-history.c
===================================================================
RCS file: /cvs/gnome/epiphany/embed/ephy-history.c,v
retrieving revision 1.14
diff -u -p -r1.14 ephy-history.c
--- embed/ephy-history.c	18 Apr 2003 16:43:53 -0000	1.14
+++ embed/ephy-history.c	24 Apr 2003 16:11:08 -0000
@@ -21,7 +21,7 @@
 #include "ephy-file-helpers.h"
 #include "ephy-autocompletion-source.h"
 #include "ephy-debug.h"
-#include "ephy-node-view.h"
+#include "ephy-node.h"
 
 #include <time.h>
 #include <string.h>
@@ -405,7 +405,7 @@ ephy_history_init (EphyHistory *eb)
 			        &value);
 	g_value_unset (&value);
 	g_value_init (&value, G_TYPE_INT);
-	g_value_set_int (&value, EPHY_NODE_VIEW_ALL_PRIORITY);
+	g_value_set_int (&value, EPHY_NODE_ALL_PRIORITY);
 	ephy_node_set_property (eb->priv->pages,
 			        EPHY_NODE_PAGE_PROP_PRIORITY,
 			        &value);
Index: lib/ephy-node.c
===================================================================
RCS file: /cvs/gnome/epiphany/lib/ephy-node.c,v
retrieving revision 1.5
diff -u -p -r1.5 ephy-node.c
--- lib/ephy-node.c	14 Apr 2003 19:59:09 -0000	1.5
+++ lib/ephy-node.c	24 Apr 2003 16:11:15 -0000
@@ -707,6 +707,24 @@ ephy_node_get_property_int (EphyNode *no
 	return retval;
 }
 
+EphyNodePriority	
+ephy_node_get_property_priority (EphyNode *node,
+				 guint property_id)
+{
+	EphyNodePriority retval;
+
+	retval = ephy_node_get_property_int (node, property_id);
+
+	/* This is only here for compatibility with old bookmark files */
+
+	if (retval == -1)
+	{
+		retval = EPHY_NODE_NORMAL_PRIORITY;
+	}
+
+	return retval;
+}
+
 double
 ephy_node_get_property_double (EphyNode *node,
 			       guint property_id)
Index: lib/ephy-node.h
===================================================================
RCS file: /cvs/gnome/epiphany/lib/ephy-node.h,v
retrieving revision 1.3
diff -u -p -r1.3 ephy-node.h
--- lib/ephy-node.h	13 Apr 2003 10:12:32 -0000	1.3
+++ lib/ephy-node.h	24 Apr 2003 16:11:17 -0000
@@ -58,6 +58,13 @@ typedef struct
 	void (*child_removed)   (EphyNode *node, EphyNode *child);
 } EphyNodeClass;
 
+typedef enum
+{
+	EPHY_NODE_ALL_PRIORITY,
+	EPHY_NODE_SPECIAL_PRIORITY,
+	EPHY_NODE_NORMAL_PRIORITY
+} EphyNodePriority;
+
 GType       ephy_node_get_type              (void);
 
 EphyNode   *ephy_node_new                   (void);
@@ -84,30 +91,32 @@ enum
 	EPHY_NODE_PROP_NAME_SORT_KEY = 1
 };
 
-void        ephy_node_set_property          (EphyNode *node,
-				             guint property_id,
-				             const GValue *value);
-gboolean    ephy_node_get_property          (EphyNode *node,
-				             guint property_id,
-				             GValue *value);
-
-const char *ephy_node_get_property_string   (EphyNode *node,
-					     guint property_id);
-gboolean    ephy_node_get_property_boolean  (EphyNode *node,
-					     guint property_id);
-long        ephy_node_get_property_long     (EphyNode *node,
-					     guint property_id);
-int         ephy_node_get_property_int      (EphyNode *node,
-					     guint property_id);
-double      ephy_node_get_property_double   (EphyNode *node,
-					     guint property_id);
-float       ephy_node_get_property_float    (EphyNode *node,
-					     guint property_id);
-EphyNode   *ephy_node_get_property_node     (EphyNode *node,
-					     guint property_id);
+void        		ephy_node_set_property          	(EphyNode *node,
+						        	 guint property_id,
+				             			 const GValue *value);
+gboolean    		ephy_node_get_property          	(EphyNode *node,
+				             			 guint property_id,
+				             			 GValue *value);
+
+const char 	       *ephy_node_get_property_string   	(EphyNode *node,
+					     			 guint property_id);
+gboolean    		ephy_node_get_property_boolean  	(EphyNode *node,
+					     			 guint property_id);
+long        		ephy_node_get_property_long     	(EphyNode *node,
+					     		 	 guint property_id);
+int         		ephy_node_get_property_int      	(EphyNode *node,
+					     			 guint property_id);
+EphyNodePriority	ephy_node_get_property_priority		(EphyNode *node,
+					     			 guint property_id);
+double      		ephy_node_get_property_double		(EphyNode *node,
+					    			 guint property_id);
+float       		ephy_node_get_property_float		(EphyNode *node,
+					    			 guint property_id);
+EphyNode   	       *ephy_node_get_property_node 		(EphyNode *node,
+					    			 guint property_id);
 /* free return value */
-char       *ephy_node_get_property_time     (EphyNode *node,
-					     guint property_id);
+char       	       *ephy_node_get_property_time     	(EphyNode *node,
+					     			 guint property_id);
 
 /* xml storage */
 void          ephy_node_save_to_xml         (EphyNode *node,
Index: lib/widgets/ephy-node-view.c
===================================================================
RCS file: /cvs/gnome/epiphany/lib/widgets/ephy-node-view.c,v
retrieving revision 1.3
diff -u -p -r1.3 ephy-node-view.c
--- lib/widgets/ephy-node-view.c	19 Apr 2003 11:21:52 -0000	1.3
+++ lib/widgets/ephy-node-view.c	24 Apr 2003 16:11:23 -0000
@@ -237,7 +237,7 @@ drag_motion_cb (GtkWidget *widget,
 	GtkTreePath *path = NULL;
 	GtkTreeViewDropPosition pos;
 	gboolean res;
-	EphyNodeViewPriority priority;
+	EphyNodePriority priority;
 
 	g_signal_stop_emission_by_name (widget, "drag_motion");
 
@@ -247,10 +247,10 @@ drag_motion_cb (GtkWidget *widget,
 
 	node = get_node_from_path (view, path);
 
-	priority = ephy_node_get_property_int (node, view->priv->priority_prop_id);
+	priority = ephy_node_get_property_priority (node, view->priv->priority_prop_id);
 
-	if (priority != EPHY_NODE_VIEW_ALL_PRIORITY &&
-	    priority != EPHY_NODE_VIEW_SPECIAL_PRIORITY)
+	if (priority != EPHY_NODE_ALL_PRIORITY &&
+	    priority != EPHY_NODE_SPECIAL_PRIORITY)
 
 	{
 		gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget), path,
@@ -703,27 +703,27 @@ ephy_node_view_sort_func (GtkTreeModel *
 static void
 provide_priority (EphyNode *node, GValue *value, EphyNodeView *view)
 {
-	int priority;
+	EphyNodePriority priority;
 
 	g_value_init (value, G_TYPE_INT);
-	priority = ephy_node_get_property_int (node, view->priv->priority_prop_id);
-	if (priority == EPHY_NODE_VIEW_ALL_PRIORITY ||
-	    priority == EPHY_NODE_VIEW_SPECIAL_PRIORITY)
+	priority = ephy_node_get_property_priority (node, view->priv->priority_prop_id);
+	if (priority == EPHY_NODE_ALL_PRIORITY ||
+	    priority == EPHY_NODE_SPECIAL_PRIORITY)
 		g_value_set_int (value, priority);
 	else
-		g_value_set_int (value, EPHY_NODE_VIEW_NORMAL_PRIORITY);
+		g_value_set_int (value, EPHY_NODE_NORMAL_PRIORITY);
 }
 
 static void
 provide_text_weight (EphyNode *node, GValue *value, EphyNodeView *view)
 {
-	int priority;
+	EphyNodePriority priority;
 
 	g_value_init (value, G_TYPE_INT);
-	priority = ephy_node_get_property_int
+	priority = ephy_node_get_property_priority
 		(node, view->priv->priority_prop_id);
-	if (priority == EPHY_NODE_VIEW_ALL_PRIORITY ||
-	    priority == EPHY_NODE_VIEW_SPECIAL_PRIORITY)
+	if (priority == EPHY_NODE_ALL_PRIORITY ||
+	    priority == EPHY_NODE_SPECIAL_PRIORITY)
 	{
 		g_value_set_int (value, PANGO_WEIGHT_BOLD);
 	}
Index: lib/widgets/ephy-node-view.h
===================================================================
RCS file: /cvs/gnome/epiphany/lib/widgets/ephy-node-view.h,v
retrieving revision 1.3
diff -u -p -r1.3 ephy-node-view.h
--- lib/widgets/ephy-node-view.h	19 Apr 2003 11:21:52 -0000	1.3
+++ lib/widgets/ephy-node-view.h	24 Apr 2003 16:11:23 -0000
@@ -47,13 +47,6 @@ typedef struct
 
 typedef enum
 {
-	EPHY_NODE_VIEW_ALL_PRIORITY,
-	EPHY_NODE_VIEW_SPECIAL_PRIORITY,
-	EPHY_NODE_VIEW_NORMAL_PRIORITY
-} EphyNodeViewPriority;
-
-typedef enum
-{
 	EPHY_NODE_VIEW_AUTO_SORT = 1,
 	EPHY_NODE_VIEW_USER_SORT = 2,
 	EPHY_NODE_VIEW_EDITABLE = 4
Index: src/bookmarks/ephy-bookmarks-editor.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-bookmarks-editor.c,v
retrieving revision 1.62
diff -u -p -r1.62 ephy-bookmarks-editor.c
--- src/bookmarks/ephy-bookmarks-editor.c	23 Apr 2003 19:06:43 -0000	1.62
+++ src/bookmarks/ephy-bookmarks-editor.c	24 Apr 2003 16:11:34 -0000
@@ -347,17 +347,15 @@ cmd_delete (EggAction *action,
 	}
 	else if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->key_view)))
 	{
-		EphyNodeViewPriority priority;
+		EphyNodePriority priority;
 		GList *selected;
 		EphyNode *node; 
 		
 		selected = ephy_node_view_get_selection (EPHY_NODE_VIEW (editor->priv->key_view));
 		node = EPHY_NODE (selected->data);
-		priority = ephy_node_get_property_int (node, EPHY_NODE_KEYWORD_PROP_PRIORITY);
-
-		if (priority == -1) priority = EPHY_NODE_VIEW_NORMAL_PRIORITY;
+		priority = ephy_node_get_property_priority (node, EPHY_NODE_KEYWORD_PROP_PRIORITY);
 		
-		if (priority == EPHY_NODE_VIEW_NORMAL_PRIORITY)
+		if (priority == EPHY_NODE_NORMAL_PRIORITY)
 		{
 			ephy_node_view_remove (EPHY_NODE_VIEW (editor->priv->key_view));
 		}
@@ -628,12 +626,12 @@ ephy_bookmarks_editor_update_menu (EphyB
 	if (key_focus && selected)
 	{
 		EphyNode *node = EPHY_NODE (selected->data);
-		EphyNodeViewPriority priority;
+		EphyNodePriority priority;
 
-		priority = ephy_node_get_property_int
+		priority = ephy_node_get_property_priority
 			(node, EPHY_NODE_KEYWORD_PROP_PRIORITY);
-		if (priority == -1) priority = EPHY_NODE_VIEW_NORMAL_PRIORITY;
-		key_normal = (priority == EPHY_NODE_VIEW_NORMAL_PRIORITY);
+
+		key_normal = (priority == EPHY_NODE_NORMAL_PRIORITY);
 
 		show_in_toolbar = ephy_node_get_property_boolean
 			(node, EPHY_NODE_BMK_PROP_SHOW_IN_TOOLBAR);
Index: src/bookmarks/ephy-bookmarks.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-bookmarks.c,v
retrieving revision 1.30
diff -u -p -r1.30 ephy-bookmarks.c
--- src/bookmarks/ephy-bookmarks.c	17 Apr 2003 12:59:52 -0000	1.30
+++ src/bookmarks/ephy-bookmarks.c	24 Apr 2003 16:11:38 -0000
@@ -22,7 +22,6 @@
 #include "ephy-history.h"
 #include "ephy-debug.h"
 #include "ephy-tree-model-node.h"
-#include "ephy-node-view.h"
 
 #include <string.h>
 #include <libgnome/gnome-i18n.h>
@@ -507,7 +506,7 @@ ephy_bookmarks_init (EphyBookmarks *eb)
 	eb->priv->keywords = ephy_node_new_with_id (KEYWORDS_NODE_ID);
 	ephy_node_ref (eb->priv->keywords);
 	g_value_init (&value, G_TYPE_INT);
-	g_value_set_int (&value, EPHY_NODE_VIEW_ALL_PRIORITY);
+	g_value_set_int (&value, EPHY_NODE_ALL_PRIORITY);
 	ephy_node_set_property (eb->priv->bookmarks,
 			        EPHY_NODE_KEYWORD_PROP_PRIORITY,
 			        &value);
@@ -531,7 +530,7 @@ ephy_bookmarks_init (EphyBookmarks *eb)
 			        &value);
 	g_value_unset (&value);
 	g_value_init (&value, G_TYPE_INT);
-	g_value_set_int (&value, EPHY_NODE_VIEW_SPECIAL_PRIORITY);
+	g_value_set_int (&value, EPHY_NODE_SPECIAL_PRIORITY);
 	ephy_node_set_property (eb->priv->favorites,
 				EPHY_NODE_KEYWORD_PROP_PRIORITY,
 				&value);
@@ -548,7 +547,7 @@ ephy_bookmarks_init (EphyBookmarks *eb)
 			        &value);
 	g_value_unset (&value);
 	g_value_init (&value, G_TYPE_INT);
-	g_value_set_int (&value, EPHY_NODE_VIEW_SPECIAL_PRIORITY);
+	g_value_set_int (&value, EPHY_NODE_SPECIAL_PRIORITY);
 	ephy_node_set_property (eb->priv->notcategorized,
 				EPHY_NODE_KEYWORD_PROP_PRIORITY,
 				&value);
@@ -857,7 +856,7 @@ ephy_bookmarks_add_keyword (EphyBookmark
 	g_value_unset (&value);
 
 	g_value_init (&value, G_TYPE_INT);
-	g_value_set_int (&value, EPHY_NODE_VIEW_NORMAL_PRIORITY);
+	g_value_set_int (&value, EPHY_NODE_NORMAL_PRIORITY);
 	ephy_node_set_property (key, EPHY_NODE_KEYWORD_PROP_PRIORITY,
 			        &value);
 	g_value_unset (&value);
Index: src/bookmarks/ephy-topic-action.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-topic-action.c,v
retrieving revision 1.7
diff -u -p -r1.7 ephy-topic-action.c
--- src/bookmarks/ephy-topic-action.c	24 Apr 2003 03:08:36 -0000	1.7
+++ src/bookmarks/ephy-topic-action.c	24 Apr 2003 16:11:41 -0000
@@ -16,6 +16,8 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
+
 #include "ephy-topic-action.h"
 #include "ephy-bookmarks.h"
 #include "ephy-shell.h"
@@ -143,6 +145,64 @@ ephy_topic_action_sync_label (EggAction 
 	gtk_label_set_label (label, action->label);
 }
 
+static gint
+sort_bookmarks (gconstpointer a, gconstpointer b)
+{
+	EphyNode *node_a = *(EphyNode **)a;
+	EphyNode *node_b = *(EphyNode **)b;
+	const char *title_a = ephy_node_get_property_string (node_a, EPHY_NODE_BMK_PROP_TITLE);
+	const char *title_b = ephy_node_get_property_string (node_b, EPHY_NODE_BMK_PROP_TITLE);
+	gchar *key_a = NULL;
+	gchar *key_b = NULL;
+	gint retval;
+
+	key_a = g_utf8_collate_key (title_a, -1);
+	key_b = g_utf8_collate_key (title_b, -1);
+	retval = strcmp (key_a, key_b);
+
+	g_free (key_a);
+	g_free (key_b);
+
+	return retval;
+}
+
+static gint
+sort_topics (gconstpointer a, gconstpointer b)
+{
+	EphyNode *node_a = *(EphyNode **)a;
+	EphyNode *node_b = *(EphyNode **)b;
+	const char *title_a = ephy_node_get_property_string (node_a, EPHY_NODE_KEYWORD_PROP_NAME);
+	const char *title_b = ephy_node_get_property_string (node_b, EPHY_NODE_KEYWORD_PROP_NAME);
+	EphyNodePriority priority_a;
+	EphyNodePriority priority_b;
+	gchar *key_a;
+	gchar *key_b;
+	gint retval;
+
+	priority_a = ephy_node_get_property_priority (node_a, EPHY_NODE_KEYWORD_PROP_PRIORITY);
+	priority_b = ephy_node_get_property_priority (node_b, EPHY_NODE_KEYWORD_PROP_PRIORITY);
+	
+	if (priority_a < priority_b)
+	{
+		return -1;
+	}
+	else if (priority_a > priority_b)
+	{
+		return 1;
+	}
+	else
+	{
+		key_a = g_utf8_collate_key (title_a, -1);
+		key_b = g_utf8_collate_key (title_b, -1);
+		retval = strcmp (key_a, key_b);
+
+		g_free (key_a);
+		g_free (key_b);
+
+		return retval;
+	}
+}
+
 static GtkWidget *
 build_bookmarks_menu (EphyTopicAction *action, EphyNode *node)
 {
@@ -157,6 +217,9 @@ build_bookmarks_menu (EphyTopicAction *a
                (EPHY_EMBED_SHELL (ephy_shell));
 
 	children = ephy_node_get_children (node);
+
+	g_ptr_array_sort (children, sort_bookmarks);
+
 	for (i = 0; i < children->len; i++)
 	{
 		EphyNode *kid;
@@ -203,7 +266,7 @@ build_bookmarks_menu (EphyTopicAction *a
 static GtkWidget *
 build_topics_menu (EphyTopicAction *action, EphyNode *node)
 {
-	GtkWidget *menu, *item;
+	GtkWidget *menu, *item, *label;
 	GPtrArray *children;
 	int i;
 	EphyBookmarks *bookmarks;
@@ -215,20 +278,40 @@ build_topics_menu (EphyTopicAction *acti
 	menu = gtk_menu_new ();
 
 	children = ephy_node_get_children (node);
+	g_ptr_array_sort (children, sort_topics);
+	
 	for (i = 0; i < children->len; i++)
 	{
 		EphyNode *kid;
 		const char *title;
+		char *markup_title = NULL;
+		EphyNodePriority priority;
 		GtkWidget *bmk_menu;
 
 		kid = g_ptr_array_index (children, i);
 		if (kid == all) continue;
-
 		title = ephy_node_get_property_string
 			(kid, EPHY_NODE_KEYWORD_PROP_NAME);
+		priority = ephy_node_get_property_priority 
+			(kid, EPHY_NODE_KEYWORD_PROP_PRIORITY);
 		LOG ("Create menu for topic %s", title);
 
-		item = gtk_image_menu_item_new_with_label (title);
+		if ((priority == EPHY_NODE_ALL_PRIORITY)
+		    || (priority == EPHY_NODE_SPECIAL_PRIORITY))
+		{
+			markup_title = g_strconcat ("<b>", title, "</b>", NULL);
+		}
+		else 
+		{
+			markup_title = g_strdup (title);
+		}
+
+		item = gtk_image_menu_item_new_with_label (markup_title);
+		g_free (markup_title);
+
+		label = gtk_bin_get_child (GTK_BIN (item));
+		gtk_label_set_use_markup  (GTK_LABEL (label), TRUE);
+		
 		gtk_widget_show (item);
 		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);

Index: src/bookmarks/ephy-topics-selector.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-topics-selector.c,v
retrieving revision 1.10
diff -u -p -r1.10 ephy-topics-selector.c
--- src/bookmarks/ephy-topics-selector.c	17 Apr 2003 12:59:52 -0000	1.10
+++ src/bookmarks/ephy-topics-selector.c	24 Apr 2003 16:11:42 -0000
@@ -19,7 +19,7 @@
 
 #include "ephy-topics-selector.h"
 #include "ephy-debug.h"
-#include "ephy-node-view.h"
+#include "ephy-node.h"
 
 #include <gtk/gtkliststore.h>
 #include <gtk/gtkcellrenderertoggle.h>
@@ -207,7 +207,7 @@ fill_model (EphyTopicsSelector *editor)
 		EphyNode *kid;
 		const char *name;
 		gboolean has_keyword = FALSE;
-		int priority;
+		EphyNodePriority priority;
 		GtkTreeIter iter;
 
 		kid = g_ptr_array_index (children, i);
@@ -222,11 +222,10 @@ fill_model (EphyTopicsSelector *editor)
 				 editor->priv->bookmark);
 		}
 
-		priority = ephy_node_get_property_int
+		priority = ephy_node_get_property_priority
 			(kid, EPHY_NODE_KEYWORD_PROP_PRIORITY);
-		if (priority == -1) priority = EPHY_NODE_VIEW_NORMAL_PRIORITY;
 
-		if (priority == EPHY_NODE_VIEW_NORMAL_PRIORITY)
+		if (priority == EPHY_NODE_NORMAL_PRIORITY)
 		{
 			gtk_list_store_append (model, &iter);
 			gtk_list_store_set (model, &iter,
