Skip to content

Commit 68aae21

Browse files
committed
Install language definitions to gtksourceview-4.
- Install using meson tools rather than via files/usr/share/* - Add a definition for search helpers. Xed and other editors use gtksourceview-4, and action and search- helper files were getting formatted as plain text files instead of desktop/key-files.
1 parent 75cdf73 commit 68aae21

File tree

5 files changed

+250
-1
lines changed

5 files changed

+250
-1
lines changed

data/meson.build

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ install_data(rootPolicyFile,
7979
install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions')
8080
)
8181

82+
foreach lang_file: ['nemo_action.lang', 'nemo_search_helper.lang']
83+
foreach sv_dir: ['gtksourceview-2.0', 'gtksourceview-3.0', 'gtksourceview-4']
84+
install_data(lang_file,
85+
install_dir: join_paths(get_option('datadir'), sv_dir, 'language-specs')
86+
)
87+
endforeach
88+
endforeach
89+
8290
################################################################################
8391

8492
subdir('icons')

data/nemo.xml.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66
<glob pattern="*.savedSearch"/>
77
</mime-type>
88

9-
109
<mime-type type="application/nemo-action">
1110
<_comment>Nemo action definition</_comment>
1211
<generic-icon name="text-x-generic"/>
1312
<sub-class-of type="text/plain"/>
1413
<glob pattern="*.nemo_action"/>
1514
</mime-type>
15+
<mime-type type="application/nemo-search-helper">
16+
<_comment>Nemo search-helper definition</_comment>
17+
<generic-icon name="text-x-generic"/>
18+
<sub-class-of type="text/plain"/>
19+
<glob pattern="*.nemo_search_helper"/>
20+
</mime-type>
1621
</mime-info>

data/nemo_action.lang

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
This file is part of GtkSourceView
5+
6+
Author: Paolo Maggi <[email protected]>
7+
Copyright (C) 2003 Paolo Maggi <[email protected]>
8+
Copyright (C) 2006 Luca Cavalli <[email protected]>
9+
10+
GtkSourceView is free software; you can redistribute it and/or
11+
modify it under the terms of the GNU Lesser General Public
12+
License as published by the Free Software Foundation; either
13+
version 2.1 of the License, or (at your option) any later version.
14+
15+
GtkSourceView is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
Lesser General Public License for more details.
19+
20+
You should have received a copy of the GNU Lesser General Public
21+
License along with this library; if not, write to the Free Software
22+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23+
24+
-->
25+
<language id="nemo_action" _name="Nemo Action" version="2.0" _section="Others">
26+
<metadata>
27+
<property name="mimetypes">application/nemo-action</property>
28+
<property name="globs">*.nemo_action</property>
29+
<property name="line-comment-start">#</property>
30+
</metadata>
31+
32+
<styles>
33+
<style id="group" _name="Group" map-to="def:keyword"/>
34+
<!-- Translators: "Key" here means key value, that is the left hand
35+
side in a myoption=something line in a .desktop file -->
36+
<style id="key" _name="Key" map-to="def:type"/>
37+
<style id="language" _name="Translation" map-to="def:decimal"/>
38+
<style id="number" _name="Number" map-to="def:floating-point"/>
39+
<style id="boolean" _name="Boolean" map-to="def:floating-point"/>
40+
<style id="exec-parameter" _name="Exec parameter" map-to="def:floating-point"/>
41+
<style id="encoding" _name="Encoding" map-to="def:floating-point"/>
42+
</styles>
43+
44+
<definitions>
45+
<define-regex id="key-suffix">(?=(\[[a-zA-Z_]+\])?\s*=\s*)</define-regex>
46+
47+
<context id="group" style-ref="group">
48+
<start>^\[</start>
49+
<end>\]$</end>
50+
</context>
51+
52+
<context id="language" style-ref="language">
53+
<match>\[[a-zA-Z_]+\]</match>
54+
</context>
55+
56+
<context id="boolean" style-ref="boolean">
57+
<keyword>true</keyword>
58+
<keyword>false</keyword>
59+
</context>
60+
61+
<context id="exec-parameter" style-ref="exec-parameter">
62+
<match>%[FUNPfp%]</match>
63+
</context>
64+
65+
<context id="encoding" style-ref="encoding">
66+
<keyword>UTF\-8</keyword>
67+
<keyword>Legacy\-Mixed</keyword>
68+
</context>
69+
70+
<context id="number" style-ref="number">
71+
<match>(.\b[0-9]+([Ll]?|[Ff]?)\b)|(b[0-9]*\.\W)</match>
72+
</context>
73+
74+
<context id="standard-key" style-ref="key">
75+
<prefix>^_?</prefix>
76+
<suffix>\%{key-suffix}</suffix>
77+
<keyword>Active</keyword>
78+
<keyword>Name</keyword>
79+
<keyword>Comment</keyword>
80+
<keyword>Exec</keyword>
81+
<keyword>Icon-Name</keyword>
82+
<keyword>Stock-Id</keyword>
83+
<keyword>Selection</keyword>
84+
<keyword>Extensions</keyword>
85+
<keyword>Mimetypes</keyword>
86+
<keyword>Separator</keyword>
87+
<keyword>Quote</keyword>
88+
<keyword>Dependencies</keyword>
89+
<keyword>Conditions</keyword>
90+
<keyword>EscapeSpaces</keyword>
91+
<keyword>Terminal</keyword>
92+
</context>
93+
94+
<context id="non-standard-key" style-ref="key">
95+
<match>^_?X\-[a-zA-Z\-]+\%{key-suffix}</match>
96+
</context>
97+
98+
<context id="key">
99+
<include>
100+
<context ref="standard-key"/>
101+
<context ref="non-standard-key"/>
102+
</include>
103+
</context>
104+
105+
<context id="nemo_action">
106+
<include>
107+
<context ref="def:shell-like-comment"/>
108+
<context ref="group"/>
109+
<context ref="key"/>
110+
<context id="lang-and-value" end-at-line-end="true">
111+
<start>(\[[a-zA-Z_]+\])?\s*=\s*</start>
112+
<include>
113+
<context sub-pattern="1" where="start" style-ref="language"/>
114+
<context ref="boolean"/>
115+
<context ref="exec-parameter"/>
116+
<context ref="encoding"/>
117+
<context ref="number"/>
118+
</include>
119+
</context>
120+
</include>
121+
</context>
122+
</definitions>
123+
</language>

data/nemo_search_helper.lang

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
This file is part of GtkSourceView
5+
6+
Author: Paolo Maggi <[email protected]>
7+
Copyright (C) 2003 Paolo Maggi <[email protected]>
8+
Copyright (C) 2006 Luca Cavalli <[email protected]>
9+
10+
GtkSourceView is free software; you can redistribute it and/or
11+
modify it under the terms of the GNU Lesser General Public
12+
License as published by the Free Software Foundation; either
13+
version 2.1 of the License, or (at your option) any later version.
14+
15+
GtkSourceView is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
Lesser General Public License for more details.
19+
20+
You should have received a copy of the GNU Lesser General Public
21+
License along with this library; if not, write to the Free Software
22+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23+
24+
-->
25+
<language id="nemo_search_helper" _name="Nemo Search Helper" version="2.0" _section="Others">
26+
<metadata>
27+
<property name="mimetypes">application/nemo-search-helper</property>
28+
<property name="globs">*.nemo_search_helper</property>
29+
<property name="line-comment-start">#</property>
30+
</metadata>
31+
32+
<styles>
33+
<style id="group" _name="Group" map-to="def:keyword"/>
34+
<!-- Translators: "Key" here means key value, that is the left hand
35+
side in a myoption=something line in a .desktop file -->
36+
<style id="key" _name="Key" map-to="def:type"/>
37+
<style id="language" _name="Translation" map-to="def:decimal"/>
38+
<style id="number" _name="Number" map-to="def:floating-point"/>
39+
<style id="boolean" _name="Boolean" map-to="def:floating-point"/>
40+
<style id="exec-parameter" _name="Exec parameter" map-to="def:floating-point"/>
41+
<style id="encoding" _name="Encoding" map-to="def:floating-point"/>
42+
</styles>
43+
44+
<definitions>
45+
<define-regex id="key-suffix">(?=(\[[a-zA-Z_]+\])?\s*=\s*)</define-regex>
46+
47+
<context id="group" style-ref="group">
48+
<start>^\[</start>
49+
<end>\]$</end>
50+
</context>
51+
52+
<context id="language" style-ref="language">
53+
<match>\[[a-zA-Z_]+\]</match>
54+
</context>
55+
56+
<context id="boolean" style-ref="boolean">
57+
<keyword>true</keyword>
58+
<keyword>false</keyword>
59+
</context>
60+
61+
<context id="exec-parameter" style-ref="exec-parameter">
62+
<match>%[FUNPfp%]</match>
63+
</context>
64+
65+
<context id="encoding" style-ref="encoding">
66+
<keyword>UTF\-8</keyword>
67+
<keyword>Legacy\-Mixed</keyword>
68+
</context>
69+
70+
<context id="number" style-ref="number">
71+
<match>(.\b[0-9]+([Ll]?|[Ff]?)\b)|(b[0-9]*\.\W)</match>
72+
</context>
73+
74+
<context id="standard-key" style-ref="key">
75+
<prefix>^_?</prefix>
76+
<suffix>\%{key-suffix}</suffix>
77+
<keyword>TryExec</keyword>
78+
<keyword>Exec</keyword>
79+
<keyword>MimeType</keyword>
80+
<keyword>Priority</keyword>
81+
</context>
82+
83+
<context id="non-standard-key" style-ref="key">
84+
<match>^_?X\-[a-zA-Z\-]+\%{key-suffix}</match>
85+
</context>
86+
87+
<context id="key">
88+
<include>
89+
<context ref="standard-key"/>
90+
<context ref="non-standard-key"/>
91+
</include>
92+
</context>
93+
94+
<context id="nemo_search_helper">
95+
<include>
96+
<context ref="def:shell-like-comment"/>
97+
<context ref="group"/>
98+
<context ref="key"/>
99+
<context id="lang-and-value" end-at-line-end="true">
100+
<start>(\[[a-zA-Z_]+\])?\s*=\s*</start>
101+
<include>
102+
<context sub-pattern="1" where="start" style-ref="language"/>
103+
<context ref="boolean"/>
104+
<context ref="exec-parameter"/>
105+
<context ref="encoding"/>
106+
<context ref="number"/>
107+
</include>
108+
</context>
109+
</include>
110+
</context>
111+
</definitions>
112+
</language>

debian/nemo-data.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
usr/share/glib-2.0/schemas/org.nemo.gschema.xml
22
usr/share/gtksourceview-2.0
33
usr/share/gtksourceview-3.0
4+
usr/share/gtksourceview-4
45
usr/share/icons/hicolor
56
usr/share/mime/packages/nemo.xml
67
usr/share/nemo

0 commit comments

Comments
 (0)