|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Octave vs. Objective-CHi 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. Is there something I can do to ensure that by default Octave syntax highlighting is preferred over Objective-C 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@... http://mail.gnome.org/mailman/listinfo/gedit-list |
|
|
Re: Octave vs. Objective-CSø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. Jesse > Thanks > Søren > > P.S. Please keep me CC'ed as I don't subscribe to this list. > > _______________________________________________ > gedit-list mailing list > gedit-list@... > http://mail.gnome.org/mailman/listinfo/gedit-list > _______________________________________________ gedit-list mailing list gedit-list@... http://mail.gnome.org/mailman/listinfo/gedit-list |
|
|
Re: Octave vs. Objective-Cman, 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 _______________________________________________ gedit-list mailing list gedit-list@... http://mail.gnome.org/mailman/listinfo/gedit-list |
|
|
Re: Octave vs. Objective-COn 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@... > http://mail.gnome.org/mailman/listinfo/gedit-list _______________________________________________ gedit-list mailing list gedit-list@... http://mail.gnome.org/mailman/listinfo/gedit-list |
|
|
Re: Octave vs. Objective-Ctor, 18 03 2010 kl. 23:30 +0100, skrev Jesse van den Kieboom:
> >> 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. Ahh, that makes sense. I've filed a bug report on this https://bugs.freedesktop.org/show_bug.cgi?id=27205 Thanks, Søren _______________________________________________ gedit-list mailing list gedit-list@... http://mail.gnome.org/mailman/listinfo/gedit-list |
| Free embeddable forum powered by Nabble | Forum Help |