After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 324191 - the xml.lang syntax file should include application/vnd.mozilla.xul+xml
the xml.lang syntax file should include application/vnd.mozilla.xul+xml
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
git master
Other Linux
: Normal major
: 2.16.0
Assigned To: Gedit maintainers
Gedit maintainers
: 337947 348207 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-12-15 16:50 UTC by Sebastien Bacher
Modified: 2006-08-23 15:34 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Patch described in the above comment (6.35 KB, patch)
2006-08-23 13:20 UTC, Paolo Maggi
none Details | Review

Description Sebastien Bacher 2005-12-15 16:50:21 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."
Comment 1 Paolo Borelli 2005-12-28 11:36:42 UTC
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?
Comment 2 Sebastien Bacher 2005-12-28 11:53:25 UTC
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
Comment 3 Sebastien Bacher 2006-04-13 10:25:55 UTC
same issue for "application/docbook+xml", I'm going to patch the Ubuntu package for dapper
Comment 4 Paolo Maggi 2006-07-26 12:40:14 UTC
We should probably check the mime-type hierarchy in gtksourceview.
Comment 5 Paolo Maggi 2006-07-26 12:49:56 UTC
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.

Comment 6 Paolo Maggi 2006-08-21 11:00:45 UTC
Some issue for "application/x-glade".
Comment 7 Paolo Maggi 2006-08-21 11:01:14 UTC
*** Bug 348207 has been marked as a duplicate of this bug. ***
Comment 8 Paolo Maggi 2006-08-23 13:13:25 UTC
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.
Comment 9 Paolo Maggi 2006-08-23 13:20:56 UTC
Created attachment 71456 [details] [review]
Patch described in the above comment
Comment 10 Paolo Maggi 2006-08-23 13:25:03 UTC
*** Bug 337947 has been marked as a duplicate of this bug. ***
Comment 11 Paolo Maggi 2006-08-23 15:34:59 UTC
Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.