Re: [gedit-list] Octave vs. Objective-C

Søren Hauberg wrote:
> Hi All
> I use gedit for all of my editing needs (thanks for creating an editor
> that is powerful yet easy to use), which includes editing files for GNU
> Octave. Script files for Octave uses the .m extension, which also seems
> to be used by Objective-C. Every time I open a .m file it seems that
> Objective-C wins and gets to highlight the file.
We use the shared mime type database for detecting the type of a file.
In gtksourceview, first the glob specified by the language files is
matched to the filename. Then if there are more than 1 matches, the
mime-type is checked. In the case of octave and obj-c, they both have
the same globs in gsv and in the mime database. So the way they can be
differentiated then is only by the mime magick header detection, which
means if the file starts with either 'function' or '%' it is detected as
octave, but otherwise it seems it's obj-c.
> Is there something I can do to ensure that by default Octave syntax
> highlighting is preferred over Objective-C highlighting?
You can always just remove the glob from the obj-c language file
(/usr/share/gtksourceview-2.0/language-specs/objc.lang). That should
make sure .m files are always recognized as octave highlighting.

> Thanks
> Søren
> P.S. Please keep me CC'ed as I don't subscribe to this list.
> _______________________________________________
> gedit-list mailing list
> gedit-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]