GNOME Bugzilla – Bug 122127
RFE: Spec file mode
Last modified: 2014-02-15 12:53:14 UTC
[ From https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=104316 ] It would be nice to have a spec file set of highlighting for GtkSourceView.
Created attachment 71209 [details] Proposed language definition file This should do quite nicely. Take it from someone who has to build lots and lots of RPMs. :)
sweet! Thanks a lot... I should add random comments to blogs more often ;) we have to wait the next release cycle to add it because it adds translatable strings and gnome is string-frozen for 2.16, but I'm pretty sure you can lobby fedora packagers to include it in the package.
Created attachment 71210 [details] Drop Version-Release rule The Version-Release rule was matching too much for little benefit, so I removed it.
Paolo: No problem, I'm glad to be help. :)
*** Bug 373432 has been marked as a duplicate of this bug. ***
The Konstantin's lang file looks good. Only a few changes are required: - re-indenting - s/Spec Macros/Spec Macro - s/Flow Conditionals/Flow (or better name, but singular) The real problem is that is seems SPEC files are not recognized by the MIME system (aka shared-mime-info). One of the requirements for the inclusion on a .lang file in GtkSourceView is that the mime type is officially part of the freedesktop mime database. Please, file a bug in bugs.freedesktop.org to add support for the text/x-rpm-spec mime type.
Done: https://bugs.freedesktop.org/show_bug.cgi?id=9331
The mime type was added to shared-mime-info, I updated the lang file with paolo's suggestions and committed, thanks! Leaving open since this needs to be still ported/commited to the gsv2 branch.
Since asking doesn't cost anything, Konstantin: do you by any chance feel like porting this lang file to the new file format? for that you need gtksourceview-1.90.0 or above and gedit 2.19, they should be in rawhide as far as I know...
I bit the bullet and ported the file to the new format myself and while at it I made some improvements (like highlighting changelog entries only in the changelog sections). If one wanted more advanced stuff could be done since some macros are allowed only in certail sections etc. Patched welcome :) I tested the new lang with a bunch of fedora spec files and seems ok, but feedback with someone with a clue about RPM packaging is appreciated.