GNOME Bugzilla – Bug 324191
the xml.lang syntax file should include application/vnd.mozilla.xul+xml
Last modified: 2006-08-23 15:34:59 UTC
This bug has been opened here: http://bugzilla.ubuntu.com/show_bug.cgi?id=21018 "/usr/share/gtksourceview-1.0/language-specs/xml.lang should include "application/vnd.mozilla.xul+xml" in the "mimetypes" attribute of the <language> base tag so that XUL files are syntax highlighted with XML rules in gedit and other gtksourceview applications."
I don't think so: we should not list all the 10 millions xml based mime types in xml.lang. xul files should have xml as a parent mime type in the mime hierarchy. This way if one day a xul.lang specific to xul files is created it is used and otherwise sourceview falls back to xml. Maybe a mime db problem?
The declaration of the mimetype is: <mime-type type="application/vnd.mozilla.xul+xml"> <sub-class-of type="text/xml"/> <comment>XML User Interface Language document</comment> <comment xml:lang="nb">XML-dokument for brukergrensesnitt</comment> <glob pattern="*.xul"/> </mime-type> Ie: it has the xml mention
same issue for "application/docbook+xml", I'm going to patch the Ubuntu package for dapper
We should probably check the mime-type hierarchy in gtksourceview.
Since gtksourceview cannot depends on xdgmime, we can fix this bug adding a new function in the languages manager that takes a list of mime-types (the caller will initialize the list with the parents of the mime-type). GtkSourceLanguage * gtk_source_languages_manager_get_language_for_mime_types (GtkSourceLanguagesManager *lm, const gchar **mime_types); Look at xdg_mime_list_mime_parents.
Some issue for "application/x-glade".
*** Bug 348207 has been marked as a duplicate of this bug. ***
gtk_source_languages_manager_get_language_from_mime_type is quite limited since it matches mime-types using strcmp. BTW, applications can write custom functions to select a language among the list of known languages. In gedit we have implemented a gedit_languages_manager_get_language_from_mime_type that works in a very similar to gtk_source_languages_manager_get_language_from_mime_type but it uses gnome_vfs_mime_type_get_equivalence instead of strcmp. It also uses a cache of already matched mime-type in order to improve performace for frequently used mime-types. I'm so going to move this bug back to gedit since the gedit fix prove it is not gtksourceview fault.
Created attachment 71456 [details] [review] Patch described in the above comment
*** Bug 337947 has been marked as a duplicate of this bug. ***
Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.