Index: gtksourceview/gtksourcelanguagesmanager.c
===================================================================
RCS file: /cvs/gnome/gtksourceview/gtksourceview/gtksourcelanguagesmanager.c,v
retrieving revision 1.5
diff -u -p -r1.5 gtksourcelanguagesmanager.c
--- gtksourceview/gtksourcelanguagesmanager.c	24 Jan 2005 16:40:33 -0000	1.5
+++ gtksourceview/gtksourcelanguagesmanager.c	9 Oct 2005 16:31:23 -0000
@@ -35,10 +35,6 @@
 
 #define DEFAULT_GCONF_BASE_DIR		"/apps/gtksourceview"
 
-#define DEFAULT_LANGUAGE_DIR		DATADIR "/gtksourceview-1.0/language-specs"
-#define USER_LANGUAGE_DIR		"gtksourceview-1.0/language-specs"
-#define USER_CONFIG_BASE_DIR	".gnome2"
-
 enum {
 	PROP_0,
 	PROP_LANG_SPECS_DIRS
@@ -215,23 +211,42 @@ gtk_source_languages_manager_finalize (G
 	(* G_OBJECT_CLASS (parent_class)->finalize) (object);
 }
 
-static void 
+#define SOURCEVIEW_DIR		"gtksourceview-1.0"
+#define LANGUAGE_DIR		"language-specs"
+#define USER_CONFIG_BASE_DIR	".gnome2"
+
+static void
 gtk_source_languages_manager_set_specs_dirs (GtkSourceLanguagesManager	*lm,
 					     const GSList		*dirs)
 {
 	g_return_if_fail (GTK_IS_SOURCE_LANGUAGES_MANAGER (lm));
 	g_return_if_fail (lm->priv->language_specs_directories == NULL);
-			
+
 	if (dirs == NULL)
 	{
-		lm->priv->language_specs_directories =
-			g_slist_prepend (lm->priv->language_specs_directories,
-					g_strdup (DEFAULT_LANGUAGE_DIR));
+		const gchar * const *xdg_dirs;
+		gint i;
+
+		/* default to fetch specs in the XDG_DATA_DIRS */
+		xdg_dirs = g_get_system_data_dirs ();
+		for (i = 0; i < G_N_ELEMENTS (xdg_dirs); ++i)
+		{
+			lm->priv->language_specs_directories =
+				g_slist_prepend (lm->priv->language_specs_directories,
+						 g_build_filename (xdg_dirs[i],
+								   SOURCEVIEW_DIR,
+								   LANGUAGE_DIR, 
+								   NULL));
+		}
+
+		/* prepend the dir in ~ so that we look there first */
 		lm->priv->language_specs_directories = 
 			g_slist_prepend (lm->priv->language_specs_directories,
-					g_build_filename (g_get_home_dir(), 
-						USER_CONFIG_BASE_DIR, USER_LANGUAGE_DIR, 
-						NULL));
+					 g_build_filename (g_get_home_dir(),
+							   USER_CONFIG_BASE_DIR,
+							   SOURCEVIEW_DIR,
+							   LANGUAGE_DIR, 
+							   NULL));
 
 		return;
 	}
@@ -245,6 +260,10 @@ gtk_source_languages_manager_set_specs_d
 		dirs = g_slist_next (dirs);
 	}
 }
+
+#undef SOURCEVIEW_DIR
+#undef LANGUAGE_DIR
+#undef USER_CONFIG_BASE_DIR
 
 /**
  * gtk_source_languages_manager_get_lang_files_dirs:
