? gtksourceview/.gtksourcelanguagesmanager.c.swp
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtksourceview/ChangeLog,v
retrieving revision 1.244
diff -u -p -r1.244 ChangeLog
--- ChangeLog	21 Jun 2005 17:59:06 -0000	1.244
+++ ChangeLog	21 Jun 2005 18:17:48 -0000
@@ -1,5 +1,11 @@
 2005-06-21  Paolo Maggi  <paolo@gnome.org>
 
+	* gtksourceview/gtksourcelanguagesmanager.c
+	(gtk_source_languages_manager_set_specs_dirs): gtksourceview does now
+	load .lang file from XDG_DATA_DIRS too. Fixes bug #304147.
+
+2005-06-21  Paolo Maggi  <paolo@gnome.org>
+
 	* gtksourceview/gtksourcelanguage.c (tag_style_changed_cb): free
 	the value returned by gtk_source_tag_get_id. Fixes bug #306147.
 
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	21 Jun 2005 18:17:48 -0000
@@ -37,7 +37,7 @@
 
 #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"
+#define USER_CONFIG_BASE_DIR		".gnome2"
 
 enum {
 	PROP_0,
@@ -224,14 +224,29 @@ gtk_source_languages_manager_set_specs_d
 			
 	if (dirs == NULL)
 	{
+		const gchar *xdg_data_dirs = g_getenv ("XDG_DATA_DIRS");
+
+		if ((xdg_data_dirs != NULL) &&
+		    (strcmp (xdg_data_dirs, DATADIR) != 0) &&
+		    g_file_test (xdg_data_dirs, G_FILE_TEST_IS_DIR))
+		{
+			lm->priv->language_specs_directories =
+				g_slist_prepend (lm->priv->language_specs_directories,
+						 g_build_filename (xdg_data_dirs, 
+								   "/gtksourceview-1.0/language-specs",
+								   NULL));
+		}
+
 		lm->priv->language_specs_directories =
 			g_slist_prepend (lm->priv->language_specs_directories,
-					g_strdup (DEFAULT_LANGUAGE_DIR));
+					 g_strdup (DEFAULT_LANGUAGE_DIR));
+
 		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, 
+							   USER_LANGUAGE_DIR, 
+							   NULL));
 
 		return;
 	}
