diff --git a/ChangeLog b/ChangeLog
index f7b0970..41d0917 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-09-01  Mathias Hasselmann  <mathias.hasselmann@gmx.de>
+
+	* gtksourceview/gtksourcecontextengine.c: use style-id as GtkTextTag name
+	* gtksourceview/gtksourcelanguage.c, gtksourceview/gtksourcelanguage.h:
+	  add gtk_source_language_get_parent_style
+
+	Fixes 472660.
+
 2007-09-01  Paolo Maggi  <paolo@gnome.org>
 
 	* MAINTAINERS:
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index 8b9f0ea..446b228 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -608,7 +608,7 @@ create_tag (GtkSourceContextEngine *ce,
 
 	tags = g_hash_table_lookup (ce->priv->tags, style_id);
 
-	new_tag = gtk_text_buffer_create_tag (ce->priv->buffer, NULL, NULL);
+	new_tag = gtk_text_buffer_create_tag (ce->priv->buffer, style_id, NULL);
 	/* It must have priority lower than user tags but still
 	 * higher than highlighting tags created before */
 	gtk_text_tag_set_priority (new_tag, ce->priv->n_tags);
diff --git a/gtksourceview/gtksourcelanguage.c b/gtksourceview/gtksourcelanguage.c
index 5e61dba..c23d745 100644
--- a/gtksourceview/gtksourcelanguage.c
+++ b/gtksourceview/gtksourcelanguage.c
@@ -847,6 +847,36 @@ gtk_source_language_get_style_name (GtkSourceLanguage *language,
 	return info->name;
 }
 
+/**
+ * gtk_source_language_get_parent_style:
+ *
+ * @language: a #GtkSourceLanguage
+ * @style_id: a style ID
+ *
+ * Returns the id of the parent style associated with ID @style_id defined
+ * by this @language.
+ *
+ * Returns: the id of the parent style associated with ID @style_id defined
+ * by this @language or %NULL if the style has no parent. The returned string
+ * is owned by the @language and must not be modified.
+ */
+const char *
+gtk_source_language_get_parent_style (GtkSourceLanguage *language,
+				      const char        *style_id)
+{
+	GtkSourceStyleInfo *info;
+
+	g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE (language), NULL);
+	g_return_val_if_fail (language->priv->id != NULL, NULL);
+	g_return_val_if_fail (style_id != NULL, NULL);
+
+	info = get_style_info (language, style_id);
+	if (info == NULL)
+		return NULL;
+
+	return info->map_to;
+}
+
 /* Utility functions for GtkSourceStyleInfo */
 
 GtkSourceStyleInfo *
diff --git a/gtksourceview/gtksourcelanguage.h b/gtksourceview/gtksourcelanguage.h
index bd473b1..b503e8f 100644
--- a/gtksourceview/gtksourcelanguage.h
+++ b/gtksourceview/gtksourcelanguage.h
@@ -76,6 +76,8 @@ gchar		**gtk_source_language_get_style_ids 	(GtkSourceLanguage *language);
 
 const char       *gtk_source_language_get_style_name	(GtkSourceLanguage *language,
 							 const char        *style_id);
+const char       *gtk_source_language_get_parent_style  (GtkSourceLanguage *language,
+							 const char        *style_id);
 
 G_END_DECLS
 
