Index: ChangeLog
===================================================================
--- ChangeLog	(revision 1784)
+++ ChangeLog	(working copy)
@@ -1,3 +1,25 @@
+2007-12-04  Johannes Schmid <jhs@gnome.org>
+
+	* docs/reference/gtksourceview-2.0-sections.txt:
+	* docs/reference/gtksourceview-2.0.types:
+	* docs/reference/gtksourceview-docs.sgml:
+	
+	Updated docs for the new GtkSourceMark API
+	
+	* gtksourceview/gtksourceview.c:
+	GtkSourceMark API and a documentation fix
+	
+	* gtksourceview/gtksourcebuffer.h:
+	* gtksourceview/gtksourcebuffer.c:
+	* gtksourceview/gtksourcemark.h (added):
+	* gtksourceview/gtksourcemark.c (added):
+	* gtksourceview/gtksourcemark.h (removed):
+	* gtksourceview/gtksourcemark.c (removed):
+	
+	Added new GtkSourceMark API (#487098)
+
+	* configure.ac: Bumped version to 2.1.0 because of API addition
+
 2007-12-13  Yevgen Muntyan  <muntyan@tamu.edu>
 
 	* gtksourceview/language-specs/sql.lang: highlight backtick-quoted
Index: docs/reference/gtksourceview-2.0-sections.txt
===================================================================
--- docs/reference/gtksourceview-2.0-sections.txt	(revision 1784)
+++ docs/reference/gtksourceview-2.0-sections.txt	(working copy)
@@ -23,15 +23,11 @@ gtk_source_buffer_can_undo
 gtk_source_buffer_begin_not_undoable_action
 gtk_source_buffer_end_not_undoable_action
 gtk_source_buffer_create_marker
-gtk_source_buffer_delete_marker
-gtk_source_buffer_move_marker
 gtk_source_buffer_get_first_marker
 gtk_source_buffer_get_last_marker
-gtk_source_buffer_get_marker
 gtk_source_buffer_get_markers_in_region
 gtk_source_buffer_get_next_marker
 gtk_source_buffer_get_prev_marker
-gtk_source_buffer_get_iter_at_marker
 gtk_source_buffer_ensure_highlight
 <SUBSECTION Standard>
 GTK_IS_SOURCE_BUFFER
@@ -136,26 +132,22 @@ gtk_source_language_manager_get_type
 </SECTION>
 
 <SECTION>
-<FILE>marker</FILE>
-<TITLE>GtkSourceMarker</TITLE>
-<INCLUDE>gtksourceview/gtksourcemarker.h</INCLUDE>
-GtkSourceMarker
-GtkSourceMarkerClass
-gtk_source_marker_get_buffer
-gtk_source_marker_get_name
-gtk_source_marker_get_line
-gtk_source_marker_set_marker_type
-gtk_source_marker_get_marker_type
-gtk_source_marker_next
-gtk_source_marker_prev
-<SUBSECTION Standard>
-GTK_IS_SOURCE_MARKER
-GTK_IS_SOURCE_MARKER_CLASS
-GTK_SOURCE_MARKER
-GTK_SOURCE_MARKER_CLASS
-GTK_SOURCE_MARKER_GET_CLASS
-GTK_TYPE_SOURCE_MARKER
-gtk_source_marker_get_type
+<FILE>mark</FILE>
+<TITLE>GtkSourceMark</TITLE>
+<INCLUDE>gtksourceview/gtksourcemark.h</INCLUDE>
+GtkSourceMark
+gtk_source_mark_new
+gtk_source_mark_get_category
+gtk_source_mark_get_priority
+<SUBSECTION Standard>
+GtkSourceMarkClass
+GTK_IS_SOURCE_MARK
+GTK_IS_SOURCE_MARK_CLASS
+GTK_SOURCE_MARK
+GTK_SOURCE_MARK_CLASS
+GTK_SOURCE_MARK_GET_CLASS
+GTK_TYPE_SOURCE_MARK
+gtk_source_mark_get_type
 </SECTION>
 
 <SECTION>
Index: docs/reference/gtksourceview-2.0.types
===================================================================
--- docs/reference/gtksourceview-2.0.types	(revision 1784)
+++ docs/reference/gtksourceview-2.0.types	(working copy)
@@ -3,6 +3,7 @@
 #include <gtksourceview/gtksourcelanguage.h>
 #include <gtksourceview/gtksourcelanguagemanager.h>
 #include <gtksourceview/gtksourcestyleschememanager.h>
+#include <gtksourceview/gtksourcemark.h>
 
 gtk_source_view_get_type
 gtk_source_buffer_get_type
@@ -11,3 +12,4 @@ gtk_source_language_manager_get_type
 gtk_source_style_get_type
 gtk_source_style_scheme_get_type
 gtk_source_style_scheme_manager_get_type
+gtk_source_mark_get_type
Index: docs/reference/gtksourceview-docs.sgml
===================================================================
--- docs/reference/gtksourceview-docs.sgml	(revision 1784)
+++ docs/reference/gtksourceview-docs.sgml	(working copy)
@@ -15,7 +15,7 @@
     <title>API reference</title>
     <xi:include href="xml/buffer.xml"/>
     <xi:include href="xml/iter.xml"/>
-    <xi:include href="xml/marker.xml"/>
+    <xi:include href="xml/mark.xml"/>
     <xi:include href="xml/view.xml"/>
     <xi:include href="xml/language.xml"/>
     <xi:include href="xml/languagemanager.xml"/>
Index: docs/reference/tmpl/buffer.sgml
===================================================================
--- docs/reference/tmpl/buffer.sgml	(revision 1784)
+++ docs/reference/tmpl/buffer.sgml	(working copy)
@@ -54,7 +54,7 @@ in a view widget.
 @arg1: 
 @arg2: 
 
-<!-- ##### SIGNAL GtkSourceBuffer::marker-updated ##### -->
+<!-- ##### SIGNAL GtkSourceBuffer::source-mark-updated ##### -->
 <para>
 
 </para>
@@ -268,106 +268,6 @@ in a view widget.
 @buffer: 
 
 
-<!-- ##### FUNCTION gtk_source_buffer_create_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@name: 
-@type: 
-@where: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_delete_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@marker: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_move_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@marker: 
-@where: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_get_first_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_get_last_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_get_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@name: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_get_markers_in_region ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@begin: 
-@end: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_get_next_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@iter: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_get_prev_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@iter: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_get_iter_at_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@iter: 
-@marker: 
-
-
 <!-- ##### FUNCTION gtk_source_buffer_ensure_highlight ##### -->
 <para>
 
Index: docs/reference/tmpl/view.sgml
===================================================================
--- docs/reference/tmpl/view.sgml	(revision 1784)
+++ docs/reference/tmpl/view.sgml	(working copy)
@@ -228,7 +228,7 @@ GtkSourceView
 </para>
 
 @view: 
-@marker_type: 
+@category: 
 @pixbuf: 
 
 
@@ -238,7 +238,7 @@ GtkSourceView
 </para>
 
 @view: 
-@marker_type: 
+@category: 
 @Returns: 
 
 
Index: gtksourceview/gtksourcemarker.c
===================================================================
--- gtksourceview/gtksourcemarker.c	(revision 1784)
+++ gtksourceview/gtksourcemarker.c	(working copy)
@@ -1,257 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
- *  gtksourcemarker.c
- *
- *  Copyright (C) 2003 - Gustavo Giráldez <gustavo.giraldez@gmx.net>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Library General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "gtksourcebuffer.h"
-#include "gtksourcemarker.h"
-
-static GQuark quark_marker_type = 0;
-static GQuark quark_next_marker = 0;
-static GQuark quark_prev_marker = 0;
-
-
-GType
-gtk_source_marker_get_type (void)
-{
-	static GType our_type = 0;
-
-	/* this function's solely purpose is to allow us to later
-	 * derive GtkSourceMarker from other base object and not break
-	 * ABI compatibility (since this way the type is resolved at
-	 * runtime) */
-	if (!our_type) {
-		our_type = GTK_TYPE_TEXT_MARK;
-
-		quark_marker_type = g_quark_from_static_string ("gtk-source-marker-type");
-		quark_next_marker = g_quark_from_static_string ("gtk-source-marker-next");
-		quark_prev_marker = g_quark_from_static_string ("gtk-source-marker-prev");
-	}
-
-	return our_type;
-}
-
-void
-gtk_source_marker_set_marker_type (GtkSourceMarker *marker,
-				   const gchar     *type)
-{
-	g_return_if_fail (marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-
-	g_object_set_qdata_full (G_OBJECT (marker), quark_marker_type,
-				 g_strdup (type), (GDestroyNotify) g_free);
-	_gtk_source_marker_changed (marker);
-}
-
-/**
- * gtk_source_marker_get_marker_type:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the marker type of this @marker.
- *
- * Return value: the marker type.
- **/
-gchar *
-gtk_source_marker_get_marker_type (GtkSourceMarker *marker)
-{
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	return g_strdup (g_object_get_qdata (G_OBJECT (marker), quark_marker_type));
-}
-
-/**
- * gtk_source_marker_get_line:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the line number of this @marker.
- *
- * Return value: the line number.
- **/
-gint
-gtk_source_marker_get_line (GtkSourceMarker *marker)
-{
-	GtkTextIter iter;
-
-	g_return_val_if_fail (marker != NULL, -1);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), -1);
-	g_return_val_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)), -1);
-
-	gtk_text_buffer_get_iter_at_mark (gtk_text_mark_get_buffer (GTK_TEXT_MARK (marker)),
-					  &iter, GTK_TEXT_MARK (marker));
-
-	return gtk_text_iter_get_line (&iter);
-}
-
-/**
- * gtk_source_marker_get_name:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the name of this @marker.
- *
- * Return value: the name.
- **/
-const gchar *
-gtk_source_marker_get_name (GtkSourceMarker *marker)
-{
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	return gtk_text_mark_get_name (GTK_TEXT_MARK (marker));
-}
-
-/**
- * gtk_source_marker_get_buffer:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the buffer associated with this @marker.
- *
- * Return value: the #GtkSourceBuffer.
- **/
-gpointer
-gtk_source_marker_get_buffer (GtkSourceMarker *marker)
-{
-	GtkTextBuffer *buffer;
-
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	buffer = gtk_text_mark_get_buffer (GTK_TEXT_MARK (marker));
-
-	if (GTK_IS_SOURCE_BUFFER (buffer))
-		return buffer;
-	else
-		return NULL;
-}
-
-void
-_gtk_source_marker_changed (GtkSourceMarker *marker)
-{
-	GtkSourceBuffer *buffer;
-	GtkTextIter iter;
-
-	g_return_if_fail (marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-
-	buffer = GTK_SOURCE_BUFFER (gtk_text_mark_get_buffer (GTK_TEXT_MARK (marker)));
-
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-					  &iter,
-					  GTK_TEXT_MARK (marker));
-	gtk_text_iter_set_line_offset (&iter, 0);
-
-	g_signal_emit_by_name (buffer, "marker_updated", &iter);
-}
-
-void
-_gtk_source_marker_link (GtkSourceMarker *marker,
-			 GtkSourceMarker *sibling,
-			 gboolean         after_sibling)
-{
-	GtkSourceMarker *tmp;
-
-	g_return_if_fail (marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-
-	if (!sibling)
-		return;
-
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (sibling));
-
-	if (after_sibling)
-	{
-		tmp = g_object_get_qdata (G_OBJECT (sibling), quark_next_marker);
-
-		g_object_set_qdata (G_OBJECT (marker), quark_next_marker, tmp);
-		g_object_set_qdata (G_OBJECT (marker), quark_prev_marker, sibling);
-
-		g_object_set_qdata (G_OBJECT (sibling), quark_next_marker, marker);
-		if (tmp)
-			g_object_set_qdata (G_OBJECT (tmp), quark_prev_marker, marker);
-	}
-	else
-	{
-		tmp = g_object_get_qdata (G_OBJECT (sibling), quark_prev_marker);
-
-		g_object_set_qdata (G_OBJECT (marker), quark_next_marker, sibling);
-		g_object_set_qdata (G_OBJECT (marker), quark_prev_marker, tmp);
-
-		g_object_set_qdata (G_OBJECT (sibling), quark_prev_marker, marker);
-		if (tmp)
-			g_object_set_qdata (G_OBJECT (tmp), quark_next_marker, marker);
-	}
-}
-
-void
-_gtk_source_marker_unlink (GtkSourceMarker *marker)
-{
-	GtkSourceMarker *m1, *m2;
-
-	g_return_if_fail (marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-
-	m1 = g_object_steal_qdata (G_OBJECT (marker), quark_prev_marker);
-	m2 = g_object_steal_qdata (G_OBJECT (marker), quark_next_marker);
-
-	if (m1)
-		g_object_set_qdata (G_OBJECT (m1), quark_next_marker, m2);
-	if (m2)
-		g_object_set_qdata (G_OBJECT (m2), quark_prev_marker, m1);
-}
-
-/**
- * gtk_source_marker_next:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the next marker after @marker.
- *
- * Return value: a #GtkSourceMarker.
- **/
-GtkSourceMarker *
-gtk_source_marker_next (GtkSourceMarker *marker)
-{
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	return g_object_get_qdata (G_OBJECT (marker), quark_next_marker);
-}
-
-/**
- * gtk_source_marker_prev:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the previous marker before @marker.
- *
- * Return value: a #GtkSourceMarker.
- **/
-GtkSourceMarker *
-gtk_source_marker_prev (GtkSourceMarker *marker)
-{
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	return g_object_get_qdata (G_OBJECT (marker), quark_prev_marker);
-}
-
Index: gtksourceview/gtksourcemarker.h
===================================================================
--- gtksourceview/gtksourcemarker.h	(revision 1784)
+++ gtksourceview/gtksourcemarker.h	(working copy)
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
- *  gtksourcemarker.h
- *
- *  Copyright (C) 2003 - Gustavo Giráldez <gustavo.giraldez@gmx.net>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Library General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GTK_SOURCE_MARKER_H__
-#define __GTK_SOURCE_MARKER_H__
-
-#include <gtk/gtktextmark.h>
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SOURCE_MARKER            (gtk_source_marker_get_type ())
-#define GTK_SOURCE_MARKER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SOURCE_MARKER, GtkSourceMarker))
-#define GTK_SOURCE_MARKER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOURCE_MARKER, GtkSourceMarkerClass))
-#define GTK_IS_SOURCE_MARKER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SOURCE_MARKER))
-#define GTK_IS_SOURCE_MARKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOURCE_MARKER))
-#define GTK_SOURCE_MARKER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SOURCE_MARKER, GtkSourceMarkerClass))
-
-typedef GtkTextMark      GtkSourceMarker;
-typedef GtkTextMarkClass GtkSourceMarkerClass;
-
-GType                 gtk_source_marker_get_type        (void) G_GNUC_CONST;
-
-void                  gtk_source_marker_set_marker_type (GtkSourceMarker *marker,
-							 const gchar     *type);
-gchar                *gtk_source_marker_get_marker_type (GtkSourceMarker *marker);
-gint                  gtk_source_marker_get_line        (GtkSourceMarker *marker);
-const gchar	     *gtk_source_marker_get_name        (GtkSourceMarker *marker);
-/* FIXME: move GtkSourceMarker declaration to gtktextbuffer.h? */
-gpointer	      gtk_source_marker_get_buffer      (GtkSourceMarker *marker);
-GtkSourceMarker      *gtk_source_marker_next            (GtkSourceMarker *marker);
-GtkSourceMarker      *gtk_source_marker_prev            (GtkSourceMarker *marker);
-
-/* Private API */
-void                  _gtk_source_marker_changed        (GtkSourceMarker *marker);
-void                  _gtk_source_marker_link           (GtkSourceMarker *marker,
-							 GtkSourceMarker *sibling,
-							 gboolean         after_sibling);
-void                  _gtk_source_marker_unlink         (GtkSourceMarker *marker);
-
-G_END_DECLS
-
-#endif
Index: gtksourceview/gtksourcemark.c
===================================================================
--- gtksourceview/gtksourcemark.c	(revision 0)
+++ gtksourceview/gtksourcemark.c	(revision 0)
@@ -0,0 +1,202 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
+ *  gtksourcebuffer.c
+ *
+ *  Copyright (C) 2007 by:
+ *		Johannes Schmid <jhs@gnome.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Library General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "gtksourcemark.h"
+#include "gtksourcebuffer.h"
+
+enum
+{
+	PROP_0,
+	PROP_CATEGORY
+};
+
+struct _GtkSourceMarkPrivate
+{
+	gchar *category;
+};
+
+G_DEFINE_TYPE (GtkSourceMark, gtk_source_mark, GTK_TYPE_TEXT_MARK);
+
+static void
+gtk_source_mark_set_property (GObject      *object,
+			      guint         prop_id,
+			      const GValue *value,
+			      GParamSpec   *pspec)
+{
+	GtkSourceMarkPrivate *priv;
+
+	g_return_if_fail (GTK_IS_SOURCE_MARK (object));
+
+	priv = GTK_SOURCE_MARK (object)->priv;
+
+	switch (prop_id)
+	{
+		case PROP_CATEGORY:
+			g_free (priv->category);
+			priv->category = g_value_dup_string (value);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object,
+							   prop_id,
+							   pspec);
+	}
+}
+
+static void
+gtk_source_mark_get_property (GObject    *object,
+			      guint       prop_id,
+			      GValue     *value,
+			      GParamSpec *pspec)
+{
+	GtkSourceMark *mark;
+
+	g_return_if_fail (GTK_IS_SOURCE_MARK (object));
+
+	mark = GTK_SOURCE_MARK (object);
+
+	switch (prop_id)
+	{
+		case PROP_CATEGORY:
+			g_value_set_string (value,
+					    gtk_source_mark_get_category (mark));
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object,
+							   prop_id,
+							   pspec);
+	}
+}
+
+static void
+gtk_source_mark_class_init (GtkSourceMarkClass *klass)
+{
+	GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = gtk_source_mark_set_property;
+	object_class->get_property = gtk_source_mark_get_property;
+
+	/**
+	 * GtkSourceMark:category:
+	 *
+	 * The category of the #GtkSourceMark. Controls which pixmap is displayed
+	 * when the mark is added to a #GtkSourceBuffer.
+	 */
+	g_object_class_install_property (object_class,
+					 PROP_CATEGORY,
+					 g_param_spec_string ("category",
+							      "category",
+							      "The marker category",
+							      "",
+							      G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+	
+	g_type_class_add_private (object_class, sizeof (GtkSourceMarkPrivate));
+}
+
+static void
+gtk_source_mark_init (GtkSourceMark *mark)
+{
+	mark->priv = G_TYPE_INSTANCE_GET_PRIVATE (mark, GTK_TYPE_SOURCE_MARK,
+						  GtkSourceMarkPrivate);
+}
+
+/**
+ * gtk_source_mark_new:
+ * @name: Name of the #GtkSourceMark
+ * @category: Type of the #GtkSourceMark, controls which pixmap is displayed
+ *
+ * Creates a new #GtkSourceMark. You normally do not need it an can use 
+ * gtk_source_buffer_create_marker() instead for convenience.
+ *
+ * Return a new #GtkSourceMark that can be added using gtk_text_buffer_add_mark()
+ */
+GtkSourceMark *
+gtk_source_mark_new (const gchar *name,
+		     const gchar *category)
+{
+	return GTK_SOURCE_MARK (g_object_new (GTK_TYPE_SOURCE_MARK, 
+					      "category", category, 
+					      "name", name,
+					      "left-gravity", TRUE,
+					       NULL));
+}
+
+/**
+ * gtk_source_mark_get_category:
+ * @mark: a #GtkSourceMark
+ *
+ * Returns the category of the #GtkSourceMark
+ */
+const gchar *
+gtk_source_mark_get_category (GtkSourceMark *mark)
+{
+	g_return_val_if_fail (GTK_IS_SOURCE_MARK (mark), NULL);
+
+	return mark->priv->category;
+}
+
+/**
+ * gtk_source_mark_next:
+ * @mark: a #GtkSourceMark
+ * @category: a string specifying the mark category or %NULL
+ *
+ * Returns the next #GtkSourceMark in the buffer or %NULL if the mark
+ * was not added to a buffer.
+ */
+GtkSourceMark *
+gtk_source_mark_next (GtkSourceMark *mark,
+		      const gchar   *category)
+{
+	GtkTextBuffer *buffer;
+
+	g_return_val_if_fail (GTK_IS_SOURCE_MARK (mark), NULL);
+
+	buffer = gtk_text_mark_get_buffer (GTK_TEXT_MARK (mark));
+	if (buffer != NULL)
+		return _gtk_source_buffer_mark_next (GTK_SOURCE_BUFFER (buffer),
+						     mark, category);
+	else
+		return NULL;
+}
+
+/**
+ * gtk_source_mark_prev:
+ * @mark: a #GtkSourceMark
+ * @category: a string specifying the mark category or %NULL
+ *
+ * Returns the previous #GtkSourceMark in the buffer or %NULL if the mark
+ * was not added to a buffer.
+ */
+GtkSourceMark *
+gtk_source_mark_prev (GtkSourceMark *mark,
+		      const gchar   *category)
+{
+	GtkTextBuffer *buffer;
+
+	g_return_val_if_fail (GTK_IS_SOURCE_MARK (mark), NULL);
+
+	buffer = gtk_text_mark_get_buffer (GTK_TEXT_MARK (mark));
+	if (buffer != NULL)
+		return _gtk_source_buffer_mark_prev (GTK_SOURCE_BUFFER (buffer),
+						     mark, category);
+	else
+		return NULL;
+}
+
Index: gtksourceview/gtksourcemark.h
===================================================================
--- gtksourceview/gtksourcemark.h	(revision 0)
+++ gtksourceview/gtksourcemark.h	(revision 0)
@@ -0,0 +1,72 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
+ *  gtksourcebuffer.c
+ *
+ *  Copyright (C) 2007 by:
+ *		Johannes Schmid <jhs@gnome.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Library General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTKSOURCEMARK_H__
+#define __GTKSOURCEMARK_H__
+
+#include <gtk/gtk.h>
+#include <gtk/gtktextmark.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_SOURCE_MARK             (gtk_source_mark_get_type ())
+#define GTK_SOURCE_MARK(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SOURCE_MARK, GtkSourceMark))
+#define GTK_SOURCE_MARK_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOURCE_MARK, GtkSourceMarkClass))
+#define GTK_IS_SOURCE_MARK(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SOURCE_MARK))
+#define GTK_IS_SOURCE_MARK_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOURCE_MARK))
+#define GTK_SOURCE_MARK_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SOURCE_MARK, GtkSourceMarkClass))
+
+typedef struct _GtkSourceMark GtkSourceMark;
+typedef struct _GtkSourceMarkClass GtkSourceMarkClass;
+
+typedef struct _GtkSourceMarkPrivate GtkSourceMarkPrivate;
+
+struct _GtkSourceMark
+{
+	GtkTextMark parent_instance;
+
+	GtkSourceMarkPrivate *priv;
+};
+
+struct _GtkSourceMarkClass
+{
+	GtkTextMarkClass parent_class;
+
+	/* Padding for future expansion */
+	void (*_gtk_source_reserved1) (void);
+	void (*_gtk_source_reserved2) (void);
+};
+
+GType		 gtk_source_mark_get_type (void) G_GNUC_CONST;
+
+GtkSourceMark   *gtk_source_mark_new		(const gchar	*name, 
+						 const gchar	*category);
+
+const gchar	*gtk_source_mark_get_category	(GtkSourceMark	*mark);
+
+GtkSourceMark	*gtk_source_mark_next		(GtkSourceMark	*mark,
+						 const gchar	*category);
+GtkSourceMark	*gtk_source_mark_prev		(GtkSourceMark	*mark,
+						 const gchar	*category);
+
+G_END_DECLS
+
+#endif /* __GTKSOURCEMARK_H__ */
Index: gtksourceview/gtksourcebuffer.c
===================================================================
--- gtksourceview/gtksourcebuffer.c	(revision 1784)
+++ gtksourceview/gtksourcebuffer.c	(working copy)
@@ -64,7 +64,7 @@
 /* Signals */
 enum {
 	HIGHLIGHT_UPDATED,
-	MARKER_UPDATED,
+	SOURCE_MARK_UPDATED,
 	LAST_SIGNAL
 };
 
@@ -89,7 +89,7 @@ struct _GtkSourceBufferPrivate
 	GtkTextMark           *bracket_mark;
 	guint                  bracket_found:1;
 
-	GArray                *markers;
+	GArray                *source_marks;
 
 	GtkSourceLanguage     *language;
 
@@ -98,10 +98,9 @@ struct _GtkSourceBufferPrivate
 
 	GtkSourceUndoManager  *undo_manager;
 };
-
+	
 G_DEFINE_TYPE (GtkSourceBuffer, gtk_source_buffer, GTK_TYPE_TEXT_BUFFER)
 
-
 static guint 	 buffer_signals[LAST_SIGNAL];
 
 static void 	 gtk_source_buffer_finalize		(GObject                 *object);
@@ -114,19 +113,12 @@ static void      gtk_source_buffer_get_p
 							 guint                    prop_id,
 							 GValue                  *value,
 							 GParamSpec              *pspec);
