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




On Mar 18, 2010, at 6:39 PM, Søren Hauberg wrote:

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.

No, it's not in the lang spec, but in the mime spec.


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.

Yeah well, it's a small thing really. I didn't say it was a permanent solution, but at least
you'll have the immediate problem fixed for yourself.


Thanks,
Søren

_______________________________________________
gedit-list mailing list
gedit-list gnome org
http://mail.gnome.org/mailman/listinfo/gedit-list



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