After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776319 - language-specs: Add systemd globs to ini.lang
language-specs: Add systemd globs to ini.lang
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other All
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-20 18:21 UTC by Philip Withnall
Modified: 2017-01-11 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
language-specs: Add systemd globs to ini.lang (1.04 KB, patch)
2016-12-20 18:21 UTC, Philip Withnall
reviewed Details | Review
language-specs: Add systemd and D-Bus MIME types to ini.lang (1.29 KB, patch)
2017-01-10 11:32 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2016-12-20 18:21:35 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.
Comment 1 Philip Withnall 2016-12-20 18:21:39 UTC
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.
Comment 2 Sébastien Wilmet 2016-12-20 20:29:32 UTC
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.
Comment 3 Philip Withnall 2016-12-22 23:42:27 UTC
(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?
Comment 4 Lennart Poettering 2016-12-23 14:37:58 UTC
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...
Comment 5 Philip Withnall 2017-01-06 10:24:30 UTC
shared-mime-info patch filed as: https://bugs.freedesktop.org/show_bug.cgi?id=99297
Comment 6 Philip Withnall 2017-01-10 11:32:07 UTC
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.)
Comment 7 Sébastien Wilmet 2017-01-11 11:46:39 UTC
Review of attachment 343229 [details] [review]:

OK.
Comment 8 Philip Withnall 2017-01-11 12:02:38 UTC
Thanks.

Attachment 343229 [details] pushed as 32f6fbe - language-specs: Add systemd and D-Bus MIME types to ini.lang