GNOME Bugzilla – Bug 776319
language-specs: Add systemd globs to ini.lang
Last modified: 2017-01-11 12:02:46 UTC
Trivial patch attached. I don’t know if this is something you want — I could imagine that you might be deliberately not adding more globs to ini.lang because otherwise its list of globs would become massive. If that’s the case, I’ll write a systemd.lang which is fairly similar to ini.lang.
Created attachment 342277 [details] [review] language-specs: Add systemd globs to ini.lang systemd files (*.service, etc.) are a common use of INI formatting, so it would be nice to detect them by default.
Review of attachment 342277 [details] [review]: Probably a better solution is to add mime types to: https://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in *.ini is not even present, it should be added I think, with the systemd file types as sub-class-of ini.
(In reply to Sébastien Wilmet from comment #2) > Probably a better solution is to add mime types to: > https://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in > > *.ini is not even present, it should be added I think, with the systemd file > types as sub-class-of ini. Lennart, what do you think?
Hmm, I'd be happy to adding a proper mime type for this to xdg-mime, but I am not sure this can work out. "*.service" (which is the most important unit file type systemd has) is a pretty generic name (D-Bus knows similarly named files...), and I figure all other ways to detect these files could never be better than a heuristic... Dunno... Maybe a file ending in .service that contains a [Service] line would be a suitable match, similar for the other unit types... Dunno? Would be happy to have a look at a patch for that...
shared-mime-info patch filed as: https://bugs.freedesktop.org/show_bug.cgi?id=99297
Created attachment 343229 [details] [review] language-specs: Add systemd and D-Bus MIME types to ini.lang systemd unit files (*.service, etc.) and D-Bus service files (*.service) are a common use of INI formatting, so it would be nice to detect them by default. This relies on the new MIME types added for them in shared-mime-info, so will not work with older version of shared-mime-info. (See https://bugs.freedesktop.org/show_bug.cgi?id=99297.)
Review of attachment 343229 [details] [review]: OK.
Thanks. Attachment 343229 [details] pushed as 32f6fbe - language-specs: Add systemd and D-Bus MIME types to ini.lang