-
 static void 	 gtk_source_buffer_can_undo_handler 	(GtkSourceUndoManager    *um,
 							 gboolean                 can_undo,
 							 GtkSourceBuffer         *buffer);
 static void 	 gtk_source_buffer_can_redo_handler	(GtkSourceUndoManager    *um,
 							 gboolean                 can_redo,
 							 GtkSourceBuffer         *buffer);
-
-static void 	 gtk_source_buffer_move_cursor		(GtkTextBuffer           *buffer,
-							 const GtkTextIter       *iter,
-							 GtkTextMark             *mark,
-							 gpointer                 data);
-
 static void 	 gtk_source_buffer_real_insert_text 	(GtkTextBuffer           *buffer,
 							 GtkTextIter             *iter,
 							 const gchar             *text,
@@ -134,7 +126,11 @@ static void 	 gtk_source_buffer_real_ins
 static void 	 gtk_source_buffer_real_delete_range 	(GtkTextBuffer           *buffer,
 							 GtkTextIter             *iter,
 							 GtkTextIter             *end);
-
+static void 	 gtk_source_buffer_real_mark_set	(GtkTextBuffer		 *buffer,
+							 const GtkTextIter	 *location,
+							 GtkTextMark		 *mark);
+static void 	 gtk_source_buffer_real_mark_deleted	(GtkTextBuffer		 *buffer,
+							 GtkTextMark		 *mark);
 static gboolean	 gtk_source_buffer_find_bracket_match_with_limit (GtkTextIter    *orig,
 								  gint            max_chars);
 
@@ -155,8 +151,11 @@ gtk_source_buffer_class_init (GtkSourceB
 
 	/* Do not set these signals handlers directly on the parent_class since
 	 * that will cause problems (a loop). */
+	tb_class->delete_range  = gtk_source_buffer_real_delete_range;
 	tb_class->insert_text 	= gtk_source_buffer_real_insert_text;
-	tb_class->delete_range 	= gtk_source_buffer_real_delete_range;
+	
+	tb_class->mark_set	= gtk_source_buffer_real_mark_set;
+	tb_class->mark_deleted	= gtk_source_buffer_real_mark_deleted;
 
 	/**
 	 * GtkSourceBuffer:highlight-syntax:
@@ -256,15 +255,15 @@ gtk_source_buffer_class_init (GtkSourceB
 			   G_TYPE_NONE,
 			   2, param_types);
 
-	buffer_signals[MARKER_UPDATED] =
-	    g_signal_newv ("marker_updated",
+	buffer_signals[SOURCE_MARK_UPDATED] =
+	    g_signal_new ("source_mark_updated",
 			   G_OBJECT_CLASS_TYPE (object_class),
 			   G_SIGNAL_RUN_LAST,
-			   NULL,
+			   0,
 			   NULL, NULL,
-			   _gtksourceview_marshal_VOID__BOXED,
+			   g_cclosure_marshal_VOID__OBJECT,
 			   G_TYPE_NONE,
-			   1, param_types);
+			   1, GTK_TYPE_TEXT_MARK);
 
 	g_type_class_add_private (object_class, sizeof(GtkSourceBufferPrivate));
 }
@@ -286,16 +285,12 @@ gtk_source_buffer_init (GtkSourceBuffer 
 	priv->bracket_mark = NULL;
 	priv->bracket_found = FALSE;
 
-	priv->markers = g_array_new (FALSE, FALSE, sizeof (GtkSourceMarker *));
+	priv->source_marks = g_array_new (FALSE, FALSE, sizeof (GtkSourceMark *));
 
 	priv->style_scheme = _gtk_source_style_scheme_get_default ();
 	if (priv->style_scheme != NULL)
 		g_object_ref (priv->style_scheme);
 
-	g_signal_connect (buffer,
-			  "mark_set",
-			  G_CALLBACK (gtk_source_buffer_move_cursor),
-			  NULL);
 	g_signal_connect (priv->undo_manager,
 			  "can_undo",
 			  G_CALLBACK (gtk_source_buffer_can_undo_handler),
@@ -317,8 +312,8 @@ gtk_source_buffer_finalize (GObject *obj
 	buffer = GTK_SOURCE_BUFFER (object);
 	g_return_if_fail (buffer->priv != NULL);
 
-	if (buffer->priv->markers)
-		g_array_free (buffer->priv->markers, TRUE);
+	if (buffer->priv->source_marks)
+		g_array_free (buffer->priv->source_marks, TRUE);
 
 	G_OBJECT_CLASS (gtk_source_buffer_parent_class)->finalize (object);
 }
@@ -551,8 +546,7 @@ get_bracket_match_tag (GtkSourceBuffer *
 static void
 gtk_source_buffer_move_cursor (GtkTextBuffer     *buffer,
 			       const GtkTextIter *iter,
-			       GtkTextMark       *mark,
-			       gpointer           data)
+			       GtkTextMark       *mark)
 {
 	GtkTextIter iter1, iter2;
 
@@ -630,12 +624,11 @@ gtk_source_buffer_real_insert_text (GtkT
 	 * default signal handler revalidates it to point to the end of the
 	 * inserted text
 	 */
-	GTK_TEXT_BUFFER_CLASS(gtk_source_buffer_parent_class)->insert_text (buffer, iter, text, len);
+	GTK_TEXT_BUFFER_CLASS (gtk_source_buffer_parent_class)->insert_text (buffer, iter, text, len);
 
 	gtk_source_buffer_move_cursor (buffer,
 				       iter,
-				       gtk_text_buffer_get_insert (buffer),
-				       NULL);
+				       gtk_text_buffer_get_insert (buffer));
 
 	end_offset = gtk_text_iter_get_offset (iter);
 
@@ -653,7 +646,6 @@ gtk_source_buffer_real_delete_range (Gtk
 	gint offset, length;
 	GtkTextMark *mark;
 	GtkTextIter iter;
-	GSList *markers;
 	GtkSourceBuffer *source_buffer = GTK_SOURCE_BUFFER (buffer);
 
 	g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
@@ -666,52 +658,16 @@ gtk_source_buffer_real_delete_range (Gtk
 	offset = gtk_text_iter_get_offset (start);
 	length = gtk_text_iter_get_offset (end) - offset;
 
-	/* remove the markers in the deleted region if deleting more than one character */
-	if (length > 1)
-	{
-		markers = gtk_source_buffer_get_markers_in_region (GTK_SOURCE_BUFFER (buffer),
-								   start, end);
-		while (markers)
-		{
-			gtk_source_buffer_delete_marker (GTK_SOURCE_BUFFER (buffer), markers->data);
-			markers = g_slist_delete_link (markers, markers);
-		}
-	}
-
-	GTK_TEXT_BUFFER_CLASS(gtk_source_buffer_parent_class)->delete_range (buffer, start, end);
+	GTK_TEXT_BUFFER_CLASS (gtk_source_buffer_parent_class)->delete_range (buffer, start, end);
 
 	mark = gtk_text_buffer_get_insert (buffer);
 	gtk_text_buffer_get_iter_at_mark (buffer, &iter, mark);
-
-	gtk_source_buffer_move_cursor (buffer,
-				       &iter,
-				       mark,
-				       NULL);
-
-	/* move any markers which moved to this line because of the
-	 * deletion to the beginning of the line */
-	iter = *start;
-	if (!gtk_text_iter_ends_line (&iter))
-		gtk_text_iter_forward_to_line_end (&iter);
-	markers = gtk_source_buffer_get_markers_in_region (GTK_SOURCE_BUFFER (buffer),
-							   start, &iter);
-	if (markers)
-	{
-		GSList *m;
-
-		gtk_text_iter_set_line_offset (&iter, 0);
-		for (m = markers; m; m = g_slist_next (m))
-			gtk_source_buffer_move_marker (GTK_SOURCE_BUFFER (buffer),
-						       GTK_SOURCE_MARKER (m->data),
-						       &iter);
-		g_slist_free (markers);
-	}
+	gtk_source_buffer_move_cursor (buffer, &iter, mark);
 
 	/* emit text deleted for engines */
 	if (source_buffer->priv->highlight_engine != NULL)
 		_gtk_source_engine_text_deleted (source_buffer->priv->highlight_engine,
-						 offset,
-						 length);
+						 offset, length);
 }
 
 /* FIXME: this can't be here, but it's now needed for bracket matching */
@@ -1306,40 +1262,60 @@ gtk_source_buffer_get_style_scheme (GtkS
 	return buffer->priv->style_scheme;
 }
 
-/* Markers functionality */
+/* Source Marks functionality */
 
-/**
- * markers_binary_search:
- * @buffer: the GtkSourceBuffer where the markers are.
- * @iter: the position to search for.
- * @last_cmp: where to return the value of the last comparision made (optional).
- *
- * Performs a binary search among the markers in @buffer for the
- * position of the @iter.  Returns the nearest matching marker (its
- * index in the markers array) and optionally the value of the
- * comparision between the returned marker and the given iter.
+/* At the moment this is pretty dumb (O(N)), if it is a performance
+ * problem we should change data struct.
+ * Since it's used from mark_set when the mark was moved, we cannot bsearch.
+ * Returns TRUE if the mark was found and removed */
+static gboolean
+source_mark_remove (GtkSourceBuffer *buffer, GtkSourceMark *mark)
+{
+	gint i;
+
+	for (i = 0; i < buffer->priv->source_marks->len; ++i)
+	{
+		GtkSourceMark *m;
+
+		m = g_array_index (buffer->priv->source_marks, GtkSourceMark *, i);
+		if (mark == m)
+		{
+			g_array_remove_index (buffer->priv->source_marks, i);
+			g_object_unref (m);
+
+			return TRUE;
+		}
+	}
+
+	return FALSE;
+}
+
+/* Performs a binary search among the source marks in @buffer for the
+ * position of the @iter.  Returns the nearest matching mark (its
+ * index in the marks array) and optionally the value of the
+ * comparision between the given iter and the iter at the returned mark.
  *
- * Return value: an index in the markers array or -1 if the array is
+ * Return value: an index in the source marks array or -1 if the array is
  * empty.
- **/
+ */
 static gint
-markers_binary_search (GtkSourceBuffer *buffer, GtkTextIter *iter, gint *last_cmp)
+source_mark_bsearch (GtkSourceBuffer *buffer, GtkTextIter *iter, gint *last_cmp)
 {
 	GtkTextIter check_iter;
-	GtkSourceMarker **check, **p;
-	GArray *markers = buffer->priv->markers;
-	gint n_markers = markers->len;
+	GtkSourceMark **check, **p;
+	GArray *marks = buffer->priv->source_marks;
+	gint n_marks = marks->len;
 	gint cmp, i;
 
-	if (n_markers == 0)
+	if (n_marks == 0)
 		return -1;
 
-	check = p = &g_array_index (markers, GtkSourceMarker *, 0);
+	check = p = &g_array_index (marks, GtkSourceMark *, 0);
 	p--;
 	cmp = 0;
-	while (n_markers)
+	while (n_marks)
 	{
-		i = (n_markers + 1) >> 1;
+		i = (n_marks + 1) >> 1;
 		check = p + i;
 		gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
 						  &check_iter,
@@ -1347,648 +1323,390 @@ markers_binary_search (GtkSourceBuffer *
 		cmp = gtk_text_iter_compare (iter, &check_iter);
 		if (cmp > 0)
 		{
-			n_markers -= i;
+			n_marks -= i;
 			p = check;
 		}
 		else if (cmp < 0)
-			n_markers = i - 1;
+			n_marks = i - 1;
 		else /* if (cmp == 0) */
 			break;
 	}
 
-	i = check - &g_array_index (markers, GtkSourceMarker *, 0);
+	i = check - &g_array_index (marks, GtkSourceMark *, 0);
 	if (last_cmp)
 		*last_cmp = cmp;
 
 	return i;
 }
 
-/**
- * markers_linear_lookup:
- * @buffer: the source buffer where the markers are.
- * @marker: which marker to search for.
- * @start: index from where to start looking.
- * @direction: direction to search for.
- *
- * Searches the markers array of @buffer starting from @start for
- * markers at the same position as the one at @start.  If @marker is
- * non-%NULL search for that marker specifically, otherwise return the
- * first or the last marker at the staring position, depending on
- * @direction.
- *
- * @direction < 0 means left, @direction > 0 means right,
- * 0 means both and is mostly useful when looking for a specific
- * @marker.
- *
- * Return value: the index of the searched marker.
- **/
-static gint
-markers_linear_lookup (GtkSourceBuffer *buffer,
-		       GtkSourceMarker *marker,
-		       gint             start,
-		       gint             direction)
-{
-	GArray *markers = buffer->priv->markers;
-	gint left, right;
-	gint cmp;
+static void
+source_mark_insert (GtkSourceBuffer *buffer, GtkSourceMark *mark)
+{
 	GtkTextIter iter;
-	GtkSourceMarker *tmp;
-
-	tmp = g_array_index (markers, GtkSourceMarker *, start);
-	if (tmp == marker)
-		return start;
+	gint index, cmp;
 
 	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
 					  &iter,
-					  GTK_TEXT_MARK (tmp));
+					  GTK_TEXT_MARK (mark));
 
-	if (direction == 0)
-	{
-		left = start - 1;
-		right = start + 1;
-	}
-	else if (direction > 0)
+	index = source_mark_bsearch (buffer, &iter, &cmp);
+	if (index >= 0)
 	{
-		left = -1;
-		right = start + 1;
+		/* if the mark we found is at same iter or before
+		 * put our mark after that */
+		if (cmp >= 0)
+			index++;
 	}
 	else
 	{
-		left = start - 1;
-		right = markers->len;
+		index = 0;
 	}
 
-	while (left >= 0 || right < markers->len)
-	{
-		GtkTextIter iter_tmp;
-
-		if (left >= 0)
-		{
-			tmp = g_array_index (markers, GtkSourceMarker *, left);
-			if (tmp == marker)
-				return left;
+	g_object_ref (mark);
+	g_array_insert_val (buffer->priv->source_marks, index, mark);
+}
 
-			gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-							  &iter_tmp,
-							  GTK_TEXT_MARK (tmp));
-			cmp = gtk_text_iter_compare (&iter, &iter_tmp);
-			if (cmp != 0)
-			{
-				if (marker)
-					/* searching for a particular marker */
-					left = -1;
-				else
-					/* searching for the first
-					 * marker at a given
-					 * position */
-					return left + 1;
-			} else
-				left--;
-		}
+static void
+gtk_source_buffer_real_mark_set	(GtkTextBuffer     *buffer,
+				 const GtkTextIter *location,
+				 GtkTextMark       *mark)
+{
+	if (GTK_IS_SOURCE_MARK (mark))
+	{
+		/* for now we simply remove and reinsert at
+		 * the right place every time */
+		source_mark_remove (GTK_SOURCE_BUFFER (buffer),
+				    GTK_SOURCE_MARK (mark));
+		source_mark_insert (GTK_SOURCE_BUFFER (buffer),
+				    GTK_SOURCE_MARK (mark));
 
-		if (right < markers->len)
-		{
-			tmp = g_array_index (markers, GtkSourceMarker *, right);
-			if (tmp == marker)
-				return right;
+		g_signal_emit_by_name (buffer, "source_mark_updated", mark);
+	}
 
-			gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-							  &iter_tmp,
-							  GTK_TEXT_MARK (tmp));
-			cmp = gtk_text_iter_compare (&iter, &iter_tmp);
-			if (cmp != 0)
-			{
-				if (marker)
-					/* searching for a particular marker */
-					right = markers->len;
-				else
-					/* searching for the last
-					 * marker at a given
-					 * position */
-					return right - 1;
-			}
-			else
-				right++;
-		}
+	/* if the mark is the insert mark, update bracket matching */
+	else if (mark == gtk_text_buffer_get_insert (buffer))
+	{
+		gtk_source_buffer_move_cursor (buffer, location, mark);
 	}
-	if (marker)
-		return -1;
-	else
-		return start;
+
+	GTK_TEXT_BUFFER_CLASS (gtk_source_buffer_parent_class)->mark_set (buffer, location, mark);
 }
 
