Branch: refs/heads/master
Author: Nick Treleaven <n(a)trelsoft.com>
Committer: Nick Treleaven <n(a)trelsoft.com>
Date: Sat, 05 Oct 2019 10:35:38 UTC
Commit: 4ed084a438a415f6364dd841fabd1adf8162c1bd
https://github.com/geany/geany/commit/4ed084a438a415f6364dd841fabd1adf8162c…
Log Message:
-----------
Tweak build docs
Modified Paths:
--------------
doc/geany.txt
Modified: doc/geany.txt
41 lines changed, 17 insertions(+), 24 deletions(-)
===================================================================
@@ -3022,12 +3022,10 @@ Build menu configuration
^^^^^^^^^^^^^^^^^^^^^^^^
The build menu has considerable flexibility and configurability, allowing
-both menu labels the commands they execute and the directory they execute
+menu labels, the commands they execute and the directory they execute
in to be configured.
-
For example, if you change one of the default make commands to run say 'waf'
you can also change the label to match.
-
These settings are saved automatically when Geany is shut down.
The build menu is divided into four groups of items each with different
@@ -3041,16 +3039,16 @@ behaviors:
compiler tab and parse it for errors.
* Execute commands - are configurable and intended for executing your
program or other long running programs. The output is not parsed for errors
- and is directed to the terminal command selected in preferences.
+ and is directed to the terminal command selected in *Preferences*.
* Fixed commands - these perform built-in actions:
- * Go to the next error.
- * Go to the previous error.
- * Show the build menu commands dialog.
+* Go to the next error.
+* Go to the previous error.
+* Show the build menu commands dialog.
The maximum numbers of items in each of the configurable groups can be
-configured in the `Various preferences`_. Even though the maximum number of
-items may have been increased, only those menu items that have values
+configured in `Various preferences`_. Even though the maximum number of
+items may have been increased, only those menu items that have commands
configured are shown in the menu.
The groups of menu items obtain their configuration from four potential
@@ -3143,9 +3141,7 @@ expression used for parsing command output for error and warning messages.
The columns in the first three sections allow setting of the label, command,
and working directory to run the command in.
-
An item with an empty label will not be shown in the menu.
-
An empty working directory will default to the directory of the current document.
If there is no current document then the command will not run.
@@ -3160,24 +3156,23 @@ with the project source but can with the preferences source dialog.
The clear buttons remove the definition from the configuration source you are editing.
When you do this the command from the next lower priority source will be shown.
-To hide lower priority menu items without having anything show in the menu
-configure with a nothing in the label but at least one character in the command.
+To hide lower priority menu items without having anything show in the menu,
+configure with nothing in the label but at least one character in the command.
Substitutions in commands and working directories
`````````````````````````````````````````````````
-The first occurrence of each of the following character sequences in each of the
-command and working directory fields is substituted by the items specified below
-before the command is run.
+Before the command is run, the first occurrence of each of the following two character sequences in each of the
+command and working directory fields is substituted by the items specified below:
-* %d - substituted by the absolute path to the directory of the current file.
-* %e - substituted by the name of the current file without the extension or path.
-* %f - substituted by the name of the current file without the path.
-* %p - if a project is open, substituted by the base path from the project.
-* %l - substituted by the line number at the current cursor position.
+* %d - the absolute path to the directory of the current file.
+* %e - the name of the current file without the extension or path.
+* %f - the name of the current file without the path.
+* %p - if a project is open, the base path from the project.
+* %l - the line number at the current cursor position.
.. note::
- If the basepath set in the project preferences is not an absolute path , then it is
+ If the base path set in `Project Properties`_ is not an absolute path, then it is
taken as relative to the directory of the project file. This allows a project file
stored in the source tree to specify all commands and working directories relative
to the tree itself, so that the whole tree including the project file, can be moved
@@ -3198,12 +3193,10 @@ In the keybindings configuration dialog (see `Keybinding preferences`_)
these items are identified by the default labels shown in the `Build Menu`_ section above.
It is currently not possible to bind keyboard shortcuts to more than these menu items.
-
You can also use underlines in the labels to set mnemonic characters.
Old settings
````````````
-
The configurable Build Menu capability was introduced in Geany 0.19 and
required a new section to be added to the configuration files (See
`Preferences file format`_). Geany will still load older format project,
--------------
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, 05 Oct 2019 10:35:38 UTC
Commit: 2c80d94f714feca323629da6a9795278dee7c6f7
https://github.com/geany/geany/commit/2c80d94f714feca323629da6a9795278dee7c…
Log Message:
-----------
Wrap joined paragraphs
Modified Paths:
--------------
doc/geany.txt
Modified: doc/geany.txt
12 lines changed, 6 insertions(+), 6 deletions(-)
===================================================================
@@ -3023,9 +3023,8 @@ Build menu configuration
The build menu has considerable flexibility and configurability, allowing
menu labels, the commands they execute and the directory they execute
-in to be configured.
-For example, if you change one of the default make commands to run say 'waf'
-you can also change the label to match.
+in to be configured. For example, if you change one of the default make
+commands to run say 'waf' you can also change the label to match.
These settings are saved automatically when Geany is shut down.
The build menu is divided into four groups of items each with different
@@ -3143,9 +3142,10 @@ The filetype and independent build sections also each contain a field for the re
expression used for parsing command output for error and warning messages.
The columns in the first three sections allow setting of the label, command,
-and working directory to run the command in.
-An item with an empty label will not be shown in the menu.
-An empty working directory will default to the directory of the current document.
+and working directory to run the command in. An item with an empty
+label will not be shown in the menu. An empty working directory will
+default to the directory of the current document.
+
If there is no current document then the command will not run.
The dialog will always show the command selected by priority, not just the
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Thu, 03 Oct 2019 08:01:10 UTC
Commit: 26996aa1aaec0d48c0cc4fa6519d4876e4d57855
https://github.com/geany/geany/commit/26996aa1aaec0d48c0cc4fa6519d4876e4d57…
Log Message:
-----------
Save main and project configuration whenever documents are opened/closed
The main idea is to save the session file list more often to prevent
accidental lost but saving the rest of the configuration might help
as well.
To prevent too many save attempts, an idle function is used and it's
only added once until it was executed.
Modified Paths:
--------------
doc/pluginsignals.c
src/keyfile.c
Modified: doc/pluginsignals.c
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -141,7 +141,8 @@ signal void (*document_close)(GObject *obj, GeanyDocument *doc, gpointer user_da
signal void (*project_open)(GObject *obj, GKeyFile *config, gpointer user_data);
/** Sent when a project is saved (happens when the project is created, the properties
- * dialog is closed, before the project is closed, or when Geany is exited).
+ * dialog is closed, before the project is closed, when Geany automatically
+ * saves its configuration by opening/closing documents or when Geany is exited).
* This signal is emitted shortly before Geany will write the contents of the
* GKeyFile to the disc.
*
Modified: src/keyfile.c
37 lines changed, 37 insertions(+), 0 deletions(-)
===================================================================
@@ -106,6 +106,7 @@ static GPtrArray *session_files = NULL;
static gint session_notebook_page;
static gint hpan_position;
static gint vpan_position;
+static guint document_list_update_idle_func_id = 0;
static const gchar atomic_file_saving_key[] = "use_atomic_file_saving";
static GPtrArray *keyfile_groups = NULL;
@@ -1327,11 +1328,45 @@ void configuration_apply_settings(void)
}
+static gboolean save_configuration_cb(gpointer data)
+{
+ configuration_save();
+ if (app->project != NULL)
+ {
+ project_write_config();
+ }
+ document_list_update_idle_func_id = 0;
+ return G_SOURCE_REMOVE;
+}
+
+
+static void document_list_changed_cb(GObject *obj, GeanyDocument *doc, gpointer data)
+{
+ g_return_if_fail(doc != NULL && doc->is_valid);
+
+ /* save configuration, especially session file list, but only if we are not just starting
+ * and not about to quit */
+ if (main_status.main_window_realized &&
+ !main_status.opening_session_files &&
+ !main_status.quitting)
+ {
+ if (document_list_update_idle_func_id == 0)
+ {
+ document_list_update_idle_func_id = g_idle_add(save_configuration_cb, NULL);
+ }
+ }
+}
+
+
void configuration_init(void)
{
keyfile_groups = g_ptr_array_new();
pref_groups = g_ptr_array_new();
init_pref_groups();
+
+ g_signal_connect(geany_object, "document-open", G_CALLBACK(document_list_changed_cb), NULL);
+ g_signal_connect(geany_object, "document-save", G_CALLBACK(document_list_changed_cb), NULL);
+ g_signal_connect(geany_object, "document-close", G_CALLBACK(document_list_changed_cb), NULL);
}
@@ -1340,6 +1375,8 @@ void configuration_finalize(void)
guint i;
StashGroup *group;
+ g_signal_handlers_disconnect_by_func(geany_object, G_CALLBACK(document_list_changed_cb), NULL);
+
foreach_ptr_array(group, i, keyfile_groups)
stash_group_free(group);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Thu, 03 Oct 2019 08:01:10 UTC
Commit: ffae809a6c85ebd23db3edccfc8298e4d7a5ae27
https://github.com/geany/geany/commit/ffae809a6c85ebd23db3edccfc8298e4d7a5a…
Log Message:
-----------
Add setting, defaulting to TRUE, to disable automatic configuration save
Modified Paths:
--------------
doc/geany.txt
src/document.h
src/keyfile.c
Modified: doc/geany.txt
14 lines changed, 12 insertions(+), 2 deletions(-)
===================================================================
@@ -2636,6 +2636,16 @@ reload_clean_doc_on_file_change Whether to automatically reload documents f
on disk.
If unsaved changes exist then the user is
prompted to reload manually.
+save_config_on_file_change Automatically save Geany's configuration true immediately
+ to disk once the document list changes
+ (i.e. new documents are opened, saved or
+ closed). This helps to prevent accidentally
+ losing the session file list or other
+ changed settings when Geany is not shut
+ down cleanly. Disable this option if your
+ configuration directory is on a slow drive,
+ network share or similar and you experience
+ problems.
extract_filetype_regex Regex to extract filetype name from file See link immediately
via capture group one.
See `ft_regex`_ for default.
@@ -4714,8 +4724,8 @@ The key names cannot be configured.
Group membership is only read at startup.
.. tip::
- You can make commonly used filetypes appear in the top-level of the
- filetype menu by adding them to the `None` group, e.g.
+ You can make commonly used filetypes appear in the top-level of the
+ filetype menu by adding them to the `None` group, e.g.
`None=C;Python`.
Preferences file format
Modified: src/document.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -66,6 +66,7 @@ typedef struct GeanyFilePrefs
gboolean keep_edit_history_on_reload; /* Keep undo stack upon, and allow undoing of, document reloading. */
gboolean show_keep_edit_history_on_reload_msg; /* whether to show the message introducing the above feature */
gboolean reload_clean_doc_on_file_change;
+ gboolean save_config_on_file_change;
}
GeanyFilePrefs;
Modified: src/keyfile.c
7 lines changed, 5 insertions(+), 2 deletions(-)
===================================================================
@@ -259,6 +259,8 @@ static void init_pref_groups(void)
"show_keep_edit_history_on_reload_msg", TRUE);
stash_group_add_boolean(group, &file_prefs.reload_clean_doc_on_file_change,
"reload_clean_doc_on_file_change", FALSE);
+ stash_group_add_boolean(group, &file_prefs.save_config_on_file_change,
+ "save_config_on_file_change", TRUE);
stash_group_add_string(group, &file_prefs.extract_filetype_regex,
"extract_filetype_regex", GEANY_DEFAULT_FILETYPE_REGEX);
stash_group_add_boolean(group, &ui_prefs.allow_always_save,
@@ -275,7 +277,7 @@ static void init_pref_groups(void)
/* Note: Interface-related various prefs are in ui_init_prefs() */
/* various build-menu prefs */
- // Warning: don't move PACKAGE group name items here
+ // Warning: don't move PACKAGE group name items here
group = stash_group_new("build-menu");
configuration_add_various_pref_group(group, "build");
@@ -1346,7 +1348,8 @@ static void document_list_changed_cb(GObject *obj, GeanyDocument *doc, gpointer
/* save configuration, especially session file list, but only if we are not just starting
* and not about to quit */
- if (main_status.main_window_realized &&
+ if (file_prefs.save_config_on_file_change &&
+ main_status.main_window_realized &&
!main_status.opening_session_files &&
!main_status.quitting)
{
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).