Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sat, 31 Aug 2019 10:34:38 UTC
Commit: c88c27e2d22dbff72488d8a57a825830fb833682
https://github.com/geany/geany/commit/c88c27e2d22dbff72488d8a57a825830fb833…
Log Message:
-----------
Fix broken markup in HACKING
Make "*_foreach" an inline literal to escape the asterisk and
so fix broken markup by the unbalanced asterisk which would start
an emphasis otherwise.
HACKING:223: (WARNING/2) Inline emphasis start-string without end-string.
Modified Paths:
--------------
HACKING
Modified: HACKING
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -221,8 +221,8 @@ Coding
characters rather than ``gint``, and use a ``guint`` for integers
which cannot be negative rather than ``gint``.
* Prefer loops to calling ``some_type_foreach()`` with a ``user_data``
- argument. (Note: Some containers don't support external iteration,
- e.g. for tree structures, so *_foreach is fine for those).
+ argument. (Note: Some containers don't support external iteration,
+ e.g. for tree structures, so ``*_foreach`` is fine for those).
* Do not use G_LIKELY or G_UNLIKELY (except in critical loops). These
add noise to the code with little real benefit.
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Nick Treleaven <n(a)trelsoft.com>
Committer: GitHub <noreply(a)github.com>
Date: Thu, 29 Aug 2019 16:26:18 UTC
Commit: 0ce5d5484e39edc25bc996cc0bf01f5bdc2b5221
https://github.com/geany/geany/commit/0ce5d5484e39edc25bc996cc0bf01f5bdc2b5…
Log Message:
-----------
build.c: Remove g_ptr_array_foreach with gpointer user_data & update HACKING (#2270)
* build.c: Remove g_ptr_array_foreach with untyped user_data
Also avoids passing &ft_names to the function.
* HACKING: Avoid untyped pointers & *_foreach() with non-NULL user_data
* Avoid using foreach_ macro
* HACKING: merge 2 rules, simplify user_data clause
Modified Paths:
--------------
HACKING
src/build.c
Modified: HACKING
8 lines changed, 6 insertions(+), 2 deletions(-)
===================================================================
@@ -214,11 +214,15 @@ Coding
to will not be mutated within the function.
* Don't let variable names shadow outer variables - use gcc's -Wshadow
option.
-* Use the strictest possible data type where practical. For example
- for an enumeration, use the actual enum type rather than just a
+* Use the strictest possible data type where practical.
+ Avoid using untyped pointers (e.g. gpointer) where practical.
+ For an enumeration, use the actual enum type rather than just a
``gint``, use a ``gchar`` for individual (ASCII/UTF-8) string
characters rather than ``gint``, and use a ``guint`` for integers
which cannot be negative rather than ``gint``.
+* Prefer loops to calling ``some_type_foreach()`` with a ``user_data``
+ argument. (Note: Some containers don't support external iteration,
+ e.g. for tree structures, so *_foreach is fine for those).
* Do not use G_LIKELY or G_UNLIKELY (except in critical loops). These
add noise to the code with little real benefit.
Modified: src/build.c
42 lines changed, 18 insertions(+), 24 deletions(-)
===================================================================
@@ -2559,41 +2559,29 @@ static guint build_save_menu_grp(GKeyFile *config, GeanyBuildCommand *src, gint
}
-typedef struct ForEachData
+static gboolean save_project_filetype(GeanyFiletype *ft, GKeyFile *config)
{
- GKeyFile *config;
- GPtrArray *ft_names;
-} ForEachData;
-
-
-static void foreach_project_filetype(gpointer data, gpointer user_data)
-{
- GeanyFiletype *ft = data;
- ForEachData *d = user_data;
guint i = 0;
gchar *regkey = g_strdup_printf("%serror_regex", ft->name);
- i += build_save_menu_grp(d->config, ft->priv->projfilecmds, GEANY_GBG_FT, ft->name);
- i += build_save_menu_grp(d->config, ft->priv->projexeccmds, GEANY_GBG_EXEC, ft->name);
+ i += build_save_menu_grp(config, ft->priv->projfilecmds, GEANY_GBG_FT, ft->name);
+ i += build_save_menu_grp(config, ft->priv->projexeccmds, GEANY_GBG_EXEC, ft->name);
if (!EMPTY(ft->priv->projerror_regex_string))
{
- g_key_file_set_string(d->config, build_grp_name, regkey, ft->priv->projerror_regex_string);
+ g_key_file_set_string(config, build_grp_name, regkey, ft->priv->projerror_regex_string);
i++;
}
else
- g_key_file_remove_key(d->config, build_grp_name, regkey, NULL);
+ g_key_file_remove_key(config, build_grp_name, regkey, NULL);
g_free(regkey);
- if (i > 0)
- g_ptr_array_add(d->ft_names, ft->name);
+ return (i > 0);
}
-
/* TODO: untyped ptr is too ugly (also for build_load_menu) */
void build_save_menu(GKeyFile *config, gpointer ptr, GeanyBuildSource src)
{
GeanyFiletype *ft;
GeanyProject *pj;
- ForEachData data;
switch (src)
{
@@ -2626,15 +2614,21 @@ void build_save_menu(GKeyFile *config, gpointer ptr, GeanyBuildSource src)
g_key_file_remove_key(config, build_grp_name, "error_regex", NULL);
if (pj->priv->build_filetypes_list != NULL)
{
- data.config = config;
- data.ft_names = g_ptr_array_new();
- g_ptr_array_foreach(pj->priv->build_filetypes_list, foreach_project_filetype, (gpointer)(&data));
- if (data.ft_names->pdata != NULL)
+ GPtrArray *ft_names = g_ptr_array_new();
+ const GPtrArray *build_fts = pj->priv->build_filetypes_list;
+
+ for (guint i = 0; i < build_fts->len; i++)
+ {
+ ft = build_fts->pdata[i];
+ if (save_project_filetype(ft, config))
+ g_ptr_array_add(ft_names, ft->name);
+ }
+ if (ft_names->pdata != NULL)
g_key_file_set_string_list(config, build_grp_name, "filetypes",
- (const gchar**)(data.ft_names->pdata), data.ft_names->len);
+ (const gchar**)ft_names->pdata, ft_names->len);
else
g_key_file_remove_key(config, build_grp_name, "filetypes", NULL);
- g_ptr_array_free(data.ft_names, TRUE);
+ g_ptr_array_free(ft_names, TRUE);
}
break;
default: /* defaults and GEANY_BCS_FT can't save */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jacob Pratt <the.z.cuber(a)gmail.com>
Committer: Nick Treleaven <n(a)trelsoft.com>
Date: Sat, 17 Aug 2019 10:54:54 UTC
Commit: d80e36e85a031fc266fe200add05f0626a0696ad
https://github.com/geany/geany/commit/d80e36e85a031fc266fe200add05f0626a069…
Log Message:
-----------
TypeScript syntax highlighting
Modified Paths:
--------------
data/Makefile.am
data/filedefs/filetypes.TypeScript.conf
data/filetype_extensions.conf
Modified: data/Makefile.am
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -68,6 +68,7 @@ filetypes = \
filedefs/filetypes.sh \
filedefs/filetypes.sql \
filedefs/filetypes.Swift.conf \
+ filedefs/filetypes.TypeScript.conf \
filedefs/filetypes.tcl \
filedefs/filetypes.txt2tags \
filedefs/filetypes.vala \
Modified: data/filedefs/filetypes.TypeScript.conf
54 lines changed, 54 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,54 @@
+# based on JavaScript file
+# For complete documentation of this file, please see Geany's main documentation
+[styling=C]
+
+[keywords]
+# all items must be in one line
+primary=break case catch class const continue debugger default delete do else enum export extends extend false finally for function get if import in Infinity instanceof let NaN new null return set static super switch this throw true try typeof undefined var let while with yield prototype async await declare aliased interfaced Alias Interface interface
+secondary=Array Boolean boolean Date Function Math Number number Object String string RegExp EvalError Error RangeError ReferenceError SyntaxError TypeError URIError constructor prototype decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt protected public private keyof void any never readonly as
+
+[lexer_properties=C]
+# partially handles ES6 template strings
+lexer.cpp.backquoted.strings=1
+
+[settings]
+# default extension used when saving files
+extension=ts
+lexer_filetype=C
+
+# MIME type
+mime_type=text/x-typescript
+
+# the following characters are these which a "word" can contains, see documentation
+#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
+
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
+
+# set to false if a comment character/string should start at column 0 of a line, true uses any
+# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
+ #command_example();
+# setting to false would generate this
+# command_example();
+# This setting works only for single line comments
+comment_use_indent=true
+
+# context action command (please see Geany's main documentation for details)
+context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
+[build-menu]
+# %f will be replaced by the complete filename
+# %e will be replaced by the filename without extension
+# (use only one of it at one time)
+#FT_02_LB=_Lint
+#FT_02_CM=jshint "%f"
+#FT_02_WD=
+#error_regex=([^:]+): line ([0-9]+), col ([0-9]+)
Modified: data/filetype_extensions.conf
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -68,6 +68,7 @@ SQL=*.sql;
Swift=*.swift;
Tcl=*.tcl;*.tk;*.wish;*.exp;
Txt2tags=*.t2t;
+TypeScript=*.ts;
Vala=*.vala;*.vapi;
Verilog=*.v;
VHDL=*.vhd;*.vhdl;
@@ -79,7 +80,7 @@ None=*;
# Note: restarting is required after editing groups
[Groups]
Programming=Arduino;Clojure;CUDA;Cython;Genie;Groovy;Kotlin;Scala;Swift;
-Script=Graphviz;
+Script=Graphviz;TypeScript;
Markup=
Misc=JSON;
None=
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Nick Treleaven <n(a)trelsoft.com>
Committer: Nick Treleaven <n(a)trelsoft.com>
Date: Sat, 17 Aug 2019 10:13:20 UTC
Commit: ec0e11ca040ef142ca1ab09f34951bf809b8839d
https://github.com/geany/geany/commit/ec0e11ca040ef142ca1ab09f34951bf809b88…
Log Message:
-----------
[docs] Move error_regex section to [build-menu]; add filetype example
Modified Paths:
--------------
doc/geany.txt
Modified: doc/geany.txt
55 lines changed, 40 insertions(+), 15 deletions(-)
===================================================================
@@ -4297,26 +4297,30 @@ type
===== =======================
+[build-menu] filetype section
+`````````````````````````````
+This supports the same keys as the ``geany.conf`` `[build-menu] section`_.
+
+Example::
+
+ FT_00_LB=_Compile
+ FT_00_CM=gcc -c "%f"
+ FT_00_WD=
+ FT_01_LB=_Build
+ FT_01_CM=gcc -o "%e" "%f"
+ FT_01_WD=
+ EX_00_LB=_Execute
+ EX_00_CM="./%e"
+ EX_00_WD=
+ error_regex=^([^:]+):([0-9]+):
+
[build_settings] section
````````````````````````
-
-As of Geany 0.19 this section is supplemented by the `[build-menu] section`_.
+As of Geany 0.19 this section is for legacy support.
Values that are set in the [build-menu] section will override those in this section.
error_regex
- This is a Perl-compatible regular expression (PCRE) to parse a filename
- (absolute or relative) and line number from the build output.
- If undefined, Geany will fall back to its default error message parsing.
-
- Only the first two match groups will be read by Geany. These groups can
- occur in any order: the match group consisting of only digits will be used
- as the line number, and the other group as the filename. In no group
- consists of only digits, the match will fail.
-
- *Example:* ``error_regex=^(.+):([0-9]+):[0-9]+``
-
- This will parse a message such as:
- ``test.py:7:24: E202 whitespace before ']'``
+ See [build-menu] section for details.
**Build commands**
@@ -4734,6 +4738,8 @@ section for details. All the settings can be configured from the dialogs
except the execute command in filetype files and filetype definitions in
the project file, so these are the only ones which need hand editing.
+Menu commands
+`````````````
The build-menu section stores one entry for each setting for each menu item that
is configured. The keys for these settings have the format:
@@ -4755,6 +4761,25 @@ where:
- CM for command
- WD for working directory
+See `[build-menu] filetype section`_ for an example.
+
+Error regular expression
+````````````````````````
+error_regex
+ This is a Perl-compatible regular expression (PCRE) to parse a filename
+ (absolute or relative) and line number from the build output.
+ If undefined, Geany will fall back to its default error message parsing.
+
+ Only the first two match groups will be read by Geany. These groups can
+ occur in any order: the match group consisting of only digits will be used
+ as the line number, and the other group as the filename. In no group
+ consists of only digits, the match will fail.
+
+ *Example:* ``error_regex=^(.+):([0-9]+):[0-9]+``
+
+ This will parse a message such as:
+ ``test.py:7:24: E202 whitespace before ']'``
+
Project file format
-------------------
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).