-static void
-markers_insert (GtkSourceBuffer *buffer, GtkSourceMarker *marker)
+static void 	 
+gtk_source_buffer_real_mark_deleted (GtkTextBuffer *buffer,
+				     GtkTextMark *mark)
 {
-	GtkTextIter iter;
-	gint index, cmp;
-
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-					  &iter,
-					  GTK_TEXT_MARK (marker));
-
-	index = markers_binary_search (buffer, &iter, &cmp);
-	if (index >= 0)
+	if (GTK_IS_SOURCE_MARK (mark))
 	{
-		_gtk_source_marker_link (marker, g_array_index (buffer->priv->markers,
-								GtkSourceMarker *,
-								index),	(cmp > 0));
-		if (cmp > 0)
-			index++;
+		source_mark_remove (GTK_SOURCE_BUFFER (buffer),
+				    GTK_SOURCE_MARK (mark));
+
+		g_signal_emit_by_name (buffer, "source_mark_updated", mark);
 	}
-	else
-		index = 0;
 
-	g_array_insert_val (buffer->priv->markers, index, marker);
+	if (GTK_TEXT_BUFFER_CLASS (gtk_source_buffer_parent_class)->mark_deleted != NULL)
+		GTK_TEXT_BUFFER_CLASS (gtk_source_buffer_parent_class)->mark_deleted (buffer, mark);
 }
 
 /**
- * gtk_source_buffer_create_marker:
+ * gtk_source_buffer_create_mark:
  * @buffer: a #GtkSourceBuffer.
- * @name: the name of the marker, or %NULL.
- * @type: a string defining the marker type, or %NULL.
- * @where: location to place the marker.
- *
- * Creates a marker in the @buffer of type @type.  A marker is
- * semantically very similar to a #GtkTextMark, except it has a type
- * which is used by the #GtkSourceView displaying the buffer to show a
- * pixmap on the left margin, at the line the marker is in.  Because
- * of this, a marker is generally associated to a line and not a
- * character position.  Markers are also accessible through a position
- * or range in the buffer.
- *
- * Markers are implemented using #GtkTextMark, so all characteristics
- * and restrictions to marks apply to markers too.  These includes
- * life cycle issues and "mark-set" and "mark-deleted" signal
- * emissions.
+ * @name: the name of the mark, or %NULL.
+ * @category: a string defining the mark category.
+ * @where: location to place the mark.
  *
- * Like a #GtkTextMark, a #GtkSourceMarker can be anonymous if the
- * passed @name is %NULL.  Also, the buffer owns the markers so you
+ * Creates a source mark in the @buffer of category @category.  A source mark is
+ * a #GtkTextMark, but it displays a pixmap in the margin.
+ *
+ * Like a #GtkTextMark, a #GtkSourceMark can be anonymous if the
+ * passed @name is %NULL.  Also, the buffer owns the marks so you
  * shouldn't unreference it.
  *
- * Markers always have left gravity and are moved to the beginning of
- * the line when the user deletes the line they were in.  Also, if the
- * user deletes a region of text which contained lines with markers,
- * those are deleted.
+ * Marks always have left gravity and are moved to the beginning of
+ * the line when the user deletes the line they were in.
  *
- * Typical uses for a marker are bookmarks, breakpoints, current
+ * Typical uses for a source mark are bookmarks, breakpoints, current
  * executing instruction indication in a source file, etc..
  *
- * Return value: a new #GtkSourceMarker, owned by the buffer.
+ * Return value: a new #GtkSourceMark, owned by the buffer.
  **/
