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



man, 15 03 2010 kl. 12:02 +0100, skrev Jesse van den Kieboom:
> 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.

Ahh, I see. I guess this is a bug in the Octave .lang file as it should
also recognise '#' which is the default comment-marker. We have a guy
working on improving the .lang file, so I'll just have him fix this.

> > 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.

I guess this is an approach, but I do fear this will cause problems when
I upgrade my OS.

Thanks,
Søren



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