-GtkSourceMarker *
-gtk_source_buffer_create_marker (GtkSourceBuffer   *buffer,
-				 const gchar       *name,
-				 const gchar       *type,
-				 const GtkTextIter *where)
+GtkSourceMark *
+gtk_source_buffer_create_mark (GtkSourceBuffer   *buffer,
+			       const gchar       *name,
+			       const gchar       *category,
+			       const GtkTextIter *where)
 {
-	GtkTextMark *text_mark;
+	GtkSourceMark *mark;
 
-	g_return_val_if_fail (buffer != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
+	g_return_val_if_fail (category != NULL, NULL);
 	g_return_val_if_fail (where != NULL, NULL);
 
-	text_mark = gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (buffer),
-						 name,
-						 where,
-						 TRUE);
-	if (text_mark)
-	{
-		g_object_ref (text_mark);
-
-		gtk_source_marker_set_marker_type (GTK_SOURCE_MARKER (text_mark), type);
-		markers_insert (buffer, GTK_SOURCE_MARKER (text_mark));
-		_gtk_source_marker_changed (GTK_SOURCE_MARKER (text_mark));
-
-		return GTK_SOURCE_MARKER (text_mark);
-	}
-
-	return NULL;
+	mark = gtk_source_mark_new (name, category);
+	gtk_text_buffer_add_mark (GTK_TEXT_BUFFER (buffer),
+				  GTK_TEXT_MARK (mark),
+				  where);
+
+	return mark;
 }
 
-static gint
-markers_lookup (GtkSourceBuffer *buffer, GtkSourceMarker *marker)
+GtkSourceMark *
+_gtk_source_buffer_mark_next (GtkSourceBuffer *buffer,
+			      GtkSourceMark   *mark,
+			      const gchar     *category)
 {
-	gint index, cmp;
 	GtkTextIter iter;
+	gint index, cmp;
 
+	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
+
+	/* TODO: we could speed this up by caching the current
+	 * position in the mark and invalidating the cache when
+	 * the marks array changes. For now we always lookup. */
 	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
 					  &iter,
-					  GTK_TEXT_MARK (marker));
+					  GTK_TEXT_MARK (mark));
 
-	index = markers_binary_search (buffer, &iter, &cmp);
-	if (index >= 0 && cmp == 0)
-	{
-		if (g_array_index (buffer->priv->markers,
-				   GtkSourceMarker *,
-				   index) == marker)
-			return index;
-		return markers_linear_lookup (buffer, marker, index, 0);
-	}
-	return -1;
-}
+	index = source_mark_bsearch (buffer, &iter, &cmp);
 
-/**
- * gtk_source_buffer_move_marker:
- * @buffer: a #GtkSourceBuffer.
- * @marker: a #GtkSourceMarker in @buffer.
- * @where: the new location for the marker.
- *
- * Moves @marker to the new location @where.
- **/
-void
-gtk_source_buffer_move_marker (GtkSourceBuffer   *buffer,
-			       GtkSourceMarker   *marker,
-			       const GtkTextIter *where)
-{
-	gint index;
+	/* the array should already contain @mark */
+	g_return_val_if_fail (index >= 0, NULL);
+	g_return_val_if_fail (cmp == 0, NULL);
 
-	g_return_if_fail (buffer != NULL && marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-	g_return_if_fail (where != NULL);
-
-	index = markers_lookup (buffer, marker);
-
-	g_return_if_fail (index >= 0);
-
-	/* unlink the marker first */
-	_gtk_source_marker_changed (marker);
-	_gtk_source_marker_unlink (marker);
-	g_array_remove_index (buffer->priv->markers, index);
+	/* move up to our mark among the ones at this position */
+	while (mark != g_array_index (buffer->priv->source_marks, GtkSourceMark *, index))
+	{
+		++index;
+	}
 
-	gtk_text_buffer_move_mark (GTK_TEXT_BUFFER (buffer),
-				   GTK_TEXT_MARK (marker),
-				   where);
+	while (++index < buffer->priv->source_marks->len)
+	{
+		GtkSourceMark *ret;
 
-	/* re-link the marker using the new position */
-	markers_insert (buffer, marker);
+		ret = g_array_index (buffer->priv->source_marks, GtkSourceMark *, index);
+		if (category == NULL || strcmp (category, gtk_source_mark_get_category (ret)) == 0)
+			return ret;
+	}
 
-	/* FIXME: emit even the line number hasn't changed? - Gustavo */
-	_gtk_source_marker_changed (marker);
+	return NULL;
 }
 
-/**
- * gtk_source_buffer_delete_marker:
- * @buffer: a #GtkSourceBuffer.
- * @marker: a #GtkSourceMarker in the @buffer.
- *
- * Deletes @marker from the source buffer.  The same conditions as for
- * #GtkTextMark apply here.  The marker is no longer accessible from
- * the buffer, but if you held a reference to it, it will not be
- * destroyed.
- **/
-void
-gtk_source_buffer_delete_marker (GtkSourceBuffer *buffer,
-				 GtkSourceMarker *marker)
+GtkSourceMark *
+_gtk_source_buffer_mark_prev (GtkSourceBuffer *buffer,
+			      GtkSourceMark   *mark,
+			      const gchar     *category)
 {
-	gint index;
-
-	g_return_if_fail (buffer != NULL && marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-
-	index = markers_lookup (buffer, marker);
+	GtkTextIter iter;
+	gint index, cmp;
 
-	g_return_if_fail (index >= 0);
+	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
 
-	_gtk_source_marker_changed (marker);
-	_gtk_source_marker_unlink (marker);
-	g_array_remove_index (buffer->priv->markers, index);
+	/* TODO: we could speed this up by caching the current
+	 * position in the mark and invalidating the cache when
+	 * the marks array changes. For now we always lookup. */
+	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
+					  &iter,
+					  GTK_TEXT_MARK (mark));
 
-	g_object_unref (marker);
-	gtk_text_buffer_delete_mark (GTK_TEXT_BUFFER (buffer),
-				     GTK_TEXT_MARK (marker));
-}
+	index = source_mark_bsearch (buffer, &iter, &cmp);
 
-/**
- * gtk_source_buffer_get_marker:
- * @buffer: a #GtkSourceBuffer.
- * @name: name of the marker to retrieve.
- *
- * Looks up the #GtkSourceMarker named @name in @buffer, returning
- * %NULL if it doesn't exists.
- *
- * Return value: the #GtkSourceMarker whose name is @name, or %NULL.
- **/
-GtkSourceMarker *
-gtk_source_buffer_get_marker (GtkSourceBuffer *buffer,
-			      const gchar     *name)
-{
-	GtkTextMark *text_mark;
+	/* the array should already contain @mark */
+	g_return_val_if_fail (index >= 0, NULL);
+	g_return_val_if_fail (cmp == 0, NULL);
 
-	g_return_val_if_fail (buffer != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
-	g_return_val_if_fail (name != NULL, NULL);
+	/* move up to our mark among the ones at this position */
+	while (mark != g_array_index (buffer->priv->source_marks, GtkSourceMark *, index))
+	{
+		++index;
+	}
 
-	text_mark = gtk_text_buffer_get_mark (GTK_TEXT_BUFFER (buffer), name);
+	while (--index >= 0)
+	{
+		GtkSourceMark *ret;
 
-	if (text_mark && markers_lookup (buffer, GTK_SOURCE_MARKER (text_mark)) < 0)
-		text_mark = NULL;
+		ret = g_array_index (buffer->priv->source_marks, GtkSourceMark *, index);
+		if (category == NULL || strcmp (category, gtk_source_mark_get_category (ret)) == 0)
+			return ret;
+	}
 
-	if (text_mark)
-		return GTK_SOURCE_MARKER (text_mark);
-	else
-		return NULL;
+	return NULL;
 }
 
-#ifdef ENABLE_DEBUG
-static void
-marker_print (GtkSourceBuffer *buffer, GtkSourceMarker *marker)
+GSList *
+gtk_source_buffer_get_marks_at_iter (GtkSourceBuffer *buffer,
+				     GtkTextIter     *iter,
+				     const gchar     *category)
 {
-	GtkTextIter iter;
-	gchar *type;
+	GSList *marks, *l, *res;
 
-	type = gtk_source_marker_get_marker_type (marker);
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer), &iter, marker);
+	res = NULL;
+	marks = gtk_text_iter_get_marks (iter);
 
-	g_print ("Marker [%p] at %d (type: %s)\n",
-		 marker,
-		 gtk_text_iter_get_offset (&iter),
-		 type);
-	g_free (type);
-}
+	for (l = marks; l != NULL; l = l->next)
+	{
+		GtkSourceMark *mark;
 
-static void
-markers_debug (GtkSourceBuffer *buffer)
-{
-	GtkSourceMarker *marker, *tmp;
-	GArray *markers = buffer->priv->markers;
-	gint i;
+		if (!GTK_IS_SOURCE_MARK (l->data))
+			continue;
 
-	if (markers->len == 0)
-	{
-		g_print ("No markers\n");
-		return;
+		mark = GTK_SOURCE_MARK (l->data);
+		if (category == NULL || strcmp (category, gtk_source_mark_get_category (mark)))
+		{
+			res = g_slist_prepend (res, l->data);
+		}
 	}
 
-	g_print ("Array contents:\n");
-	for (i = 0; i < markers->len; i++)
-		marker_print (buffer, g_array_index (markers, GtkSourceMarker *, i));
-
-	g_print ("Linked list:\n");
-	marker = g_array_index (markers, GtkSourceMarker *, 0);
-
-	while ((tmp = gtk_source_marker_prev (marker)) != NULL)
-		marker = tmp;
-	while (marker)
-	{
-		marker_print (buffer, marker);
-		marker = gtk_source_marker_next (marker);
-	}
+	return g_slist_reverse (res);
 }
-#endif
 
 /**
- * gtk_source_buffer_get_markers_in_region:
+ * gtk_source_buffer_get_next_mark:
  * @buffer: a #GtkSourceBuffer.
- * @begin: beginning of the range.
- * @end: end of the range.
+ * @iter: the location to start searching from.
+ * @category: category to search for
  *
- * Returns an <emphasis>ordered</emphasis> (by position) #GSList of
- * #GtkSourceMarker objects inside the region delimited by the
- * #GtkTextIter @begin and @end.  The iters may be in any order.
+ * Returns the nearest source mark to the right of @iter or at @iter itself
+ * if there are marks at the given iter. If there are
+ * multiple markers at the same position, this function will always
+ * return the first one (from the internal list), even if
+ * starting the search exactly at its location.  You can get the
+ * others using gtk_source_mark_next().
  *
- * Return value: a #GSList of the #GtkSourceMarker inside the range.
+ * Return value: the #GtkSourceMarker nearest to the right of @iter,
+ * or %NULL if there are no more markers after @iter.
  **/
-GSList *
-gtk_source_buffer_get_markers_in_region (GtkSourceBuffer   *buffer,
-					 const GtkTextIter *begin,
-					 const GtkTextIter *end)
+GtkSourceMark *
+gtk_source_buffer_get_next_mark (GtkSourceBuffer *buffer,
+				 GtkTextIter     *iter,
+				 const gchar     *category)
 {
-	GSList *result;
-	GtkTextIter iter1, iter2;
-	gint i, j, cmp;
-	GArray *markers;
+	gint index, cmp;
 
-	g_return_val_if_fail (buffer != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
-	g_return_val_if_fail (begin != NULL && end != NULL, NULL);
-
-	DEBUG (g_print ("Getting markers for [%d,%d]\n",
-			gtk_text_iter_get_offset (begin),
-			gtk_text_iter_get_offset (end)));
-	DEBUG (markers_debug (buffer));
-
-	iter1 = *begin;
-	iter2 = *end;
-	gtk_text_iter_order (&iter1, &iter2);
-
-	result = NULL;
-	markers = buffer->priv->markers;
+	g_return_val_if_fail (iter != NULL, NULL);
 
-	i = markers_binary_search (buffer, &iter1, &cmp);
-	if (i < 0)
+	index = source_mark_bsearch (buffer, iter, &cmp);
+	if (index < 0)
 		return NULL;
 
-	if (cmp == 0)
-		/* we got an exact match, which means the iter was at
-		 * the position of the returned marker.  now we have
-		 * to search backward for other markers at the same
-		 * position */
-		i = markers_linear_lookup (buffer, NULL, i, -1);
-	else if (cmp > 0)
-		i++;
+	if (cmp > 0)
+		++index;
 
-	if (i >= markers->len)
-		/* no markers to return */
-		return NULL;
+	while (index < buffer->priv->source_marks->len)
+	{
+		GtkSourceMark *mark;
 
-	j = markers_binary_search (buffer, &iter2, &cmp);
-	if (cmp == 0)
-		/* we got an exact match, which means the iter was at
-		 * the position of the returned marker.  now we have
-		 * to search forward for other markers at the same
-		 * position */
-		j = markers_linear_lookup (buffer, NULL, j, 1);
-	else if (cmp < 0)
-		j--;
+		mark = g_array_index (buffer->priv->source_marks, GtkSourceMark *, index);
+		if (category == NULL || strcmp (category, gtk_source_mark_get_category (mark)) == 0)
+		{
+			/* update the iter */
+			gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
+							  iter, GTK_TEXT_MARK (mark));
 
-	if (j < 0 || i > j)
-		/* no markers to return */
-		return NULL;
+			return mark;
+		}
 
-	/* build the resulting list */
-	while (j >= i)
-	{
-		result = g_slist_prepend (result, g_array_index (markers, GtkSourceMarker *, j));
-		j--;
+		++index;
 	}
 
-	DEBUG({
-		GSList *l;
-
-		g_print ("Returned list:\n");
-		for (l = result; l; l = l->next)
-			marker_print (buffer, l->data);
-	});
-
-	return result;
+	return NULL;
 }
 
-/**
- * gtk_source_buffer_get_first_marker:
- * @buffer: a #GtkSourceBuffer.
- *
- * Returns the first (nearest to the top of the buffer) marker in
- * @buffer.
- *
- * Return value: a reference to the first #GtkSourceMarker, or %NULL if
- * there are no markers in the buffer.
- **/
-GtkSourceMarker *
-gtk_source_buffer_get_first_marker (GtkSourceBuffer *buffer)
+GtkSourceMark *
+gtk_source_buffer_get_prev_mark (GtkSourceBuffer *buffer,
+				 GtkTextIter     *iter,
+				 const gchar     *category)
 {
-	g_return_val_if_fail (buffer != NULL, NULL);
+	gint index, cmp;
+
 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
+	g_return_val_if_fail (iter != NULL, NULL);
 
-	if (buffer->priv->markers->len == 0)
+	index = source_mark_bsearch (buffer, iter, &cmp);
+	if (index < 0)
 		return NULL;
 
-	return g_array_index (buffer->priv->markers, GtkSourceMarker *, 0);
-}
+	if (cmp <= 0)
+		--index;
 
-/**
- * gtk_source_buffer_get_last_marker:
- * @buffer: a #GtkSourceBuffer.
- *
- * Returns the last (nearest to the bottom of the buffer) marker in
- * @buffer.
- *
- * Return value: a reference to the last #GtkSourceMarker, or %NULL if
- * there are no markers in the buffer.
- **/
-GtkSourceMarker *
-gtk_source_buffer_get_last_marker (GtkSourceBuffer *buffer)
-{
-	g_return_val_if_fail (buffer != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
+	while (index >= 0)
+	{
+		GtkSourceMark *mark;
 
-	if (buffer->priv->markers->len == 0)
-		return NULL;
+		mark = g_array_index (buffer->priv->source_marks, GtkSourceMark *, index);
+		if (category == NULL || strcmp (category, gtk_source_mark_get_category (mark)) == 0)
+		{
+			/* update the iter */
+			gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
+							  iter, GTK_TEXT_MARK (mark));
 
-	return g_array_index (buffer->priv->markers,
-			      GtkSourceMarker *,
-			      buffer->priv->markers->len - 1);
-}
+			return mark;
+		}
 
-/**
- * gtk_source_buffer_get_iter_at_marker:
- * @buffer: a #GtkSourceBuffer.
- * @iter: a #GtkTextIter to initialize.
- * @marker: a #GtkSourceMarker of @buffer.
- *
- * Initializes @iter at the location of @marker.
- **/
-void
-gtk_source_buffer_get_iter_at_marker (GtkSourceBuffer *buffer,
-				      GtkTextIter     *iter,
-				      GtkSourceMarker *marker)
-{
-	g_return_if_fail (buffer != NULL && marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
+		--index;
+	}
 
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-					  iter,
-					  GTK_TEXT_MARK (marker));
+	return NULL;
 }
 
-/**
- * gtk_source_buffer_get_next_marker:
- * @buffer: a #GtkSourceBuffer.
- * @iter: the location to start searching from.
- *
- * Returns the nearest marker to the right of @iter.  If there are
- * multiple markers at the same position, this function will always
- * return the first one (from the internal linked list), even if
- * starting the search exactly at its location.  You can get the
- * others using gtk_source_marker_next().
- *
- * Return value: the #GtkSourceMarker nearest to the right of @iter,
- * or %NULL if there are no more markers after @iter.
- **/
-GtkSourceMarker *
-gtk_source_buffer_get_next_marker (GtkSourceBuffer *buffer,
-				   GtkTextIter     *iter)
-{
-	GtkSourceMarker *marker;
-	GArray *markers;
-	gint i, cmp;
-
-	g_return_val_if_fail (buffer != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
-	g_return_val_if_fail (iter != NULL, NULL);
+GSList *
+gtk_source_buffer_get_marks_at_line (GtkSourceBuffer *buffer,
+				     gint             line,
+				     const gchar     *category)
+{
+	GtkTextIter iter;
+	GtkSourceMark *mark;
+	GSList *list = NULL;
 
-	marker = NULL;
-	markers = buffer->priv->markers;
+ 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
 
-	i = markers_binary_search (buffer, iter, &cmp);
-	if (i < 0)
-		return NULL;
+	gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (buffer),
+					  &iter, line);
 
-	if (cmp == 0)
-		/* return the first marker at the iter position */
-		i = markers_linear_lookup (buffer, NULL, i, -1);
-	else if (cmp > 0)
-		i++;
+	mark = gtk_source_buffer_get_next_mark (buffer, &iter, category);
+	while (mark != NULL)
+ 	{
+		gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
+						  &iter, GTK_TEXT_MARK (mark));
+ 
+		if (gtk_text_iter_get_line (&iter) == line)
+			list = g_slist_prepend (list, mark);
+		else
+			break;
 
-	if (i < markers->len)
-	{
-		marker = g_array_index (markers, GtkSourceMarker *, i);
-		gtk_source_buffer_get_iter_at_marker (buffer, iter, marker);
+		mark = gtk_source_mark_next (mark, category);
 	}
 
-	return marker;
+	return g_slist_reverse (list);
 }
 
-/**
- * gtk_source_buffer_get_prev_marker:
- * @buffer: a #GtkSourceBuffer.
- * @iter: the location to start searching from.
- *
- * Returns the nearest marker to the left of @iter.  If there are
- * multiple markers at the same position, this function will always
- * return the last one (from the internal linked list), even if
- * starting the search exactly at its location.  You can get the
- * others using gtk_source_marker_prev().
- *
- * Return value: the #GtkSourceMarker nearest to the left of @iter,
- * or %NULL if there are no more markers before @iter.
- **/
-GtkSourceMarker *
-gtk_source_buffer_get_prev_marker (GtkSourceBuffer *buffer,
-				   GtkTextIter     *iter)
+void
+gtk_source_buffer_remove_marks (GtkSourceBuffer        *buffer,
+				GtkTextIter            *start,
+				GtkTextIter            *end,
+				const gchar		*category)
 {
-	GtkSourceMarker *marker;
-	GArray *markers;
-	gint i, cmp;
+	GtkSourceMark *mark;
 
-	g_return_val_if_fail (buffer != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
-	g_return_val_if_fail (iter != NULL, NULL);
+ 	g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
+ 	g_return_if_fail (start != NULL);
+ 	g_return_if_fail (end != NULL);
 
-	marker = NULL;
-	markers = buffer->priv->markers;
+	mark = gtk_source_buffer_get_next_mark (buffer, start, category);
 
-	i = markers_binary_search (buffer, iter, &cmp);
-	if (i < 0)
-		return NULL;
+	while (mark != NULL)
+	{
+		GtkTextIter iter;
 
-	if (cmp == 0)
-		/* return the last marker at the iter position */
-		i = markers_linear_lookup (buffer, NULL, i, 1);
-	else if (cmp < 0)
-		i--;
+		gtk_text_buffer_delete_mark (GTK_TEXT_BUFFER (buffer),
+					     GTK_TEXT_MARK (mark));
+		mark = gtk_source_mark_next (mark, category);
 
-	if (i >= 0)
-	{
-		marker = g_array_index (markers, GtkSourceMarker *, i);
-		gtk_source_buffer_get_iter_at_marker (buffer, iter, marker);
+		gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
+						  &iter,
+						  GTK_TEXT_MARK (mark));
+		if (gtk_text_iter_compare (&iter, end) > 0)
+			break;
 	}
-
-	return marker;
 }
+
Index: gtksourceview/gtksourceview.c
===================================================================
--- gtksourceview/gtksourceview.c	(revision 1784)
+++ gtksourceview/gtksourceview.c	(working copy)
@@ -37,6 +37,7 @@
 
 #include "gtksourceview-marshal.h"
 #include "gtksourceview-typebuiltins.h"
+#include "gtksourcemark.h"
 #include "gtksourceview.h"
 
 /*
@@ -85,7 +86,7 @@ enum {
 enum {
 	PROP_0,
 	PROP_SHOW_LINE_NUMBERS,
-	PROP_SHOW_LINE_MARKERS,
+	PROP_SHOW_LINE_MARKS,
 	PROP_TAB_WIDTH,
 	PROP_INDENT_WIDTH,
 	PROP_AUTO_INDENT,
@@ -102,7 +103,7 @@ struct _GtkSourceViewPrivate
 	guint		 tab_width;
 	gint		 indent_width;
 	gboolean 	 show_line_numbers;
-	gboolean	 show_line_markers;
+	gboolean	 show_line_marks;
 	gboolean	 auto_indent;
 	gboolean	 insert_spaces;
 	gboolean	 highlight_current_line;
@@ -116,10 +117,11 @@ struct _GtkSourceViewPrivate
 	gboolean	 style_scheme_applied;
 	GtkSourceStyleScheme *style_scheme;
 	GdkGC		*current_line_gc;
-	GHashTable 	*pixmap_cache;
 	GdkColor        *right_margin_line_color;
 	GdkColor        *right_margin_overlay_color;
 
+	GHashTable 	*mark_categories;
+
 	GtkSourceBuffer *source_buffer;
 	gint		 old_lines;
 };
@@ -139,6 +141,11 @@ static const GtkTargetEntry drop_types[]
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
+typedef struct 
+{
+	gint priority;
+	GdkPixbuf *pixbuf;
+} MarkCategory;
 
 /* Prototypes. */
 static GObject *gtk_source_view_constructor		(GType               type,
@@ -203,6 +210,10 @@ static void	gtk_source_view_realize			(G
 static void	gtk_source_view_unrealize		(GtkWidget         *widget);
 static void	gtk_source_view_update_style_scheme	(GtkSourceView     *view);
 
+static MarkCategory *
+		mark_category_new			(gint               priority,
+							 GdkPixbuf         *pixbuf);
+static void	mark_category_free			(MarkCategory      *cat);
 
 /* Private functions. */
 static void
@@ -237,17 +248,17 @@ gtk_source_view_class_init (GtkSourceVie
 
 	g_object_class_install_property (object_class,
 					 PROP_SHOW_LINE_NUMBERS,
-					 g_param_spec_boolean ("show_line_numbers",
+					 g_param_spec_boolean ("show-line-numbers",
 							       _("Show Line Numbers"),
 							       _("Whether to display line numbers"),
 							       FALSE,
 							       G_PARAM_READWRITE));
 
 	g_object_class_install_property (object_class,
-					 PROP_SHOW_LINE_MARKERS,
-					 g_param_spec_boolean ("show_line_markers",
-							       _("Show Line Markers"),
-							       _("Whether to display line marker pixbufs"),
+					 PROP_SHOW_LINE_MARKS,
+					 g_param_spec_boolean ("show-line-marks",
+							       _("Show Line Marks"),
+							       _("Whether to display line mark pixbufs"),
 							       FALSE,
 							       G_PARAM_READWRITE));
 
@@ -417,9 +428,9 @@ gtk_source_view_set_property (GObject   
 							       g_value_get_boolean (value));
 			break;
 
-		case PROP_SHOW_LINE_MARKERS:
-			gtk_source_view_set_show_line_markers (view,
-							       g_value_get_boolean (value));
+		case PROP_SHOW_LINE_MARKS:
+			gtk_source_view_set_show_line_marks (view,
+							     g_value_get_boolean (value));
 			break;
 
 		case PROP_TAB_WIDTH:
@@ -493,9 +504,9 @@ gtk_source_view_get_property (GObject   
 					     gtk_source_view_get_show_line_numbers (view));
 			break;
 
-		case PROP_SHOW_LINE_MARKERS:
+		case PROP_SHOW_LINE_MARKS:
 			g_value_set_boolean (value,
-					     gtk_source_view_get_show_line_markers (view));
+					     gtk_source_view_get_show_line_marks (view));
 			break;
 
 		case PROP_TAB_WIDTH:
@@ -573,16 +584,16 @@ gtk_source_view_init (GtkSourceView *vie
 	view->priv->right_margin_pos = DEFAULT_RIGHT_MARGIN_POSITION;
 	view->priv->cached_right_margin_pos = -1;
 
-	view->priv->pixmap_cache = g_hash_table_new_full (g_str_hash, g_str_equal,
-							  (GDestroyNotify) g_free,
-							  (GDestroyNotify) g_object_unref);
-
 	gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 2);
 	gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 2);
-	
+
 	view->priv->right_margin_line_color = NULL;
 	view->priv->right_margin_overlay_color = NULL;
 
+	view->priv->mark_categories = g_hash_table_new_full (g_str_hash, g_str_equal,
+							     (GDestroyNotify) g_free,
+							     (GDestroyNotify) mark_category_free);
+
 	tl = gtk_drag_dest_get_target_list (GTK_WIDGET (view));
 	g_return_if_fail (tl != NULL);
 
@@ -629,16 +640,16 @@ gtk_source_view_finalize (GObject *objec
 
 	if (view->priv->style_scheme)
 		g_object_unref (view->priv->style_scheme);
-
-	if (view->priv->pixmap_cache)
-		g_hash_table_destroy (view->priv->pixmap_cache);
-
+	
 	if (view->priv->right_margin_line_color != NULL)
 		gdk_color_free (view->priv->right_margin_line_color);
 
 	if (view->priv->right_margin_overlay_color != NULL)
 		gdk_color_free (view->priv->right_margin_overlay_color);
 
+	if (view->priv->mark_categories)
+		g_hash_table_destroy (view->priv->mark_categories);
+
 	set_source_buffer (view, NULL);
 
 	G_OBJECT_CLASS (gtk_source_view_parent_class)->finalize (object);
@@ -711,47 +722,19 @@ highlight_updated_cb (GtkSourceBuffer *b
 }
 
 static void
-marker_updated_cb (GtkSourceBuffer *buffer,
-		   GtkTextIter     *where,
-		   GtkTextView     *text_view)
+source_mark_updated_cb (GtkSourceBuffer *buffer,
+			GtkSourceMark	*mark,
+			GtkTextView     *text_view)
 {
-	GdkRectangle visible_rect;
-	GdkRectangle updated_rect;
-	GdkRectangle redraw_rect;
-	gint y, height;
+	GdkWindow *margin;
 
-	g_return_if_fail (text_view != NULL && GTK_IS_SOURCE_VIEW (text_view));
-
-	if (!GTK_SOURCE_VIEW (text_view)->priv->show_line_markers)
-		return;
-
-	/* get visible area */
-	gtk_text_view_get_visible_rect (text_view, &visible_rect);
-
-	/* get updated rectangle */
-	gtk_text_view_get_line_yrange (text_view, where, &y, &height);
-	updated_rect.y = y;
-	updated_rect.height = height;
-	updated_rect.x = visible_rect.x;
-	updated_rect.width = visible_rect.width;
-
-	/* intersect both rectangles to see whether we need to queue a redraw */
-	if (gdk_rectangle_intersect (&updated_rect, &visible_rect, &redraw_rect))
+	margin = gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_LEFT);
+	if (margin != NULL)
 	{
-		gint y_win, width;
+		GdkRegion *region;
 
-		gtk_text_view_buffer_to_window_coords (text_view,
-						       GTK_TEXT_WINDOW_WIDGET,
-						       0,
-						       redraw_rect.y,
-						       NULL,
-						       &y_win);
-
-		width = gtk_text_view_get_border_window_size (text_view,
-							      GTK_TEXT_WINDOW_LEFT);
-
-		gtk_widget_queue_draw_area (GTK_WIDGET (text_view),
-					    0, y_win, width, height);
+		region = gdk_drawable_get_visible_region (GDK_DRAWABLE (margin));
+		gdk_window_invalidate_region (margin, region, TRUE);
 	}
 }
 
@@ -776,7 +759,7 @@ set_source_buffer (GtkSourceView *view,
 						      highlight_updated_cb,
 						      view);
 		g_signal_handlers_disconnect_by_func (view->priv->source_buffer,
-						      marker_updated_cb,
+						      source_mark_updated_cb,
 						      view);
 		g_signal_handlers_disconnect_by_func (view->priv->source_buffer,
 						      buffer_style_scheme_changed_cb,
@@ -793,8 +776,8 @@ set_source_buffer (GtkSourceView *view,
 				  G_CALLBACK (highlight_updated_cb),
 				  view);
 		g_signal_connect (buffer,
-				  "marker_updated",
-				  G_CALLBACK (marker_updated_cb),
+				  "source_mark_updated",
+				  G_CALLBACK (source_mark_updated_cb),
 				  view);
 		g_signal_connect (buffer,
 				  "notify::style-scheme",
@@ -1071,8 +1054,7 @@ gtk_source_view_get_lines (GtkTextView  
 	gtk_text_view_get_line_at_y (text_view, &iter, first_y, NULL);
 
 	/* For each iter, get its location and add it to the arrays.
-	 * Stop when we pass last_y
-	*/
+	 * Stop when we pass last_y */
 	count = 0;
   	size = 0;
 
@@ -1114,39 +1096,72 @@ gtk_source_view_get_lines (GtkTextView  
 	*countp = count;
 }
 
-static GSList *
-draw_line_markers (GtkSourceView *view,
-		   GSList        *current_marker,
-		   gint          *line_number,
-		   gint           x,
-		   gint           y)
+static gint
+sort_marks_by_priority (gconstpointer m1, 
+			gconstpointer m2,
+			gpointer data)
+{
+	GtkSourceMark *mark1 = GTK_SOURCE_MARK (m1);
+	GtkSourceMark *mark2 = GTK_SOURCE_MARK (m2);
+	GtkSourceView *view = GTK_SOURCE_VIEW (data);
+	GtkTextIter iter1, iter2;
+	gint line1;
+	gint line2;
+
+	gtk_text_buffer_get_iter_at_mark (gtk_text_mark_get_buffer (GTK_TEXT_MARK (mark1)),
+					  &iter1, 
+					  GTK_TEXT_MARK (mark1));
+	gtk_text_buffer_get_iter_at_mark (gtk_text_mark_get_buffer (GTK_TEXT_MARK (mark2)),
+					  &iter2, 
+					  GTK_TEXT_MARK (mark2));
+
+	line1 = gtk_text_iter_get_line (&iter1);
+	line2 = gtk_text_iter_get_line (&iter2);
+
+	if (line1 == line2)
+	{
+		guint priority1 = gtk_source_view_get_mark_category_priority (view,
+						gtk_source_mark_get_category (mark1));
+		guint priority2 = gtk_source_view_get_mark_category_priority (view,
+						gtk_source_mark_get_category (mark2));
+
+		return priority2 - priority1;
+	}
+	else
+	{
+		return line2 - line1;
+	}
+}
+
+static void
+draw_line_marks (GtkSourceView *view,
+		 GSList        *marks,
+		 gint           x,
+		 gint           y)
 {
-	GdkPixbuf *pixbuf, *composite;
-	GtkSourceMarker *marker;
+	GdkPixbuf *composite;
 	gint width, height;
-	gint next_line;
-	gchar *marker_type;
 
-	g_assert (current_marker);
+	/* Draw the mark with higher priority */
+	marks = g_slist_sort_with_data (marks, sort_marks_by_priority, view);
 
 	composite = NULL;
 	width = height = 0;
 
-	/* composite all the pixbufs for the markers present at the line */
+	/* composite all the pixbufs for the marks present at the line */
 	do
 	{
-		marker = current_marker->data;
+		GtkSourceMark *mark;
+		GdkPixbuf *pixbuf;
 
-		next_line = gtk_source_marker_get_line (marker);
-		if (next_line != *line_number)
-			break;
+		mark = marks->data;
 
-		marker_type = gtk_source_marker_get_marker_type (marker);
-		pixbuf = gtk_source_view_get_marker_pixbuf (view, marker_type);
+		pixbuf = gtk_source_view_get_mark_category_pixbuf (view,
+					gtk_source_mark_get_category (mark));
 
-		if (pixbuf)
+		if (pixbuf != NULL)
 		{
-			if (!composite)
+			if (composite == NULL)
 			{
 				composite = gdk_pixbuf_copy (pixbuf);
 				width = gdk_pixbuf_get_width (composite);
@@ -1170,19 +1185,13 @@ draw_line_markers (GtkSourceView *view,
 						      COMPOSITE_ALPHA);
 			}
 			g_object_unref (pixbuf);
+		}
 
-		} else
-			g_warning ("Unknown marker '%s' used", marker_type);
-
-		g_free (marker_type);
-		current_marker = g_slist_next (current_marker);
+		marks = g_slist_next (marks);
 	}
-	while (current_marker);
-
-	*line_number = next_line;
+	while (marks);
 
-	/* render the result to the left window */
-	if (composite)
+	if (composite != NULL)
 	{
 		GdkWindow *window;
 
@@ -1195,8 +1204,6 @@ draw_line_markers (GtkSourceView *view,
 				 GDK_RGB_DITHER_NORMAL, 0, 0);
 		g_object_unref (composite);
 	}
-
-	return current_marker;
 }
 
 static void
@@ -1208,8 +1215,6 @@ gtk_source_view_paint_margin (GtkSourceV
 	PangoLayout *layout;
 	GArray *numbers;
 	GArray *pixels;
-	GSList *markers, *current_marker;
-	gint marker_line = 0;
 	gchar str [8];  /* we don't expect more than ten million lines ;-) */
 	gint y1, y2;
 	gint count;
@@ -1221,7 +1226,7 @@ gtk_source_view_paint_margin (GtkSourceV
 
 	text_view = GTK_TEXT_VIEW (view);
 
-	if (!view->priv->show_line_numbers && !view->priv->show_line_markers)
+	if (!view->priv->show_line_numbers && !view->priv->show_line_marks)
 	{
 		gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (text_view),
 						      GTK_TEXT_WINDOW_LEFT,
@@ -1298,57 +1303,26 @@ gtk_source_view_paint_margin (GtkSourceV
 
 	x_pixmap = margin_width;
 
-	if (view->priv->show_line_markers)
+	if (view->priv->show_line_marks)
 		margin_width += GUTTER_PIXMAP;
 
-	g_return_if_fail (margin_width != 0);
+	/* no line & no marks case is short circuited before */
+	g_assert (margin_width != 0);
 
 	gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (text_view),
 					      GTK_TEXT_WINDOW_LEFT,
 					      margin_width);
 
-	/* get markers for the exposed region */
-	markers = NULL;
-	if (view->priv->source_buffer && view->priv->show_line_markers)
-	{
-		GtkTextIter begin, end;
-
-		/* get markers in the exposed area */
-		gtk_text_buffer_get_iter_at_line (text_view->buffer,
-						  &begin,
-						  g_array_index (numbers, gint, 0));
-		gtk_text_buffer_get_iter_at_line (text_view->buffer,
-						  &end,
-						  g_array_index (numbers, gint, count - 1));
-		if (!gtk_text_iter_ends_line (&end))
-			gtk_text_iter_forward_to_line_end (&end);
-
-		markers = gtk_source_buffer_get_markers_in_region (
-			view->priv->source_buffer, &begin, &end);
-
-		DEBUG ({
-			g_message ("Painting markers for lines %d - %d",
-				   gtk_text_iter_get_line (&begin),
-				   gtk_text_iter_get_line (&end));
-		});
-	}
-
-	i = 0;
-	current_marker = markers;
-	if (current_marker)
-		marker_line = gtk_source_marker_get_line (
-			GTK_SOURCE_MARKER (current_marker->data));
-
-
 	gtk_text_buffer_get_iter_at_mark (text_view->buffer,
 					  &cur,
 					  gtk_text_buffer_get_insert (text_view->buffer));
 
-	cur_line = gtk_text_iter_get_line (&cur) + 1;
+	cur_line = gtk_text_iter_get_line (&cur);
 
-	while (i < count)
+	for (i = 0; i < count; ++i)
 	{
 		gint pos;
+		gint line_to_paint;
 
 		gtk_text_view_buffer_to_window_coords (text_view,
 						       GTK_TEXT_WINDOW_LEFT,
@@ -1357,14 +1331,16 @@ gtk_source_view_paint_margin (GtkSourceV
 						       NULL,
 						       &pos);
 
+		line_to_paint = g_array_index (numbers, gint, i);
+
 		if (view->priv->show_line_numbers)
 		{
-			gint line_to_paint = g_array_index (numbers, gint, i) + 1;
-
 			if (line_to_paint == cur_line)
 			{
 				gchar *markup;
-				markup = g_strdup_printf ("<b>%d</b>", line_to_paint);
+
+				/* +1 because displayed line numbers start from 1 */
+				markup = g_strdup_printf ("<b>%d</b>", 1 + line_to_paint);
 
 				pango_layout_set_markup (layout, markup, -1);
 
@@ -1372,8 +1348,7 @@ gtk_source_view_paint_margin (GtkSourceV
 			}
 			else
 			{
-				g_snprintf (str, sizeof (str),
-					    "%d", line_to_paint);
+				g_snprintf (str, sizeof (str), "%d", 1 + line_to_paint);
 
 				pango_layout_set_markup (layout, str, -1);
 			}
@@ -1390,26 +1365,22 @@ gtk_source_view_paint_margin (GtkSourceV
 					  layout);
 		}
 
-		if (view->priv->show_line_markers && current_marker)
+		if (view->priv->show_line_marks)
 		{
-			if (marker_line == g_array_index (numbers, gint, i))
+			GSList *marks;
+
+			marks = gtk_source_buffer_get_marks_at_line (view->priv->source_buffer,
+								     line_to_paint,
+								     NULL);
+
+			if (marks != NULL)
 			{
-				/* draw markers for the line */
-				current_marker = draw_line_markers (view,
-								    current_marker,
-								    &marker_line,
-								    x_pixmap,
-								    pos);
+				/* draw marks for the line */
+				draw_line_marks (view, marks, x_pixmap, pos);
 			}
 		}
-
-		++i;
 	}
 
-	/* we should have used all markers */
-	g_assert (current_marker == NULL);
-
-	g_slist_free (markers);
 	g_array_free (pixels, TRUE);
 	g_array_free (numbers, TRUE);
 
@@ -1783,7 +1754,7 @@ gtk_source_view_set_show_line_numbers (G
 			/* Set left margin to minimum width if no margin is
 			   visible yet. Otherwise, just queue a redraw, so the
 			   expose handler will automatically adjust the margin. */
-			if (!view->priv->show_line_markers)
+			if (!view->priv->show_line_marks)
 				gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (view),
 								      GTK_TEXT_WINDOW_LEFT,
 								      MIN_NUMBER_WINDOW_WIDTH);
@@ -1810,42 +1781,40 @@ gtk_source_view_set_show_line_numbers (G
 }
 
 /**
- * gtk_source_view_get_show_line_markers:
+ * gtk_source_view_get_show_line_marks:
  * @view: a #GtkSourceView.
  *
- * Returns whether line markers are displayed beside the text.
+ * Returns whether line marks are displayed beside the text.
  *
- * Return value: %TRUE if the line markers are displayed.
+ * Return value: %TRUE if the line marks are displayed.
  **/
 gboolean
-gtk_source_view_get_show_line_markers (GtkSourceView *view)
+gtk_source_view_get_show_line_marks (GtkSourceView *view)
 {
-	g_return_val_if_fail (view != NULL, FALSE);
 	g_return_val_if_fail (GTK_IS_SOURCE_VIEW (view), FALSE);
 
-	return view->priv->show_line_markers;
+	return view->priv->show_line_marks;
 }
 
 /**
- * gtk_source_view_set_show_line_markers:
+ * gtk_source_view_set_show_line_marks:
  * @view: a #GtkSourceView.
- * @show: whether line markers should be displayed.
+ * @show: whether line marks should be displayed.
  *
- * If %TRUE line markers will be displayed beside the text.
+ * If %TRUE line marks will be displayed beside the text.
  *
  **/
 void
-gtk_source_view_set_show_line_markers (GtkSourceView *view,
-				       gboolean       show)
+gtk_source_view_set_show_line_marks (GtkSourceView *view,
+				     gboolean       show)
 {
-	g_return_if_fail (view != NULL);
 	g_return_if_fail (GTK_IS_SOURCE_VIEW (view));
 
 	show = (show != FALSE);
 
 	if (show)
 	{
-		if (!view->priv->show_line_markers)
+		if (!view->priv->show_line_marks)
 		{
 			/* Set left margin to minimum width if no margin is
 			   visible yet. Otherwise, just queue a redraw, so the
@@ -1857,21 +1826,21 @@ gtk_source_view_set_show_line_markers (G
 			else
 				gtk_widget_queue_draw (GTK_WIDGET (view));
 
-			view->priv->show_line_markers = show;
+			view->priv->show_line_marks = show;
 
-			g_object_notify (G_OBJECT (view), "show_line_markers");
+			g_object_notify (G_OBJECT (view), "show-line-marks");
 		}
 	}
 	else
 	{
-		if (view->priv->show_line_markers)
+		if (view->priv->show_line_marks)
 		{
-			view->priv->show_line_markers = show;
+			view->priv->show_line_marks = show;
 
 			/* force expose event, which will adjust margin. */
 			gtk_widget_queue_draw (GTK_WIDGET (view));
 
-			g_object_notify (G_OBJECT (view), "show_line_markers");
+			g_object_notify (G_OBJECT (view), "show-line-marks");
 		}
 	}
 }
@@ -1989,25 +1958,52 @@ gtk_source_view_get_indent_width (GtkSou
 	return view->priv->indent_width;
 }
 
+static MarkCategory *
+mark_category_new (gint priority, GdkPixbuf *pixbuf)
+{
+	MarkCategory *cat;
+
+	cat = g_slice_new0 (MarkCategory);
+	cat->priority = priority;
+	if (pixbuf != NULL)
+		cat->pixbuf = g_object_ref (pixbuf);
+	else
+		cat->pixbuf = NULL;
+
+	return cat;
+}
+
+static void
+mark_category_free (MarkCategory *cat)
+{
+	if (cat->pixbuf)
+		g_object_unref (cat->pixbuf);
+	g_slice_free (MarkCategory, cat);
+}
+
 /**
- * gtk_source_view_set_marker_pixbuf:
+ * gtk_source_view_set_mark_category_pixbuf:
  * @view: a #GtkSourceView.
- * @marker_type: a marker type.
- * @pixbuf: a #GdkPixbuf.
+ * @category: a mark category.
+ * @pixbuf: a #GdkPixbuf or #NULL.
  *
- * Associates a given @pixbuf with a given @marker_type.
+ * Associates a given @pixbuf with a given @category.
+ * If @pixbuf is #NULL, the pixbuf is unset.
  */
 void
-gtk_source_view_set_marker_pixbuf (GtkSourceView *view,
-				   const gchar   *marker_type,
-				   GdkPixbuf     *pixbuf)
+gtk_source_view_set_mark_category_pixbuf (GtkSourceView *view,
+					  const gchar   *category,
+					  GdkPixbuf     *pixbuf)
 {
-	g_return_if_fail (view != NULL);
+	MarkCategory *cat;
+
 	g_return_if_fail (GTK_IS_SOURCE_VIEW (view));
-	g_return_if_fail (marker_type != NULL);
+	g_return_if_fail (category != NULL);
 	g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf));
 
-	if (pixbuf)
+	cat = g_hash_table_lookup (view->priv->mark_categories, category);
+
+	if (pixbuf != NULL)
 	{
 		gint width;
 		gint height;
@@ -2026,44 +2022,114 @@ gtk_source_view_set_marker_pixbuf (GtkSo
 		else
 		{
 			/* we own a reference of the pixbuf */
-			g_object_ref (G_OBJECT (pixbuf));
+			g_object_ref (pixbuf);
 		}
 
-		g_hash_table_insert (view->priv->pixmap_cache,
-				     g_strdup (marker_type),
-				     pixbuf);
+		if (cat != NULL)
+		{
+			if (cat->pixbuf != NULL)
+				g_object_unref (cat->pixbuf);
+			cat->pixbuf = g_object_ref (pixbuf);
+		}
+		else
+		{
+			cat = mark_category_new (0, pixbuf);
+			g_hash_table_insert (view->priv->mark_categories,
+					     g_strdup (category),
+					     cat);
+		}
+
+		g_object_unref (pixbuf);
 	}
 	else
 	{
-		g_hash_table_remove (view->priv->pixmap_cache, marker_type);
+		if (cat != NULL && cat->pixbuf != NULL)
+		{
+			g_object_unref (cat->pixbuf);
+			cat->pixbuf = NULL;
+		}
 	}
 }
 
 /**
- * gtk_source_view_get_marker_pixbuf:
+ * gtk_source_view_get_mark_category_pixbuf:
  * @view: a #GtkSourceView.
- * @marker_type: a marker type.
+ * @category: a mark category.
  *
- * Gets the pixbuf which is associated with the given @marker_type.
+ * Gets the pixbuf which is associated with the given @category.
  *
- * Return value: a #GdkPixbuf if found, or %NULL if not found.
+ * Return value: the associated #GdkPixbuf, or %NULL if not found.
  */
 GdkPixbuf *
-gtk_source_view_get_marker_pixbuf (GtkSourceView *view,
-				   const gchar   *marker_type)
+gtk_source_view_get_mark_category_pixbuf (GtkSourceView *view,
+					  const gchar   *category)
 {
-	GdkPixbuf *pixbuf;
+	MarkCategory *cat;
 
-	g_return_val_if_fail (view != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_VIEW (view), NULL);
-	g_return_val_if_fail (marker_type != NULL, NULL);
+	g_return_val_if_fail (GTK_IS_SOURCE_VIEW (view), 0);
+	g_return_val_if_fail (category != NULL, 0);
 
-	pixbuf = g_hash_table_lookup (view->priv->pixmap_cache, marker_type);
+	cat = g_hash_table_lookup (view->priv->mark_categories, category);
+	if (cat != NULL)
+		return g_object_ref (cat->pixbuf);
+	else
+		return NULL;
+}
 
-	if (pixbuf)
-		g_object_ref (pixbuf);
+/**
+ * gtk_source_view_set_mark_category_priority:
+ * @view: a #GtkSourceView.
+ * @category: a mark category.
+ * @priority: the priority for the category
+ *
+ * Set the priority for the mark category. Mark of categories with
+ * higher priorities will be drawn on top.
+ */
+void
+gtk_source_view_set_mark_category_priority (GtkSourceView *view,
+					    const gchar   *category,
+					    gint          priority)
+{
+	MarkCategory *cat;
 
-	return pixbuf;
+	g_return_if_fail (GTK_IS_SOURCE_VIEW (view));
+	g_return_if_fail (category != NULL);
+
+	cat = g_hash_table_lookup (view->priv->mark_categories, category);
+	if (cat == NULL)
+	{
+		cat = mark_category_new (priority, NULL);
+		g_hash_table_insert (view->priv->mark_categories,
+				     g_strdup (category),
+				     cat);
+	}
+	else
+		cat->priority = priority;
+}
+
+/**
+ * gtk_source_view_get_mark_category_priority:
+ * @view: a #GtkSourceView.
+ * @category: a mark category.
+ *
+ * Gets the priority which is associated with the given @category.
+ *
+ * Return value: the priority or -1 if category was not set
+ */
+gint
+gtk_source_view_get_mark_category_priority (GtkSourceView *view,
+					    const gchar   *category)
+{
+	MarkCategory *cat;
+
+	g_return_val_if_fail (GTK_IS_SOURCE_VIEW (view), 0);
+	g_return_val_if_fail (category != NULL, 0);
+
+	cat = g_hash_table_lookup (view->priv->mark_categories, category);
+	if (cat != NULL)
+		return cat->priority;
+	else
+		return -1;
 }
 
 static gchar *
@@ -2926,7 +2992,7 @@ gtk_source_view_get_right_margin_positio
 /**
  * gtk_source_view_set_right_margin_position:
  * @view: a #GtkSourceView.
- * @margin: the position of the margin to set.
+ * @pos: the position of the margin to set.
  *
  * Sets the position of the right margin in the given @view.
  **/
Index: gtksourceview/gtksourcebuffer.h
===================================================================
--- gtksourceview/gtksourcebuffer.h	(revision 1784)
+++ gtksourceview/gtksourcebuffer.h	(working copy)
@@ -28,7 +28,7 @@
 
 #include <gtk/gtk.h>
 #include <gtksourceview/gtksourcelanguage.h>
-#include <gtksourceview/gtksourcemarker.h>
+#include <gtksourceview/gtksourcemark.h>
 #include <gtksourceview/gtksourcestylescheme.h>
 
 G_BEGIN_DECLS
@@ -109,39 +109,44 @@ void			 gtk_source_buffer_redo			(GtkSou
 void			 gtk_source_buffer_begin_not_undoable_action (GtkSourceBuffer   *buffer);
 void			 gtk_source_buffer_end_not_undoable_action   (GtkSourceBuffer   *buffer);
 
-/* Marker methods */
-GtkSourceMarker         *gtk_source_buffer_create_marker        (GtkSourceBuffer        *buffer,
+/* Mark methods */
+GtkSourceMark		*gtk_source_buffer_create_mark		(GtkSourceBuffer        *buffer,
 								 const gchar            *name,
-								 const gchar            *type,
+								 const gchar            *category,
 								 const GtkTextIter      *where);
-
-void                     gtk_source_buffer_move_marker          (GtkSourceBuffer        *buffer,
-								 GtkSourceMarker        *marker,
-								 const GtkTextIter      *where);
-void                     gtk_source_buffer_delete_marker        (GtkSourceBuffer        *buffer,
-								 GtkSourceMarker        *marker);
-GtkSourceMarker         *gtk_source_buffer_get_marker           (GtkSourceBuffer        *buffer,
-								 const gchar            *name);
-GSList                  *gtk_source_buffer_get_markers_in_region
-                                                                (GtkSourceBuffer        *buffer,
-								 const GtkTextIter      *begin,
-								 const GtkTextIter      *end);
-GtkSourceMarker         *gtk_source_buffer_get_first_marker     (GtkSourceBuffer        *buffer);
-GtkSourceMarker         *gtk_source_buffer_get_last_marker      (GtkSourceBuffer        *buffer);
-void                     gtk_source_buffer_get_iter_at_marker   (GtkSourceBuffer        *buffer,
+GSList			*gtk_source_buffer_get_marks_at_iter    (GtkSourceBuffer        *buffer,
 								 GtkTextIter            *iter,
-								 GtkSourceMarker        *marker);
-GtkSourceMarker         *gtk_source_buffer_get_next_marker      (GtkSourceBuffer        *buffer,
-								 GtkTextIter            *iter);
-GtkSourceMarker         *gtk_source_buffer_get_prev_marker      (GtkSourceBuffer        *buffer,
-								 GtkTextIter            *iter);
-
+								 const gchar            *category);
+GtkSourceMark		*gtk_source_buffer_get_next_mark	(GtkSourceBuffer        *buffer,
+								 GtkTextIter            *iter,
+								 const gchar            *category);
+GtkSourceMark		*gtk_source_buffer_get_prev_mark	(GtkSourceBuffer        *buffer,
+								 GtkTextIter            *iter,
+								 const gchar            *category);
+GSList			*gtk_source_buffer_get_marks_at_line	(GtkSourceBuffer        *buffer,
+								 gint 			 line,
+								 const gchar		*category);
+void			 gtk_source_buffer_remove_marks		(GtkSourceBuffer        *buffer,
+								 GtkTextIter            *start,
+								 GtkTextIter            *end,
+								 const gchar		*category);
 /* private */
 void			 _gtk_source_buffer_update_highlight	(GtkSourceBuffer        *buffer,
 								 const GtkTextIter      *start,
 								 const GtkTextIter      *end,
 								 gboolean                synchronous);
 
+GtkSourceMark		*_gtk_source_buffer_mark_next		(GtkSourceBuffer        *buffer,
+								 GtkSourceMark          *mark, 
+								 const gchar            *category);
+GtkSourceMark		*_gtk_source_buffer_mark_prev		(GtkSourceBuffer        *buffer,
+								 GtkSourceMark          *mark, 
+								 const gchar            *category);
+
+GSList          	  *_gtk_source_buffer_get_marks_in_region    (GtkSourceBuffer        *buffer,
+								 const GtkTextIter *begin,
+								 const GtkTextIter *end);
+
 G_END_DECLS
 
 #endif /* __GTK_SOURCE_BUFFER_H__ */
Index: gtksourceview/gtksourceview.h
===================================================================
--- gtksourceview/gtksourceview.h	(revision 1784)
+++ gtksourceview/gtksourceview.h	(working copy)
@@ -96,10 +96,6 @@ void 		 gtk_source_view_set_show_line_nu
 							 gboolean         show);
 gboolean 	 gtk_source_view_get_show_line_numbers 	(GtkSourceView   *view);
 
-void 		 gtk_source_view_set_show_line_markers  (GtkSourceView   *view,
-							 gboolean         show);
-gboolean	 gtk_source_view_get_show_line_markers  (GtkSourceView   *view);
-
 void 		 gtk_source_view_set_tab_width          (GtkSourceView   *view,
 							 guint            width);
 guint            gtk_source_view_get_tab_width          (GtkSourceView   *view);
@@ -138,11 +134,25 @@ void		 gtk_source_view_set_right_margin_
 guint		 gtk_source_view_get_right_margin_position
 					 		(GtkSourceView   *view);
 
-void             gtk_source_view_set_marker_pixbuf      (GtkSourceView   *view,
-							 const gchar     *marker_type,
+void 		 gtk_source_view_set_show_line_marks    (GtkSourceView   *view,
+							 gboolean         show);
+gboolean	 gtk_source_view_get_show_line_marks    (GtkSourceView   *view);
+
+void             gtk_source_view_set_mark_category_pixbuf
+							(GtkSourceView   *view,
+							 const gchar     *category,
 							 GdkPixbuf       *pixbuf);
-GdkPixbuf	*gtk_source_view_get_marker_pixbuf      (GtkSourceView   *view,
-				       			 const gchar     *marker_type);
+GdkPixbuf	*gtk_source_view_get_mark_category_pixbuf
+							(GtkSourceView   *view,
+				       			 const gchar     *category);
+
+void             gtk_source_view_set_mark_category_priority
+							(GtkSourceView   *view,
+							 const gchar     *category,
+							 gint priority);
+gint		 gtk_source_view_get_mark_category_priority
+							(GtkSourceView   *view,
+				       			 const gchar     *category);
 
 void		 gtk_source_view_set_smart_home_end	(GtkSourceView             *view,
 							 GtkSourceSmartHomeEndType  smart_he);
Index: gtksourceview/Makefile.am
===================================================================
--- gtksourceview/Makefile.am	(revision 1784)
+++ gtksourceview/Makefile.am	(working copy)
@@ -44,7 +44,7 @@ libgtksourceview_headers =			\
 	gtksourcestyle.h			\
 	gtksourcestyleschememanager.h		\
 	gtksourcestylescheme.h			\
-	gtksourcemarker.h
+	gtksourcemark.h
 
 libgtksourceview_2_0_la_SOURCES = 	\
 	gtksourcebuffer.c 		\
@@ -67,11 +67,11 @@ libgtksourceview_2_0_la_SOURCES = 	\
 	gtksourcestyle.c		\
 	gtksourcestyleschememanager.c	\
 	gtksourcestylescheme.c		\
-	gtksourcemarker.c		\
 	gtksourceengine.h		\
 	gtksourceengine.c		\
 	gtksourcecontextengine.h	\
 	gtksourcecontextengine.c	\
+	gtksourcemark.c			\	
 	$(libgtksourceview_headers)
 
 # do not distribute generated files
Index: tests/test-widget.c
===================================================================
--- tests/test-widget.c	(revision 1784)
+++ tests/test-widget.c	(working copy)
@@ -52,8 +52,8 @@ static GtkSourceStyleScheme *style_schem
 
 #define READ_BUFFER_SIZE   4096
 
-#define MARKER_TYPE_1      "one"
-#define MARKER_TYPE_2      "two"
+#define MARK_TYPE_1      "one"
+#define MARK_TYPE_2      "two"
 
 
 /* Private prototypes -------------------------------------------------------- */
@@ -67,7 +67,7 @@ static void       new_view_cb           
 						  gpointer         user_data);
 static void       numbers_toggled_cb             (GtkAction       *action,
 						  gpointer         user_data);
-static void       markers_toggled_cb             (GtkAction       *action,
+static void       marks_toggled_cb               (GtkAction       *action,
 						  gpointer         user_data);
 static void       margin_toggled_cb              (GtkAction       *action,
 						  gpointer         user_data);
@@ -115,9 +115,9 @@ static GtkToggleActionEntry toggle_entri
 	{ "ShowNumbers", NULL, "Show _Line Numbers", NULL,
 	  "Toggle visibility of line numbers in the left margin",
 	  G_CALLBACK (numbers_toggled_cb), FALSE },
-	{ "ShowMarkers", NULL, "Show _Markers", NULL,
-	  "Toggle visibility of markers in the left margin",
-	  G_CALLBACK (markers_toggled_cb), FALSE },
+	{ "ShowMarks", NULL, "Show Line _Marks", NULL,
+	  "Toggle visibility of marks in the left margin",
+	  G_CALLBACK (marks_toggled_cb), FALSE },
 	{ "ShowMargin", NULL, "Show Right M_argin", NULL,
 	  "Toggle visibility of right margin indicator",
 	  G_CALLBACK (margin_toggled_cb), FALSE },
@@ -175,7 +175,7 @@ static const gchar *view_ui_description 
 "      <menuitem action=\"NewView\"/>"
 "      <separator/>"
 "      <menuitem action=\"ShowNumbers\"/>"
-"      <menuitem action=\"ShowMarkers\"/>"
+"      <menuitem action=\"ShowMarks\"/>"
 "      <menuitem action=\"ShowMargin\"/>"
 "      <menuitem action=\"HlLine\"/>"
 "      <menuitem action=\"WrapLines\"/>"
@@ -290,20 +290,13 @@ gtk_source_buffer_load_file (GtkSourceBu
 }
 
 static void
-remove_all_markers (GtkSourceBuffer *buffer)
+remove_all_marks (GtkSourceBuffer *buffer)
 {
-	GSList *markers;
-	GtkTextIter begin, end;
+	GtkTextIter s, e;
 
-	gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (buffer), &begin, &end);
-	markers = gtk_source_buffer_get_markers_in_region (buffer, &begin, &end);
-	while (markers)
-	{
-		GtkSourceMarker *marker = markers->data;
+	gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (buffer), &s, &e);
 
-		gtk_source_buffer_delete_marker (buffer, marker);
-		markers = g_slist_delete_link (markers, markers);
-	}
+	gtk_source_buffer_remove_marks (buffer, &s, &e, NULL);
 }
 
 /* Note this is wrong for several reasons, e.g. g_pattern_match is broken
@@ -492,7 +485,7 @@ open_file (GtkSourceBuffer *buffer, cons
 		g_free (curdir);
 	}
 
-	remove_all_markers (buffer);
+	remove_all_marks (buffer);
 
 	success = gtk_source_buffer_load_file (buffer, filename, NULL);
 
@@ -558,10 +551,10 @@ numbers_toggled_cb (GtkAction *action, g
 }
 
 static void
-markers_toggled_cb (GtkAction *action, gpointer user_data)
+marks_toggled_cb (GtkAction *action, gpointer user_data)
 {
 	g_return_if_fail (GTK_IS_TOGGLE_ACTION (action) && GTK_IS_SOURCE_VIEW (user_data));
-	gtk_source_view_set_show_line_markers (
+	gtk_source_view_set_show_line_marks (
 		GTK_SOURCE_VIEW (user_data),
 		gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
 }
@@ -905,7 +898,7 @@ button_press_cb (GtkWidget *widget, GdkE
 	view = GTK_SOURCE_VIEW (widget);
 	buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));
 
-	if (!gtk_source_view_get_show_line_markers (view))
+	if (!gtk_source_view_get_show_line_marks (view))
 		return FALSE;
 
 	/* check that the click was on the left gutter */
@@ -913,15 +906,14 @@ button_press_cb (GtkWidget *widget, GdkE
 						    GTK_TEXT_WINDOW_LEFT))
 	{
 		gint y_buf;
-		GtkTextIter line_start, line_end;
-		GSList *marker_list, *list_iter;
-		GtkSourceMarker *marker;
-		const gchar *marker_type;
+		GtkTextIter line_start;
+		GSList *mark_list;
+		const gchar *mark_type;
 
 		if (ev->button == 1)
-			marker_type = MARKER_TYPE_1;
+			mark_type = MARK_TYPE_1;
 		else
-			marker_type = MARKER_TYPE_2;
+			mark_type = MARK_TYPE_2;
 
 		gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (view),
 						       GTK_TEXT_WINDOW_LEFT,
@@ -934,42 +926,25 @@ button_press_cb (GtkWidget *widget, GdkE
 					     y_buf,
 					     NULL);
 
-		line_end = line_start;
-		gtk_text_iter_forward_to_line_end (&line_end);
+		/* get the marks already in the line */
+		mark_list = gtk_source_buffer_get_marks_at_line (buffer,
+								 gtk_text_iter_get_line (&line_start),
+								 mark_type);
 
-		/* get the markers already in the line */
-		marker_list = gtk_source_buffer_get_markers_in_region (buffer,
-								       &line_start,
-								       &line_end);
-
-		/* search for the marker corresponding to the button pressed */
-		marker = NULL;
-		for (list_iter = marker_list;
-		     list_iter && !marker;
-		     list_iter = g_slist_next (list_iter))
+		if (mark_list != NULL)
 		{
-			GtkSourceMarker *tmp = list_iter->data;
-			gchar *tmp_type = gtk_source_marker_get_marker_type (tmp);
-
-			if (tmp_type && !strcmp (tmp_type, marker_type))
-			{
-				marker = tmp;
-			}
-			g_free (tmp_type);
-		}
-		g_slist_free (marker_list);
-
-		if (marker)
-		{
-			/* a marker was found, so delete it */
-			gtk_source_buffer_delete_marker (buffer, marker);
+			/* just take the first and delete it */
+			gtk_text_buffer_delete_mark (GTK_TEXT_BUFFER (buffer),
+						     GTK_TEXT_MARK (mark_list->data));
 		}
 		else
 		{
-			/* no marker found -> create one */
-			marker = gtk_source_buffer_create_marker (buffer, NULL,
-								  marker_type, &line_start);
+			/* no mark found: create one */
+			gtk_source_buffer_create_mark (buffer, NULL,
+						       mark_type, &line_start);
 		}
+
+		g_slist_free (mark_list);
 	}
 
 	return FALSE;
@@ -1079,9 +1054,9 @@ create_view_window (GtkSourceBuffer *buf
 		gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
 					      gtk_source_view_get_show_line_numbers (from));
 
-		action = gtk_action_group_get_action (action_group, "ShowMarkers");
+		action = gtk_action_group_get_action (action_group, "ShowMarks");
 		gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
-					      gtk_source_view_get_show_line_markers (from));
+					      gtk_source_view_get_show_line_marks (from));
 
 		action = gtk_action_group_get_action (action_group, "ShowMargin");
 		gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
@@ -1118,16 +1093,17 @@ create_view_window (GtkSourceBuffer *buf
 		g_free (tmp);
 	}
 
-	/* add marker pixbufs */
+	/* add source mark pixbufs */
 	error = NULL;
 	if ((pixbuf = gdk_pixbuf_new_from_file (DATADIR "/pixmaps/apple-green.png", &error)))
 	{
-		gtk_source_view_set_marker_pixbuf (GTK_SOURCE_VIEW (view), MARKER_TYPE_1, pixbuf);
+		gtk_source_view_set_mark_category_pixbuf (GTK_SOURCE_VIEW (view), MARK_TYPE_1, pixbuf);
+		gtk_source_view_set_mark_category_priority (GTK_SOURCE_VIEW (view), MARK_TYPE_1, 1);
 		g_object_unref (pixbuf);
 	}
 	else
 	{
-		g_message ("could not load marker 1 image.  Spurious messages might get triggered: %s",
+		g_message ("could not load source mark 1 image. Spurious messages might get triggered: %s\n",
 		error->message);
 		g_error_free (error);
 	}
@@ -1135,12 +1111,13 @@ create_view_window (GtkSourceBuffer *buf
 	error = NULL;
 	if ((pixbuf = gdk_pixbuf_new_from_file (DATADIR "/pixmaps/apple-red.png", &error)))
 	{
-		gtk_source_view_set_marker_pixbuf (GTK_SOURCE_VIEW (view), MARKER_TYPE_2, pixbuf);
+		gtk_source_view_set_mark_category_pixbuf (GTK_SOURCE_VIEW (view), MARK_TYPE_2, pixbuf);
+		gtk_source_view_set_mark_category_priority (GTK_SOURCE_VIEW (view), MARK_TYPE_2, 2);
 		g_object_unref (pixbuf);
 	}
 	else
 	{
-		g_message ("could not load marker 2 image.  Spurious messages might get triggered: %s",
+		g_message ("could not load source mark 2 image. Spurious messages might get triggered: %s\n",
 		error->message);
 		g_error_free (error);
 	}
@@ -1187,7 +1164,7 @@ create_main_window (GtkSourceBuffer *buf
 	action = gtk_action_group_get_action (action_group, "ShowNumbers");
 	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
 
-	action = gtk_action_group_get_action (action_group, "ShowMarkers");
+	action = gtk_action_group_get_action (action_group, "ShowMarks");
 	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
 
 	action = gtk_action_group_get_action (action_group, "ShowMargin");
Index: configure.ac
===================================================================
--- configure.ac	(revision 1784)
+++ configure.ac	(working copy)
@@ -3,7 +3,7 @@ dnl Process this file with autoconf to p
 AC_PREREQ(2.59)
 
 m4_define(gtksourceview_major_version, 2)
-m4_define(gtksourceview_minor_version, 0)
+m4_define(gtksourceview_minor_version, 1)
 m4_define(gtksourceview_micro_version, 0)
 m4_define(gtksourceview_version, gtksourceview_major_version.gtksourceview_minor_version.gtksourceview_micro_version)
 
