Configurable Build Menu Alpha

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/build-system@3941 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Lex Trotman 2009-07-09 06:49:42 +00:00
parent 80d2802e1a
commit 1726e57092
13 changed files with 1760 additions and 1565 deletions

View File

@ -1,3 +1,25 @@
2009-07-09 geany test <elextr(at)gmail(dot)com>
Configurable Build Menu Changes
* doc/geany.html, doc/geany.txt:
Updated build menu section to new functionality
* src/build.h, src/build.c:
Largly re-written, configurability added, Latex code removed
* src/filetypes.h, src/filetypes.c:
Filetype structure updated to add new command pointers, configuration
load and store changed
* src/keybindings.h, src/keybindings.c:
Changed to address new command storage structure.
* src/keyfile.c:
Changed to load/store new configuration.
* src/main.c:
Minor change to initialisation order.
* src/msgwindow.c:
Changed to address new menu item storage structure.
* src/project.h, src/project.c:
Changed to load/store the new configuration info.
2009-06-14 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/encodings.c, src/encodings.h, src/plugindata.h:

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>Geany</title>
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" />
<meta name="date" content="2009-06-01" />
<meta name="date" content="2009-06-04" />
<style type="text/css">
/*
@ -139,7 +139,7 @@ Stylesheet for Geany's documentation based on a version of John Gabriele.
<br />Nick Treleaven
<br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>2009-06-01</td></tr>
<td>2009-06-04</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.18</td></tr>
</tbody>
@ -328,99 +328,101 @@ of this program, and also in the chapter <a class="reference" href="#gnu-general
<li><a class="reference" href="#close-project" id="id123" name="id123">Close Project</a></li>
</ul>
</li>
<li><a class="reference" href="#build-system" id="id124" name="id124">Build system</a><ul>
<li><a class="reference" href="#compile" id="id125" name="id125">Compile</a></li>
<li><a class="reference" href="#build" id="id126" name="id126">Build</a></li>
<li><a class="reference" href="#make-all" id="id127" name="id127">Make all</a></li>
<li><a class="reference" href="#make-custom-target" id="id128" name="id128">Make custom target</a></li>
<li><a class="reference" href="#make-object" id="id129" name="id129">Make object</a></li>
<li><a class="reference" href="#execute" id="id130" name="id130">Execute</a></li>
<li><a class="reference" href="#stopping-running-processes" id="id131" name="id131">Stopping running processes</a><ul>
<li><a class="reference" href="#terminal-emulators" id="id132" name="id132">Terminal emulators</a></li>
<li><a class="reference" href="#build-menu" id="id124" name="id124">Build Menu</a><ul>
<li><a class="reference" href="#indicators" id="id125" name="id125">Indicators</a></li>
<li><a class="reference" href="#default-build-menu-items" id="id126" name="id126">Default Build Menu Items</a><ul>
<li><a class="reference" href="#compile" id="id127" name="id127">Compile</a></li>
<li><a class="reference" href="#build" id="id128" name="id128">Build</a></li>
<li><a class="reference" href="#make" id="id129" name="id129">Make</a></li>
<li><a class="reference" href="#make-custom-target" id="id130" name="id130">Make custom target</a></li>
<li><a class="reference" href="#make-object" id="id131" name="id131">Make object</a></li>
<li><a class="reference" href="#execute" id="id132" name="id132">Execute</a></li>
<li><a class="reference" href="#stopping-running-processes" id="id133" name="id133">Stopping running processes</a><ul>
<li><a class="reference" href="#terminal-emulators" id="id134" name="id134">Terminal emulators</a></li>
</ul>
</li>
<li><a class="reference" href="#set-includes-and-arguments" id="id133" name="id133">Set Includes and Arguments</a><ul>
<li><a class="reference" href="#one-step-compilation" id="id134" name="id134">One step compilation</a></li>
<li><a class="reference" href="#set-build-commands" id="id135" name="id135">Set Build Commands</a></li>
</ul>
</li>
<li><a class="reference" href="#indicators" id="id135" name="id135">Indicators</a></li>
<li><a class="reference" href="#build-menu-configuration" id="id136" name="id136">Build Menu Configuration</a></li>
<li><a class="reference" href="#build-menu-commands-dialog" id="id137" name="id137">Build Menu Commands Dialog</a></li>
</ul>
</li>
<li><a class="reference" href="#printing-support" id="id136" name="id136">Printing support</a></li>
<li><a class="reference" href="#plugins" id="id137" name="id137">Plugins</a></li>
<li><a class="reference" href="#keybindings" id="id138" name="id138">Keybindings</a><ul>
<li><a class="reference" href="#switching-documents" id="id139" name="id139">Switching documents</a></li>
<li><a class="reference" href="#configurable-keybindings" id="id140" name="id140">Configurable keybindings</a></li>
<li><a class="reference" href="#printing-support" id="id138" name="id138">Printing support</a></li>
<li><a class="reference" href="#plugins" id="id139" name="id139">Plugins</a></li>
<li><a class="reference" href="#keybindings" id="id140" name="id140">Keybindings</a><ul>
<li><a class="reference" href="#switching-documents" id="id141" name="id141">Switching documents</a></li>
<li><a class="reference" href="#configurable-keybindings" id="id142" name="id142">Configurable keybindings</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#configuration-files" id="id141" name="id141">Configuration files</a><ul>
<li><a class="reference" href="#global-configuration-file" id="id142" name="id142">Global configuration file</a></li>
<li><a class="reference" href="#filetype-definition-files" id="id143" name="id143">Filetype definition files</a><ul>
<li><a class="reference" href="#format" id="id144" name="id144">Format</a><ul>
<li><a class="reference" href="#styling-section" id="id145" name="id145">[styling] Section</a></li>
<li><a class="reference" href="#keywords-section" id="id146" name="id146">[keywords] Section</a></li>
<li><a class="reference" href="#settings-section" id="id147" name="id147">[settings] Section</a></li>
<li><a class="reference" href="#build-settings-section" id="id148" name="id148">[build_settings] Section</a></li>
<li><a class="reference" href="#configuration-files" id="id143" name="id143">Configuration files</a><ul>
<li><a class="reference" href="#global-configuration-file" id="id144" name="id144">Global configuration file</a></li>
<li><a class="reference" href="#filetype-definition-files" id="id145" name="id145">Filetype definition files</a><ul>
<li><a class="reference" href="#format" id="id146" name="id146">Format</a><ul>
<li><a class="reference" href="#styling-section" id="id147" name="id147">[styling] Section</a></li>
<li><a class="reference" href="#keywords-section" id="id148" name="id148">[keywords] Section</a></li>
<li><a class="reference" href="#settings-section" id="id149" name="id149">[settings] Section</a></li>
<li><a class="reference" href="#build-settings-section" id="id150" name="id150">[build_settings] Section</a></li>
</ul>
</li>
<li><a class="reference" href="#special-file-filetypes-common" id="id149" name="id149">Special file filetypes.common</a><ul>
<li><a class="reference" href="#named-styles-section" id="id150" name="id150">[named_styles] Section</a></li>
<li><a class="reference" href="#id4" id="id151" name="id151">[styling] Section</a></li>
<li><a class="reference" href="#id5" id="id152" name="id152">[settings] Section</a></li>
<li><a class="reference" href="#special-file-filetypes-common" id="id151" name="id151">Special file filetypes.common</a><ul>
<li><a class="reference" href="#named-styles-section" id="id152" name="id152">[named_styles] Section</a></li>
<li><a class="reference" href="#id4" id="id153" name="id153">[styling] Section</a></li>
<li><a class="reference" href="#id5" id="id154" name="id154">[settings] Section</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#filetype-extensions" id="id153" name="id153">Filetype extensions</a></li>
<li><a class="reference" href="#templates" id="id154" name="id154">Templates</a><ul>
<li><a class="reference" href="#template-meta-data" id="id155" name="id155">Template meta data</a></li>
<li><a class="reference" href="#file-templates" id="id156" name="id156">File templates</a><ul>
<li><a class="reference" href="#custom-file-templates" id="id157" name="id157">Custom file templates</a></li>
<li><a class="reference" href="#filetype-templates" id="id158" name="id158">Filetype templates</a></li>
<li><a class="reference" href="#filetype-extensions" id="id155" name="id155">Filetype extensions</a></li>
<li><a class="reference" href="#templates" id="id156" name="id156">Templates</a><ul>
<li><a class="reference" href="#template-meta-data" id="id157" name="id157">Template meta data</a></li>
<li><a class="reference" href="#file-templates" id="id158" name="id158">File templates</a><ul>
<li><a class="reference" href="#custom-file-templates" id="id159" name="id159">Custom file templates</a></li>
<li><a class="reference" href="#filetype-templates" id="id160" name="id160">Filetype templates</a></li>
</ul>
</li>
<li><a class="reference" href="#customizing-templates" id="id159" name="id159">Customizing templates</a><ul>
<li><a class="reference" href="#template-wildcards" id="id160" name="id160">Template wildcards</a></li>
<li><a class="reference" href="#customizing-templates" id="id161" name="id161">Customizing templates</a><ul>
<li><a class="reference" href="#template-wildcards" id="id162" name="id162">Template wildcards</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#customizing-the-toolbar" id="id161" name="id161">Customizing the toolbar</a><ul>
<li><a class="reference" href="#available-toolbar-elements" id="id162" name="id162">Available toolbar elements</a></li>
<li><a class="reference" href="#customizing-the-toolbar" id="id163" name="id163">Customizing the toolbar</a><ul>
<li><a class="reference" href="#available-toolbar-elements" id="id164" name="id164">Available toolbar elements</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#plugin-documentation" id="id163" name="id163">Plugin documentation</a><ul>
<li><a class="reference" href="#instant-save" id="id164" name="id164">Instant Save</a></li>
<li><a class="reference" href="#backup-copy" id="id165" name="id165">Backup Copy</a></li>
<li><a class="reference" href="#plugin-documentation" id="id165" name="id165">Plugin documentation</a><ul>
<li><a class="reference" href="#instant-save" id="id166" name="id166">Instant Save</a></li>
<li><a class="reference" href="#backup-copy" id="id167" name="id167">Backup Copy</a></li>
</ul>
</li>
<li><a class="reference" href="#contributing-to-this-document" id="id166" name="id166">Contributing to this document</a></li>
<li><a class="reference" href="#scintilla-keyboard-commands" id="id167" name="id167">Scintilla keyboard commands</a><ul>
<li><a class="reference" href="#keyboard-commands" id="id168" name="id168">Keyboard commands</a></li>
<li><a class="reference" href="#contributing-to-this-document" id="id168" name="id168">Contributing to this document</a></li>
<li><a class="reference" href="#scintilla-keyboard-commands" id="id169" name="id169">Scintilla keyboard commands</a><ul>
<li><a class="reference" href="#keyboard-commands" id="id170" name="id170">Keyboard commands</a></li>
</ul>
</li>
<li><a class="reference" href="#tips-and-tricks" id="id169" name="id169">Tips and tricks</a><ul>
<li><a class="reference" href="#document-notebook" id="id170" name="id170">Document notebook</a></li>
<li><a class="reference" href="#editor" id="id171" name="id171">Editor</a></li>
<li><a class="reference" href="#interface" id="id172" name="id172">Interface</a></li>
<li><a class="reference" href="#gtk-related" id="id173" name="id173">GTK-related</a></li>
<li><a class="reference" href="#tips-and-tricks" id="id171" name="id171">Tips and tricks</a><ul>
<li><a class="reference" href="#document-notebook" id="id172" name="id172">Document notebook</a></li>
<li><a class="reference" href="#editor" id="id173" name="id173">Editor</a></li>
<li><a class="reference" href="#interface" id="id174" name="id174">Interface</a></li>
<li><a class="reference" href="#gtk-related" id="id175" name="id175">GTK-related</a></li>
</ul>
</li>
<li><a class="reference" href="#hidden-preferences" id="id174" name="id174">Hidden preferences</a></li>
<li><a class="reference" href="#compile-time-options" id="id175" name="id175">Compile-time options</a><ul>
<li><a class="reference" href="#src-geany-h" id="id176" name="id176">src/geany.h</a></li>
<li><a class="reference" href="#project-h" id="id177" name="id177">project.h</a></li>
<li><a class="reference" href="#editor-h" id="id178" name="id178">editor.h</a></li>
<li><a class="reference" href="#keyfile-c" id="id179" name="id179">keyfile.c</a></li>
<li><a class="reference" href="#build-h" id="id180" name="id180">build.h</a></li>
<li><a class="reference" href="#hidden-preferences" id="id176" name="id176">Hidden preferences</a></li>
<li><a class="reference" href="#compile-time-options" id="id177" name="id177">Compile-time options</a><ul>
<li><a class="reference" href="#src-geany-h" id="id178" name="id178">src/geany.h</a></li>
<li><a class="reference" href="#project-h" id="id179" name="id179">project.h</a></li>
<li><a class="reference" href="#editor-h" id="id180" name="id180">editor.h</a></li>
<li><a class="reference" href="#keyfile-c" id="id181" name="id181">keyfile.c</a></li>
<li><a class="reference" href="#build-h" id="id182" name="id182">build.h</a></li>
</ul>
</li>
<li><a class="reference" href="#gnu-general-public-license" id="id181" name="id181">GNU General Public License</a></li>
<li><a class="reference" href="#license-for-scintilla-and-scite" id="id182" name="id182">License for Scintilla and SciTE</a></li>
<li><a class="reference" href="#gnu-general-public-license" id="id183" name="id183">GNU General Public License</a></li>
<li><a class="reference" href="#license-for-scintilla-and-scite" id="id184" name="id184">License for Scintilla and SciTE</a></li>
</ul>
</div>
<div class="section">
@ -2414,24 +2416,42 @@ session files and open any previously closed default session files.</p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id124" id="build-system" name="build-system">Build system</a></h2>
<p>Geany has an integrated build system. Firstly this means that the
current source file will be saved before it is processed. This is
for convenience so that you don't need to keep saving small changes
to the current file before building.</p>
<p>Secondly the output for Compile, Build and Make actions will be captured
in the Compiler notebook tab of the messages window. If there are
any warnings or errors with line numbers shown in red in the Compiler
output tab, you can click on them and Geany will switch to the relevant
source file (or open it) and mark the line number so the problem can be
corrected. Geany will also set indicators for warnings or errors with
line numbers.</p>
<h2><a class="toc-backref" href="#id124" id="build-menu" name="build-menu">Build Menu</a></h2>
<p>After editing code with Geany, the next step is to compile, link, build,
interpret, run etc. As Geany supports many languages each with a different
approach to such operations, and as there are also many language independant
software building systems, Geany does not have a built in build system, nor
does it limit which system you can use. Instead the build menu provides
a configurable and flexible means of running any external commands required.</p>
<p>Running the commands from within Geany has two benefits:</p>
<ul class="simple">
<li>the current file is automatically saved before the command is run</li>
<li>the output is captured in the Compiler notebook tab and parsed for
warnings or errors</li>
</ul>
<p>Warnings and errors that can be parsed for line numbers will be shown in
red in the Compiler tab and you can click on them to switch to the relevant
source file (or open it) and mark the line number. Also lines with
warnings or errors are marked in the source, see Indicators below.</p>
<p>This section provides a description of the default configuration of the
build menu and then of how to configure it and where the defaults fit in.</p>
<div class="tip">
<p class="first admonition-title">Tip</p>
<p class="last">If Geany's default error message parsing does not parse errors for
the tool you're using, you can set a custom regex. See <a class="reference" href="#filetype-definition-files">Filetype
definition files</a> and the <a class="reference" href="#build-settings-section">[build_settings] Section</a>.</p>
the tool you're using, you can set a custom regex in the Build Commands
Dialog, see ...</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id125" id="indicators" name="indicators">Indicators</a></h3>
<p>Indicators are red squiggly underlines which are used to highlight
errors which occurred while compiling the current file. So you can
easily see where your code failed to compile. To remove the indicators,
just click on &quot;Remove all indicators&quot; in the document file menu.</p>
<p>If you do not like this feature, you can disable it in the preferences
dialog.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id126" id="default-build-menu-items" name="default-build-menu-items">Default Build Menu Items</a></h3>
<p>Depending on the current file's filetype, the Build menu will contain
the following items:</p>
<ul class="simple">
@ -2441,10 +2461,10 @@ the following items:</p>
<li>Make Custom Target</li>
<li>Make Object</li>
<li>Execute</li>
<li>Set Includes and Arguments</li>
<li>Set Build Menu Commands</li>
</ul>
<div class="section">
<h3><a class="toc-backref" href="#id125" id="compile" name="compile">Compile</a></h3>
<h4><a class="toc-backref" href="#id127" id="compile" name="compile">Compile</a></h4>
<p>The Compile command has different uses for different kinds of files.</p>
<p>For compilable languages such as C and C++, the Compile command is
setup to compile the current source file into a binary object file.</p>
@ -2454,7 +2474,7 @@ language supports it, or will run a syntax check, or failing that
will run the file in its language interpreter.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id126" id="build" name="build">Build</a></h3>
<h4><a class="toc-backref" href="#id128" id="build" name="build">Build</a></h4>
<p>For compilable languages such as C and C++, the Build command will link
the current source file's equivalent object file into an executable. If
the object file does not exist, the source will be compiled and linked
@ -2462,29 +2482,24 @@ in one step, producing just the executable binary.</p>
<p>Interpreted languages do not use the Build command.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id127" id="make-all" name="make-all">Make all</a></h3>
<p>This effectively runs &quot;make all&quot; in the same directory as the
<h4><a class="toc-backref" href="#id129" id="make" name="make">Make</a></h4>
<p>This effectively runs &quot;make&quot; in the same directory as the
current file.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">For each of the Make commands, The Make tool path must be correctly
set in the Tools tab of the Preferences dialog.</p>
</div>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id128" id="make-custom-target" name="make-custom-target">Make custom target</a></h3>
<p>This is similar to running 'Make all' but you will be prompted for
<h4><a class="toc-backref" href="#id130" id="make-custom-target" name="make-custom-target">Make custom target</a></h4>
<p>This is similar to running 'Make' but you will be prompted for
the make target name to be passed to the Make tool. For example,
typing 'clean' in the dialog prompt will run &quot;make clean&quot;.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id129" id="make-object" name="make-object">Make object</a></h3>
<h4><a class="toc-backref" href="#id131" id="make-object" name="make-object">Make object</a></h4>
<p>Make object will run &quot;make current_file.o&quot; in the same directory as
the current file, using its prefix for 'current_file'. It is useful
for compiling just the current file without building the whole project.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id130" id="execute" name="execute">Execute</a></h3>
<h4><a class="toc-backref" href="#id132" id="execute" name="execute">Execute</a></h4>
<p>Execute will run the corresponding executable file, shell script or
interpreted script in a terminal window. Note that the Terminal tool
path must be correctly set in the Tools tab of the Preferences dialog -
@ -2493,18 +2508,20 @@ and accept the &quot;-e&quot; command line argument to start a command.</p>
<p>After your program or script has finished executing, you will be
prompted to press the return key. This allows you to review any text
output from the program before the terminal window is closed.</p>
<p>The execute command output is not parsed for errors.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id131" id="stopping-running-processes" name="stopping-running-processes">Stopping running processes</a></h3>
<p>When there is a running program, the Run button in the toolbar
<h4><a class="toc-backref" href="#id133" id="stopping-running-processes" name="stopping-running-processes">Stopping running processes</a></h4>
<p>When there is a running program, the Execute menu item in the menu and
the Run button in the toolbar
becomes a stop button and you can stop the current action. This
works by sending a signal to the process (and its child process(es))
to stop the process. The used signal is SIGQUIT.</p>
<p>Depending on the process you started it might occur that the process
cannot be stopped. This can happen when the process creates more than
one child process.</p>
<p>Depending on the process you started it might be that the process
cannot be stopped. For example this can happen when the process creates
more than one child process.</p>
<div class="section">
<h4><a class="toc-backref" href="#id132" id="terminal-emulators" name="terminal-emulators">Terminal emulators</a></h4>
<h5><a class="toc-backref" href="#id134" id="terminal-emulators" name="terminal-emulators">Terminal emulators</a></h5>
<p>Xterm is known to work properly. If you are using &quot;Terminal&quot;
(the terminal program of Xfce), you should add the command line
option <tt class="docutils literal"><span class="pre">--disable-server</span></tt> otherwise the started process cannot be
@ -2513,10 +2530,10 @@ tab in the terminal field.</p>
</div>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id133" id="set-includes-and-arguments" name="set-includes-and-arguments">Set Includes and Arguments</a></h3>
<p>By default the Compile and Build commands invoke the compiler and
<h4><a class="toc-backref" href="#id135" id="set-build-commands" name="set-build-commands">Set Build Commands</a></h4>
<p>By default the Compile and Build commands invoke the GCC compiler and
linker with only the basic arguments needed by all programs. Using
Set Includes and Arguments you can add any include paths and compile
Set Build Commands you can add any include paths and compile
flags for the compiler, any library names and paths for the linker,
and any arguments you want to use when running Execute.</p>
<div class="note">
@ -2533,25 +2550,185 @@ build your software.</p>
<li>%e -- filename without path and without extension</li>
</ul>
<p>See <a class="reference" href="#build-settings-section">[build_settings] Section</a> for details.</p>
<div class="section">
<h4><a class="toc-backref" href="#id134" id="one-step-compilation" name="one-step-compilation">One step compilation</a></h4>
<p>If you are using the Build command to compile and link in one step,
you will need to set both the compiler arguments and the linker
arguments in the linker command setting.</p>
</div>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id135" id="indicators" name="indicators">Indicators</a></h3>
<p>Indicators are red squiggly underlines which are used to highlight
errors which occurred while compiling the current file. So you can
easily see where your code failed to compile. To remove the indicators,
just click on &quot;Remove all indicators&quot; in the document file menu.</p>
<p>If you do not like this feature, you can disable it in the preferences
dialog.</p>
<h3><a class="toc-backref" href="#id136" id="build-menu-configuration" name="build-menu-configuration">Build Menu Configuration</a></h3>
<p>The build menu has considerable flexibility and configurability, allowing
both menu labels and the commands they execute to be configured. If you change
one of the default make commands to run say 'waf' you can also change the
label to match. Underlines in the labels set mnemonic characters.</p>
<p>The build menu is divided into four groups of items each with different
behaviors:</p>
<ul class="simple">
<li>file items - are configurable and depend on the filetype of the current
document, put the output in the compiler tab and parse it for errors</li>
<li>non-file items - are configurable and mostly don't depend on the filetype
of the current document, put the output in the compiler tab and parse
it for errors</li>
<li>execute items - are configurable and intended for executing your
program or other long running programs. The output is not parsed for errors.</li>
<li>fixed items - are not configurable because they perform Geany built in actions
go to next error, go to the previous error and show the build menu
commands dialog</li>
</ul>
<p>The maximum numbers of items in each of the configurable groups can be
configured when Geany starts (see...). Even though the maximum number of
items may have been increased, only those menu items that are actually configured
are shown in the menu.</p>
<p>The groups of menu items obtain their configuration from four potential
sources. The highest pririty source that has the menu item defined will
be used. The sources in decreasing priority are:</p>
<ul class="simple">
<li>a project file if open</li>
<li>the user preferences</li>
<li>the system filetype definitions</li>
<li>the defaults</li>
</ul>
<p>The detailed relationships between sources and the configurable menu item groups
is shown in the following table.</p>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="19%" />
<col width="23%" />
<col width="17%" />
<col width="28%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Group</th>
<th class="head">Project File</th>
<th class="head">Preferences</th>
<th class="head">System Filetype</th>
<th class="head">Defaults</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>Filetype</td>
<td><p class="first">Loads From: project
file</p>
<p class="last">Saves To: project
file</p>
</td>
<td><p class="first">Loads From:
filetype.xxx file in
~/.config/geany/filedefs</p>
<p class="last">Saves to: as above,
creating if needed.</p>
</td>
<td><p class="first">Loads From:
filetype.xxx in
Geany install</p>
<p class="last">Saves to: as user
preferences left.</p>
</td>
<td>None</td>
</tr>
<tr><td>Non-Filetype</td>
<td><p class="first">Loads From: project
file</p>
<p class="last">Saves To: project
file</p>
</td>
<td><p class="first">Loads From:
geany.conf file in
~/.config/geany</p>
<p class="last">Saves to: as above,
creating if needed.</p>
</td>
<td><p class="first">Loads From:
filetype.xxx in
Geany install</p>
<p class="last">Saves to: as user
preferences left.</p>
</td>
<td><dl class="first last docutils">
<dt>1:</dt>
<dd>Label: _Make
Command: make</dd>
<dt>2:</dt>
<dd>Label: Make Custom _Target
Command: make</dd>
<dt>3:</dt>
<dd>Label: Make _Object
Command: make %e.o</dd>
</dl>
</td>
</tr>
<tr><td>Execute</td>
<td><p class="first">Loads From: project
file or else
filetype defined in
project file</p>
<p class="last">Saves To:
project file</p>
</td>
<td><p class="first">Loads From:
geany.conf file in
~/.config/geany or else
filetype.xxx file in
~/.config/geany/filedefs</p>
<p class="last">Saves To:
geany.conf file in
~/.config/geany</p>
</td>
<td><p class="first">Loads From:
filetype.xxx in
Geany install</p>
<p class="last">Saves To: as user
preferences left</p>
</td>
<td>Label: _Execute Command: ./%e</td>
</tr>
</tbody>
</table>
<p>The following notes on the table reference cells by coordinate as (group,source):</p>
<ul class="simple">
<li>General - for filetype.xxx substitute the appropriate extension for xxx.</li>
<li>(Filetype, Project File) and (Filetype, Preferences) - preferences use a full
filetype file so that users can configure all other filetype preferences
as well. Projects can only configure menu items per filetype. Saving
in the project file means that there is only one file per project not
a whole directory.</li>
<li>(Non-Filetype, System Filetype) - although conceptually strange, defining
non-filetype commands in a filetype file, this provides the ability to
define filetype dependent default menu items.</li>
<li>(Execute, Project File) and (Execute, Preferences) - the execute configuration
can only be set by hand editing the appropriate file.</li>
</ul>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id137" id="build-menu-commands-dialog" name="build-menu-commands-dialog">Build Menu Commands Dialog</a></h3>
<p>Most of the configuration of the build menu is done through the Build Menu
Commands Dialog. You edit the configuration sourced from preferences in the
dialog opened from the Build-&gt;Build Menu Commands item and you edit the
configuration from the project in the build tab of the project preferences
dialog. Both use the same form shown below.</p>
<p>Image here</p>
<p>The dialog is divided into three sections for Filetype menu items which
will be selected based on the filetype of the currently open document,
Non-filetype menu items and execute menu items and a section for the regular
expression used for parsing command output for error and warning messages.</p>
<p>The columns in the first three sections allow setting of the label and command
and for Non-filetype and Execute commands the selection of which directory
to run the command in. If a project is open and base is checked, the command
is run in the base directory defined for the project otherwise it is run
in the directory of the current document, or not run at all if no current document.</p>
<p>The dialog will always show the command selected by priority, not just the
commands configured in this configuration source. This ensures that you always
see what the menu is going to do if activated.</p>
<p>If the current source of the menu item is higher priority than the
configuration source you are editing then the command will be shown
in the dialog but will be insensitive (greyed out). This can't happen
with the project source but can with the preferences source dialog.</p>
<p>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.</p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id136" id="printing-support" name="printing-support">Printing support</a></h2>
<h2><a class="toc-backref" href="#id138" id="printing-support" name="printing-support">Printing support</a></h2>
<p>Since Geany 0.13 there is full printing support using GTK's printing API.
The printed page(s) will look nearly the same as on your screen in Geany.
Additionally, there are some options to modify the printed page(s). You
@ -2599,7 +2776,7 @@ command line).</p>
gtklp or similar programs can be used.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id137" id="plugins" name="plugins">Plugins</a></h2>
<h2><a class="toc-backref" href="#id139" id="plugins" name="plugins">Plugins</a></h2>
<p>Plugins are loaded at startup, if the <em>Enable plugin support</em>
general preference is set. There is also a command-line option,
<tt class="docutils literal"><span class="pre">-p</span></tt>, which prevents plugins being loaded. Plugins are scanned in
@ -2620,13 +2797,13 @@ provides some.</p>
which are included in Geany.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id138" id="keybindings" name="keybindings">Keybindings</a></h2>
<h2><a class="toc-backref" href="#id140" id="keybindings" name="keybindings">Keybindings</a></h2>
<p>Geany supports the default keyboard shortcuts for the Scintilla
editing widget. For a list of these commands, see <a class="reference" href="#scintilla-keyboard-commands">Scintilla
keyboard commands</a>. The Scintilla keyboard shortcuts will be overridden
by any custom keybindings with the same keyboard shortcut.</p>
<div class="section">
<h3><a class="toc-backref" href="#id139" id="switching-documents" name="switching-documents">Switching documents</a></h3>
<h3><a class="toc-backref" href="#id141" id="switching-documents" name="switching-documents">Switching documents</a></h3>
<p>There are a few non-configurable bindings to switch between documents,
listed below. These can also be overridden by custom keybindings.</p>
<table border="1" class="docutils">
@ -2656,7 +2833,7 @@ listed below. These can also be overridden by custom keybindings.</p>
</table>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id140" id="configurable-keybindings" name="configurable-keybindings">Configurable keybindings</a></h3>
<h3><a class="toc-backref" href="#id142" id="configurable-keybindings" name="configurable-keybindings">Configurable keybindings</a></h3>
<p>For all actions listed below you can define your own keybindings. Open
the Preferences dialog, select the desired action and click on
change. In the opening dialog you can press any key combination you
@ -3274,9 +3451,9 @@ the last build process.</td>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id141" id="configuration-files" name="configuration-files">Configuration files</a></h1>
<h1><a class="toc-backref" href="#id143" id="configuration-files" name="configuration-files">Configuration files</a></h1>
<div class="section">
<h2><a class="toc-backref" href="#id142" id="global-configuration-file" name="global-configuration-file">Global configuration file</a></h2>
<h2><a class="toc-backref" href="#id144" id="global-configuration-file" name="global-configuration-file">Global configuration file</a></h2>
<p>You can use a global configuration file for Geany which will be used if
the user starts Geany for the first time and an user's configuration
file was not yet created or in case an user deleted the configuration
@ -3296,7 +3473,7 @@ need to do that.</p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id143" id="filetype-definition-files" name="filetype-definition-files">Filetype definition files</a></h2>
<h2><a class="toc-backref" href="#id145" id="filetype-definition-files" name="filetype-definition-files">Filetype definition files</a></h2>
<p>All color definitions and other filetype specific settings are
stored in the filetype definition files. Those settings are colors
for syntax highlighting, general settings like comment characters or
@ -3327,9 +3504,9 @@ configuration directory. Alternatively, you can create a file
to change. All missing settings will be read from the corresponding
global definition file in <tt class="docutils literal"><span class="pre">$prefix/share/geany</span></tt>.</p>
<div class="section">
<h3><a class="toc-backref" href="#id144" id="format" name="format">Format</a></h3>
<h3><a class="toc-backref" href="#id146" id="format" name="format">Format</a></h3>
<div class="section">
<h4><a class="toc-backref" href="#id145" id="styling-section" name="styling-section">[styling] Section</a></h4>
<h4><a class="toc-backref" href="#id147" id="styling-section" name="styling-section">[styling] Section</a></h4>
<p>In this section the colors for syntax highlighting are defined. The
manual format is:</p>
<ul class="simple">
@ -3358,7 +3535,7 @@ named style is used or not.</p>
Section</a>.</p>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id146" id="keywords-section" name="keywords-section">[keywords] Section</a></h4>
<h4><a class="toc-backref" href="#id148" id="keywords-section" name="keywords-section">[keywords] Section</a></h4>
<p>This section contains keys for different keyword lists specific to
the filetype. Some filetypes do not support keywords, so adding a
new key will not work. You can only add or remove keywords to/from
@ -3369,7 +3546,7 @@ an existing list.</p>
</div>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id147" id="settings-section" name="settings-section">[settings] Section</a></h4>
<h4><a class="toc-backref" href="#id149" id="settings-section" name="settings-section">[settings] Section</a></h4>
<dl class="docutils">
<dt>extension</dt>
<dd><p class="first">This is the default file extension used when saving files, not
@ -3430,7 +3607,7 @@ context_action_cmd=firefox &quot;<a class="reference" href="http://www.php.net/%
</dl>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id148" id="build-settings-section" name="build-settings-section">[build_settings] Section</a></h4>
<h4><a class="toc-backref" href="#id150" id="build-settings-section" name="build-settings-section">[build_settings] Section</a></h4>
<dl class="docutils">
<dt>error_regex</dt>
<dd><p class="first">This is a GNU-style extended regular expression to parse a filename
@ -3445,8 +3622,8 @@ remaining match will be used as the filename.</p>
</dd>
</dl>
<p><strong>Build commands</strong></p>
<p>The build commands are all configurable using the <a class="reference" href="#set-includes-and-arguments">Set Includes and
Arguments</a> dialog.</p>
<p>The build commands are all configurable using the <a class="reference" href="#build-menu-commands-dialog">Build Menu
Commands Dialog</a> dialog.</p>
<dl class="docutils">
<dt>compiler</dt>
<dd><p class="first">This item specifies the command to compile source code files. But
@ -3479,13 +3656,13 @@ complete filename, e.g. for shell scripts.</p>
</div>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id149" id="special-file-filetypes-common" name="special-file-filetypes-common">Special file filetypes.common</a></h3>
<h3><a class="toc-backref" href="#id151" id="special-file-filetypes-common" name="special-file-filetypes-common">Special file filetypes.common</a></h3>
<p>There is a special filetype definition file called
filetypes.common. This file defines some general non-filetype-specific
settings.</p>
<p>See the <a class="reference" href="#format">Format</a> section for how to define styles.</p>
<div class="section">
<h4><a class="toc-backref" href="#id150" id="named-styles-section" name="named-styles-section">[named_styles] Section</a></h4>
<h4><a class="toc-backref" href="#id152" id="named-styles-section" name="named-styles-section">[named_styles] Section</a></h4>
<p>Named styles declared here can be used in the [styling] section of any
filetypes.* file.</p>
<p>For example:</p>
@ -3510,7 +3687,7 @@ original style.</p>
</div>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id151" id="id4" name="id4">[styling] Section</a></h4>
<h4><a class="toc-backref" href="#id153" id="id4" name="id4">[styling] Section</a></h4>
<dl class="docutils">
<dt>default</dt>
<dd><p class="first">This is the default style. It is used for styling files without a
@ -3665,7 +3842,7 @@ keep this value at 256 to disable translucency otherwise Geany might crash.</p>
</dl>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id152" id="id5" name="id5">[settings] Section</a></h4>
<h4><a class="toc-backref" href="#id154" id="id5" name="id5">[settings] Section</a></h4>
<dl class="docutils">
<dt>whitespace_chars</dt>
<dd><p class="first">Characters to treat as whitespace. These characters are ignored
@ -3679,7 +3856,7 @@ when moving, selecting and deleting across word boundaries
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id153" id="filetype-extensions" name="filetype-extensions">Filetype extensions</a></h2>
<h2><a class="toc-backref" href="#id155" id="filetype-extensions" name="filetype-extensions">Filetype extensions</a></h2>
<p>To change the default filetype extension used when saving a new file,
see <a class="reference" href="#filetype-definition-files">Filetype definition files</a>.</p>
<p>You can override the list of file extensions that Geany uses for each
@ -3705,7 +3882,7 @@ Make=Makefile*;*.mk;Buildfile;
</pre>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id154" id="templates" name="templates">Templates</a></h2>
<h2><a class="toc-backref" href="#id156" id="templates" name="templates">Templates</a></h2>
<p>Geany supports the following templates:</p>
<ul class="simple">
<li>ChangeLog entry</li>
@ -3728,7 +3905,7 @@ of a function or the function name cannot be determined, the inserted
function description won't contain the correct function name but &quot;unknown&quot;
instead.</p>
<div class="section">
<h3><a class="toc-backref" href="#id155" id="template-meta-data" name="template-meta-data">Template meta data</a></h3>
<h3><a class="toc-backref" href="#id157" id="template-meta-data" name="template-meta-data">Template meta data</a></h3>
<p>Meta data can be used with all templates, but by default user set
meta data is only used for the ChangeLog and File header templates.</p>
<p>In the configuration dialog you can find a tab &quot;Templates&quot; (see
@ -3738,7 +3915,7 @@ restart Geany after making changes, because they are only read
at startup.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id156" id="file-templates" name="file-templates">File templates</a></h3>
<h3><a class="toc-backref" href="#id158" id="file-templates" name="file-templates">File templates</a></h3>
<p>File templates are templates used as the basis of a new file. To
use them, choose the <em>New (with Template)</em> menu item from the <em>File</em>
menu.</p>
@ -3750,7 +3927,7 @@ except for the optional <tt class="docutils literal"><span class="pre">{filehead
be placed anywhere, but is usually on the first line of the file,
followed by a blank line.</p>
<div class="section">
<h4><a class="toc-backref" href="#id157" id="custom-file-templates" name="custom-file-templates">Custom file templates</a></h4>
<h4><a class="toc-backref" href="#id159" id="custom-file-templates" name="custom-file-templates">Custom file templates</a></h4>
<p>These are read from the <tt class="docutils literal"><span class="pre">~/.config/geany/templates/files</span></tt> directory
(created the first time Geany is started). The filetype to use is
detected from the template file's extension, if any. For example, creating
@ -3761,7 +3938,7 @@ clicked, so you don't need to restart Geany after editing a custom file
template.</p>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id158" id="filetype-templates" name="filetype-templates">Filetype templates</a></h4>
<h4><a class="toc-backref" href="#id160" id="filetype-templates" name="filetype-templates">Filetype templates</a></h4>
<p>Filetype template files are read from the <tt class="docutils literal"><span class="pre">~/.config/geany/templates</span></tt>
directory, and are named &quot;filetype.&quot; followed by the filetype
name, e.g. &quot;filetype.python&quot;, &quot;filetype.sh&quot;, etc. If you are
@ -3773,7 +3950,7 @@ the New command is used without a filetype. This is empty by default.</p>
</div>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id159" id="customizing-templates" name="customizing-templates">Customizing templates</a></h3>
<h3><a class="toc-backref" href="#id161" id="customizing-templates" name="customizing-templates">Customizing templates</a></h3>
<p>Each template can be customized to your needs. The templates are
stored in the <tt class="docutils literal"><span class="pre">~/.config/geany/templates/</span></tt> directory (see the section called
<a class="reference" href="#command-line-options">Command line options</a> for further information about the configuration
@ -3781,7 +3958,7 @@ directory). Just open the desired template with an editor (ideally,
Geany ;-) ) and edit the template to your needs. There are some
wildcards which will be automatically replaced by Geany at startup.</p>
<div class="section">
<h4><a class="toc-backref" href="#id160" id="template-wildcards" name="template-wildcards">Template wildcards</a></h4>
<h4><a class="toc-backref" href="#id162" id="template-wildcards" name="template-wildcards">Template wildcards</a></h4>
<p>All wildcards must be enclosed by &quot;{&quot; and &quot;}&quot;, e.g. {date}.</p>
<table border="1" class="docutils">
<colgroup>
@ -3902,7 +4079,7 @@ For details please see <a class="reference" href="http://man.cx/strftime">http:/
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id161" id="customizing-the-toolbar" name="customizing-the-toolbar">Customizing the toolbar</a></h2>
<h2><a class="toc-backref" href="#id163" id="customizing-the-toolbar" name="customizing-the-toolbar">Customizing the toolbar</a></h2>
<p>You can add, remove and reorder the elements in the toolbar by editing
the file <tt class="docutils literal"><span class="pre">ui_toolbar.xml</span></tt>.</p>
<p>To override the system-wide configuration file, copy it from
@ -3928,7 +4105,7 @@ for changes to take effect.</li>
</ol>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id162" id="available-toolbar-elements" name="available-toolbar-elements">Available toolbar elements</a></h3>
<h3><a class="toc-backref" href="#id164" id="available-toolbar-elements" name="available-toolbar-elements">Available toolbar elements</a></h3>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
@ -4042,9 +4219,9 @@ use 'SearchEntry')</td>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id163" id="plugin-documentation" name="plugin-documentation">Plugin documentation</a></h1>
<h1><a class="toc-backref" href="#id165" id="plugin-documentation" name="plugin-documentation">Plugin documentation</a></h1>
<div class="section">
<h2><a class="toc-backref" href="#id164" id="instant-save" name="instant-save">Instant Save</a></h2>
<h2><a class="toc-backref" href="#id166" id="instant-save" name="instant-save">Instant Save</a></h2>
<p>This plugin sets on every new file (File-&gt;New or File-&gt; New (with template))
a randomly chosen filename and set its filetype appropriate to the used template
or when no template was used, to a configurable default filetype.
@ -4054,7 +4231,7 @@ useful when you often create new files just for testing some code or something
similar.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id165" id="backup-copy" name="backup-copy">Backup Copy</a></h2>
<h2><a class="toc-backref" href="#id167" id="backup-copy" name="backup-copy">Backup Copy</a></h2>
<p>This plugin creates a backup copy of the current file in Geany when it is
saved. You can specify the directory where the backup copy is saved and
you can configure the automatically added extension in the configure dialog
@ -4064,7 +4241,7 @@ copied into the configured backup directory when the file is saved in Geany.</p>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id166" id="contributing-to-this-document" name="contributing-to-this-document">Contributing to this document</a></h1>
<h1><a class="toc-backref" href="#id168" id="contributing-to-this-document" name="contributing-to-this-document">Contributing to this document</a></h1>
<p>This document (<tt class="docutils literal"><span class="pre">geany.txt</span></tt>) is written in <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>
(or &quot;reST&quot;). The source file for it is located in Geany's <tt class="docutils literal"><span class="pre">doc</span></tt>
subdirectory. If you intend on making changes, you should grab the
@ -4084,7 +4261,7 @@ to build the docs. The package is named <tt class="docutils literal"><span class
and Fedora systems.</p>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id167" id="scintilla-keyboard-commands" name="scintilla-keyboard-commands">Scintilla keyboard commands</a></h1>
<h1><a class="toc-backref" href="#id169" id="scintilla-keyboard-commands" name="scintilla-keyboard-commands">Scintilla keyboard commands</a></h1>
<p>Copyright © 1998, 2006 Neil Hodgson &lt;neilh(at)scintilla(dot)org&gt;</p>
<p>This appendix is distributed under the terms of the License for
Scintilla and SciTE. A copy of this license can be found in the file
@ -4093,7 +4270,7 @@ program and in the appendix of this document. See <a class="reference" href="#li
Scintilla and SciTE</a>.</p>
<p>20 June 2006</p>
<div class="section">
<h2><a class="toc-backref" href="#id168" id="keyboard-commands" name="keyboard-commands">Keyboard commands</a></h2>
<h2><a class="toc-backref" href="#id170" id="keyboard-commands" name="keyboard-commands">Keyboard commands</a></h2>
<p>Keyboard commands for Scintilla mostly follow common Windows and GTK+
conventions. All move keys (arrows, page up/down, home and end)
allows to extend or reduce the stream selection when holding the
@ -4181,9 +4358,9 @@ menus. Some less common commands with no menu equivalent are:</p>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id169" id="tips-and-tricks" name="tips-and-tricks">Tips and tricks</a></h1>
<h1><a class="toc-backref" href="#id171" id="tips-and-tricks" name="tips-and-tricks">Tips and tricks</a></h1>
<div class="section">
<h2><a class="toc-backref" href="#id170" id="document-notebook" name="document-notebook">Document notebook</a></h2>
<h2><a class="toc-backref" href="#id172" id="document-notebook" name="document-notebook">Document notebook</a></h2>
<ul class="simple">
<li>Double-click on empty space in the notebook tab bar to open a
new document.</li>
@ -4194,7 +4371,7 @@ shortcut). The interface pref must be enabled for this to work.</li>
</ul>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id171" id="editor" name="editor">Editor</a></h2>
<h2><a class="toc-backref" href="#id173" id="editor" name="editor">Editor</a></h2>
<ul class="simple">
<li>Alt-scroll wheel moves up/down a page.</li>
<li>Ctrl-scroll wheel zooms in/out.</li>
@ -4204,13 +4381,13 @@ shortcut). The interface pref must be enabled for this to work.</li>
</ul>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id172" id="interface" name="interface">Interface</a></h2>
<h2><a class="toc-backref" href="#id174" id="interface" name="interface">Interface</a></h2>
<ul class="simple">
<li>Double-click on a symbol-list group to expand or compact it.</li>
</ul>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id173" id="gtk-related" name="gtk-related">GTK-related</a></h2>
<h2><a class="toc-backref" href="#id175" id="gtk-related" name="gtk-related">GTK-related</a></h2>
<ul class="simple">
<li>Scrolling the mouse wheel over a notebook tab bar will switch
notebook pages.</li>
@ -4225,7 +4402,7 @@ position without having to drag it.</li>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id174" id="hidden-preferences" name="hidden-preferences">Hidden preferences</a></h1>
<h1><a class="toc-backref" href="#id176" id="hidden-preferences" name="hidden-preferences">Hidden preferences</a></h1>
<p>There are some uncommon preferences that are not shown in the Preferences
dialog. These can be set by editing <tt class="docutils literal"><span class="pre">~/.config/geany/geany.conf</span></tt>, then
restarting Geany. Search for the key name, then edit the value. Example:</p>
@ -4334,7 +4511,7 @@ disk won't run out of free space.</td>
</table>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id175" id="compile-time-options" name="compile-time-options">Compile-time options</a></h1>
<h1><a class="toc-backref" href="#id177" id="compile-time-options" name="compile-time-options">Compile-time options</a></h1>
<p>There are some options which can only be changed at compile time,
and some options which are used as the default for configurable
options. To change these options, edit the appropriate source file
@ -4346,7 +4523,7 @@ not be changed.</p>
<p class="last">Most users should not need to change these options.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id176" id="src-geany-h" name="src-geany-h">src/geany.h</a></h2>
<h2><a class="toc-backref" href="#id178" id="src-geany-h" name="src-geany-h">src/geany.h</a></h2>
<table border="1" class="docutils">
<colgroup>
<col width="33%" />
@ -4403,7 +4580,7 @@ when building on a non-Win32 system.</em></td>
</table>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id177" id="project-h" name="project-h">project.h</a></h2>
<h2><a class="toc-backref" href="#id179" id="project-h" name="project-h">project.h</a></h2>
<table border="1" class="docutils">
<colgroup>
<col width="33%" />
@ -4428,7 +4605,7 @@ open dialog.</td>
</table>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id178" id="editor-h" name="editor-h">editor.h</a></h2>
<h2><a class="toc-backref" href="#id180" id="editor-h" name="editor-h">editor.h</a></h2>
<table border="1" class="docutils">
<colgroup>
<col width="33%" />
@ -4454,7 +4631,7 @@ underscore.</td>
</table>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id179" id="keyfile-c" name="keyfile-c">keyfile.c</a></h2>
<h2><a class="toc-backref" href="#id181" id="keyfile-c" name="keyfile-c">keyfile.c</a></h2>
<p>These are default settings that can be overridden in the <a class="reference" href="#preferences">Preferences</a> dialog.</p>
<table border="1" class="docutils">
<colgroup>
@ -4535,7 +4712,7 @@ Geany provide.</td>
</table>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id180" id="build-h" name="build-h">build.h</a></h2>
<h2><a class="toc-backref" href="#id182" id="build-h" name="build-h">build.h</a></h2>
<table border="1" class="docutils">
<colgroup>
<col width="33%" />
@ -4566,7 +4743,7 @@ just aftereffects.</td>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id181" id="gnu-general-public-license" name="gnu-general-public-license">GNU General Public License</a></h1>
<h1><a class="toc-backref" href="#id183" id="gnu-general-public-license" name="gnu-general-public-license">GNU General Public License</a></h1>
<pre class="literal-block">
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
@ -4911,7 +5088,7 @@ Public License instead of this License.
</pre>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id182" id="license-for-scintilla-and-scite" name="license-for-scintilla-and-scite">License for Scintilla and SciTE</a></h1>
<h1><a class="toc-backref" href="#id184" id="license-for-scintilla-and-scite" name="license-for-scintilla-and-scite">License for Scintilla and SciTE</a></h1>
<p>Copyright 1998-2003 by Neil Hodgson &lt;neilh(at)scintilla(dot)org&gt;</p>
<p>All Rights Reserved</p>
<p>Permission to use, copy, modify, and distribute this software and
@ -4931,7 +5108,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
Generated on: 2009-06-03 15:37 UTC.
Generated on: 2009-07-09 03:37 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>

View File

@ -2219,27 +2219,48 @@ When project session support is enabled, Geany will close the project
session files and open any previously closed default session files.
Build system
------------
Build Menu
----------
After editing code with Geany, the next step is to compile, link, build,
interpret, run etc. As Geany supports many languages each with a different
approach to such operations, and as there are also many language independant
software building systems, Geany does not have a built in build system, nor
does it limit which system you can use. Instead the build menu provides
a configurable and flexible means of running any external commands required.
Geany has an integrated build system. Firstly this means that the
current source file will be saved before it is processed. This is
for convenience so that you don't need to keep saving small changes
to the current file before building.
Running the commands from within Geany has two benefits:
Secondly the output for Compile, Build and Make actions will be captured
in the Compiler notebook tab of the messages window. If there are
any warnings or errors with line numbers shown in red in the Compiler
output tab, you can click on them and Geany will switch to the relevant
source file (or open it) and mark the line number so the problem can be
corrected. Geany will also set indicators for warnings or errors with
line numbers.
* the current file is automatically saved before the command is run
* the output is captured in the Compiler notebook tab and parsed for
warnings or errors
Warnings and errors that can be parsed for line numbers will be shown in
red in the Compiler tab and you can click on them to switch to the relevant
source file (or open it) and mark the line number. Also lines with
warnings or errors are marked in the source, see Indicators below.
This section provides a description of the default configuration of the
build menu and then of how to configure it and where the defaults fit in.
.. tip::
If Geany's default error message parsing does not parse errors for
the tool you're using, you can set a custom regex. See `Filetype
definition files`_ and the `[build_settings] Section`_.
the tool you're using, you can set a custom regex in the Build Commands
Dialog, see ...
Indicators
^^^^^^^^^^
Indicators are red squiggly underlines which are used to highlight
errors which occurred while compiling the current file. So you can
easily see where your code failed to compile. To remove the indicators,
just click on "Remove all indicators" in the document file menu.
If you do not like this feature, you can disable it in the preferences
dialog.
Default Build Menu Items
^^^^^^^^^^^^^^^^^^^^^^^^
Depending on the current file's filetype, the Build menu will contain
the following items:
@ -2249,11 +2270,11 @@ the following items:
* Make Custom Target
* Make Object
* Execute
* Set Includes and Arguments
* Set Build Menu Commands
Compile
^^^^^^^
```````
The Compile command has different uses for different kinds of files.
@ -2267,7 +2288,7 @@ will run the file in its language interpreter.
Build
^^^^^
`````
For compilable languages such as C and C++, the Build command will link
the current source file's equivalent object file into an executable. If
@ -2277,27 +2298,22 @@ in one step, producing just the executable binary.
Interpreted languages do not use the Build command.
Make all
^^^^^^^^
Make
````
This effectively runs "make all" in the same directory as the
This effectively runs "make" in the same directory as the
current file.
.. note::
For each of the Make commands, The Make tool path must be correctly
set in the Tools tab of the Preferences dialog.
Make custom target
^^^^^^^^^^^^^^^^^^
``````````````````
This is similar to running 'Make all' but you will be prompted for
This is similar to running 'Make' but you will be prompted for
the make target name to be passed to the Make tool. For example,
typing 'clean' in the dialog prompt will run "make clean".
Make object
^^^^^^^^^^^
```````````
Make object will run "make current_file.o" in the same directory as
the current file, using its prefix for 'current_file'. It is useful
@ -2305,7 +2321,7 @@ for compiling just the current file without building the whole project.
Execute
^^^^^^^
```````
Execute will run the corresponding executable file, shell script or
interpreted script in a terminal window. Note that the Terminal tool
@ -2317,22 +2333,25 @@ After your program or script has finished executing, you will be
prompted to press the return key. This allows you to review any text
output from the program before the terminal window is closed.
The execute command output is not parsed for errors.
Stopping running processes
^^^^^^^^^^^^^^^^^^^^^^^^^^
``````````````````````````
When there is a running program, the Run button in the toolbar
When there is a running program, the Execute menu item in the menu and
the Run button in the toolbar
becomes a stop button and you can stop the current action. This
works by sending a signal to the process (and its child process(es))
to stop the process. The used signal is SIGQUIT.
Depending on the process you started it might occur that the process
cannot be stopped. This can happen when the process creates more than
one child process.
Depending on the process you started it might be that the process
cannot be stopped. For example this can happen when the process creates
more than one child process.
Terminal emulators
``````````````````
******************
Xterm is known to work properly. If you are using "Terminal"
(the terminal program of Xfce), you should add the command line
@ -2341,12 +2360,12 @@ stopped. Just add this option in the preferences dialog on the Tools
tab in the terminal field.
Set Includes and Arguments
^^^^^^^^^^^^^^^^^^^^^^^^^^
Set Build Commands
``````````````````
By default the Compile and Build commands invoke the compiler and
By default the Compile and Build commands invoke the GCC compiler and
linker with only the basic arguments needed by all programs. Using
Set Includes and Arguments you can add any include paths and compile
Set Build Commands you can add any include paths and compile
flags for the compiler, any library names and paths for the linker,
and any arguments you want to use when running Execute.
@ -2365,26 +2384,133 @@ The following variables can be used:
See `[build_settings] Section`_ for details.
Build Menu Configuration
^^^^^^^^^^^^^^^^^^^^^^^^
The build menu has considerable flexibility and configurability, allowing
both menu labels and the commands they execute to be configured. If you change
one of the default make commands to run say 'waf' you can also change the
label to match. Underlines in the labels set mnemonic characters.
One step compilation
````````````````````
The build menu is divided into four groups of items each with different
behaviors:
If you are using the Build command to compile and link in one step,
you will need to set both the compiler arguments and the linker
arguments in the linker command setting.
* file items - are configurable and depend on the filetype of the current
document, put the output in the compiler tab and parse it for errors
* non-file items - are configurable and mostly don't depend on the filetype
of the current document, put the output in the compiler tab and parse
it for errors
* execute items - are configurable and intended for executing your
program or other long running programs. The output is not parsed for errors.
* fixed items - are not configurable because they perform Geany built in actions
go to next error, go to the previous error and show the build menu
commands dialog
The maximum numbers of items in each of the configurable groups can be
configured when Geany starts (see...). Even though the maximum number of
items may have been increased, only those menu items that are actually configured
are shown in the menu.
Indicators
^^^^^^^^^^
The groups of menu items obtain their configuration from four potential
sources. The highest pririty source that has the menu item defined will
be used. The sources in decreasing priority are:
Indicators are red squiggly underlines which are used to highlight
errors which occurred while compiling the current file. So you can
easily see where your code failed to compile. To remove the indicators,
just click on "Remove all indicators" in the document file menu.
* a project file if open
* the user preferences
* the system filetype definitions
* the defaults
If you do not like this feature, you can disable it in the preferences
dialog.
The detailed relationships between sources and the configurable menu item groups
is shown in the following table.
+--------------+---------------------+--------------------------+-------------------+-------------------------------+
| Group | Project File | Preferences | System Filetype | Defaults |
+==============+=====================+==========================+===================+===============================+
| Filetype | Loads From: project | Loads From: | Loads From: | None |
| | file | filetype.xxx file in | filetype.xxx in | |
| | | ~/.config/geany/filedefs | Geany install | |
| | Saves To: project | | | |
| | file | Saves to: as above, | Saves to: as user | |
| | | creating if needed. | preferences left. | |
+--------------+---------------------+--------------------------+-------------------+-------------------------------+
| Non-Filetype | Loads From: project | Loads From: | Loads From: | 1: |
| | file | geany.conf file in | filetype.xxx in | Label: _Make |
| | | ~/.config/geany | Geany install | Command: make |
| | Saves To: project | | | |
| | file | Saves to: as above, | Saves to: as user | 2: |
| | | creating if needed. | preferences left. | Label: Make Custom _Target |
| | | | | Command: make |
| | | | | |
| | | | | 3: |
| | | | | Label: Make _Object |
| | | | | Command: make %e.o |
+--------------+---------------------+--------------------------+-------------------+-------------------------------+
| Execute | Loads From: project | Loads From: | Loads From: | Label: _Execute Command: ./%e |
| | file or else | geany.conf file in | filetype.xxx in | |
| | filetype defined in | ~/.config/geany or else | Geany install | |
| | project file | filetype.xxx file in | | |
| | | ~/.config/geany/filedefs | Saves To: as user | |
| | Saves To: | | preferences left | |
| | project file | Saves To: | | |
| | | geany.conf file in | | |
| | | ~/.config/geany | | |
+--------------+---------------------+--------------------------+-------------------+-------------------------------+
The following notes on the table reference cells by coordinate as (group,source):
* General - for filetype.xxx substitute the appropriate extension for xxx.
* System Filetypes - Labels loaded from these sources are locale sensitive
and can contain translations.
* (Filetype, Project File) and (Filetype, Preferences) - preferences use a full
filetype file so that users can configure all other filetype preferences
as well. Projects can only configure menu items per filetype. Saving
in the project file means that there is only one file per project not
a whole directory.
* (Non-Filetype, System Filetype) - although conceptually strange, defining
non-filetype commands in a filetype file, this provides the ability to
define filetype dependent default menu items.
* (Execute, Project File) and (Execute, Preferences) - the execute configuration
can only be set by hand editing the appropriate file.
Build Menu Commands Dialog
^^^^^^^^^^^^^^^^^^^^^^^^^^
Most of the configuration of the build menu is done through the Build Menu
Commands Dialog. You edit the configuration sourced from preferences in the
dialog opened from the Build->Build Menu Commands item and you edit the
configuration from the project in the build tab of the project preferences
dialog. Both use the same form shown below.
Image here
The dialog is divided into three sections for Filetype menu items which
will be selected based on the filetype of the currently open document,
Non-filetype menu items and execute menu items and a section for the regular
expression used for parsing command output for error and warning messages.
The columns in the first three sections allow setting of the label and command
and for Non-filetype and Execute commands the selection of which directory
to run the command in. If a project is open and base is checked, the command
is run in the base directory defined for the project otherwise it is run
in the directory of the current document, or not run at all if no current document.
The dialog will always show the command selected by priority, not just the
commands configured in this configuration source. This ensures that you always
see what the menu is going to do if activated.
If the current source of the menu item is higher priority than the
configuration source you are editing then the command will be shown
in the dialog but will be insensitive (greyed out). This can't happen
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.
@ -3052,8 +3178,8 @@ error_regex
**Build commands**
The build commands are all configurable using the `Set Includes and
Arguments`_ dialog.
The build commands are all configurable using the `Build Menu
Commands Dialog`_ dialog.
compiler
This item specifies the command to compile source code files. But

File diff suppressed because it is too large Load Diff

View File

@ -27,18 +27,61 @@
#define GEANY_BUILD_ERR_HIGHLIGHT_MAX 100
typedef enum /* Geany Build Options */
/* Geany Known Build Commands, currently only these can have keybindings
* Order is important (see GBO_TO_GBG, GBO_TO_CMD below) */
typedef enum
{
GBO_COMPILE,
GBO_BUILD,
GBO_MAKE_ALL,
GBO_MAKE_CUSTOM,
GBO_MAKE_OBJECT
GBO_MAKE_OBJECT,
GBO_EXEC,
GBO_COUNT /* count of how many */
} GeanyBuildType;
typedef enum /* build command groups, order as above */
{
GBG_FT, /* filetype */
GBG_NON_FT, /* non filetype */
GBG_EXEC, /* execute */
GBG_COUNT /* count of how many */
} GeanyBuildGroup;
#define GBG_FIXED GBG_COUNT
/* convert GBO_xxx to GBG_xxx and command number
* Note they are macros so they can be used in static initialisers */
#define GBO_TO_GBG(gbo) ((gbo)>GBO_EXEC?GBG_COUNT:((gbo)>=GBO_EXEC?GBG_EXEC:((gbo)>=GBO_MAKE_ALL?GBG_NON_FT:GBG_FT)))
#define GBO_TO_CMD(gbo) ((gbo)>=GBO_COUNT?(gbo)-GBO_COUNT:((gbo)>=GBO_EXEC?(gbo)-GBO_EXEC:((gbo)>=GBO_MAKE_ALL?(gbo)-GBO_MAKE_ALL:(gbo))))
enum GeanyBuildFixedMenuItems
{
GBF_NEXT_ERROR,
GBF_PREV_ERROR,
GBF_COMMANDS,
GBF_SEP_1,
GBF_SEP_2,
GBF_SEP_3,
GBF_SEP_4,
GBF_COUNT
};
typedef enum /* build command sources, in increasing priority */
{
BCS_DEF, /* default */
BCS_FT, /* filetype */
BCS_HOME_FT,/* filetypes in home */
BCS_PREF, /* preferences */
BCS_PROJ_FT,/* filetype in project */
BCS_PROJ, /* project */
BCS_COUNT /* count of how many */
} GeanyBuildSource;
typedef struct GeanyBuildInfo
{
GeanyBuildType type; /* current action(one of the above enumeration) */
GeanyBuildGroup grp;
gint cmd;
GPid pid; /* process id of the spawned process */
gchar *dir;
guint file_type_id;
@ -48,37 +91,54 @@ typedef struct GeanyBuildInfo
extern GeanyBuildInfo build_info;
typedef struct GeanyBuildCommand
{
gchar *label;
gchar *command;
gboolean exists;
gboolean run_in_base_dir;
gboolean changed;
} GeanyBuildCommand;
extern GeanyBuildCommand *non_ft_proj, *exec_proj; /* project command array pointers */
typedef struct BuildMenuItems
{
GtkWidget *menu;
GtkWidget *item_compile;
GtkWidget *item_link;
GtkWidget *item_make_all;
GtkWidget *item_make_custom;
GtkWidget *item_make_object;
GtkWidget *item_next_error;
GtkWidget *item_previous_error;
GtkWidget *item_exec;
GtkWidget *item_exec2;
GtkWidget *item_set_args;
GtkWidget **menu_item[GBG_COUNT+1]; /* +1 for fixed items */
} BuildMenuItems;
/* opaque pointers returned from build functions and passed back to them */
typedef struct TableFields *TableData;
void build_init(void);
void build_finalize(void);
/* menu configuration dialog functions */
GtkWidget *build_commands_table( GeanyDocument *doc, GeanyBuildSource dst, TableData *data, GeanyFiletype *ft );
gboolean read_build_commands( GeanyBuildCommand ***dstcmd, GeanyBuildSource dst, TableData data, gint response );
void free_build_data( TableData data );
/* build response decode assistance function */
gboolean build_parse_make_dir(const gchar *string, gchar **prefix);
/* build menu functions */
void build_menu_update(GeanyDocument *doc);
BuildMenuItems *build_get_menu_items(gint filetype_idx);
void build_toolbutton_build_clicked(GtkAction *action, gpointer user_data);
void remove_command( GeanyBuildSource src, GeanyBuildGroup grp, gint cmd );
/* load and store menu configuration */
void load_build_menu( GKeyFile *config, GeanyBuildSource dst, gpointer ptr );
void save_build_menu( GKeyFile *config, gpointer ptr, GeanyBuildSource src );
void set_build_grp_count( GeanyBuildGroup grp, guint count );
#endif

View File

@ -586,8 +586,9 @@ static GeanyFiletype *filetype_new(void)
GeanyFiletype *ft = g_new0(GeanyFiletype, 1);
ft->lang = -2; /* assume no tagmanager parser */
ft->programs = g_new0(struct build_programs, 1);
ft->actions = g_new0(struct build_actions, 1);
/* ft->programs = g_new0(struct build_programs, 1);
ft->actions = g_new0(struct build_actions, 1);*/
ft->project_list_entry = -1; /* no entry */
ft->priv = g_new0(GeanyFiletypePrivate, 1);
return ft;
@ -1041,12 +1042,9 @@ static void filetype_free(gpointer data, G_GNUC_UNUSED gpointer user_data)
g_free(ft->comment_open);
g_free(ft->comment_close);
g_free(ft->context_action_cmd);
g_free(ft->programs->compiler);
g_free(ft->programs->linker);
g_free(ft->programs->run_cmd);
g_free(ft->programs->run_cmd2);
g_free(ft->programs);
g_free(ft->actions);
g_free(ft->filecmds);
g_free(ft->ftdefcmds);
g_free(ft->execcmds);
set_error_regex(ft, NULL);
g_strfreev(ft->pattern);
@ -1118,7 +1116,9 @@ static void load_settings(gint ft_id, GKeyFile *config, GKeyFile *configh)
}
/* read build settings */
result = g_key_file_get_string(configh, "build_settings", "compiler", NULL);
load_build_menu( config, BCS_FT, (gpointer)ft );
load_build_menu( configh, BCS_HOME_FT, (gpointer)ft );
/* result = g_key_file_get_string(configh, "build_settings", "compiler", NULL);
if (result == NULL) result = g_key_file_get_string(config, "build_settings", "compiler", NULL);
if (G_LIKELY(result != NULL))
{
@ -1155,7 +1155,7 @@ static void load_settings(gint ft_id, GKeyFile *config, GKeyFile *configh)
if (result != NULL)
{
set_error_regex(ft, result);
}
} */
}
@ -1247,29 +1247,15 @@ void filetypes_save_commands(void)
for (i = 1; i < GEANY_MAX_BUILT_IN_FILETYPES; i++)
{
struct build_programs *bp = filetypes[i]->programs;
GKeyFile *config_home;
gchar *fname, *ext, *data;
if (! bp->modified)
continue;
ext = filetypes_get_conf_extension(i);
fname = g_strconcat(conf_prefix, ext, NULL);
g_free(ext);
config_home = g_key_file_new();
g_key_file_load_from_file(config_home, fname, G_KEY_FILE_KEEP_COMMENTS, NULL);
if (NZV(bp->compiler))
g_key_file_set_string(config_home, "build_settings", "compiler", bp->compiler);
if (NZV(bp->linker))
g_key_file_set_string(config_home, "build_settings", "linker", bp->linker);
if (NZV(bp->run_cmd))
g_key_file_set_string(config_home, "build_settings", "run_cmd", bp->run_cmd);
if (NZV(bp->run_cmd2))
g_key_file_set_string(config_home, "build_settings", "run_cmd2", bp->run_cmd2);
data = g_key_file_to_data(config_home, NULL, NULL);
utils_write_file(fname, data);
g_free(data);

View File

@ -27,6 +27,7 @@
#include "Scintilla.h"
#include "ScintillaWidget.h"
#include "build.h"
typedef enum
@ -98,7 +99,7 @@ GeanyFiletypeGroupID;
#define FILETYPE_ID(filetype_ptr) \
(((filetype_ptr) != NULL) ? (filetype_ptr)->id : GEANY_FILETYPES_NONE)
/*
struct build_actions
{
gboolean can_compile;
@ -130,8 +131,16 @@ struct GeanyFiletype
gchar *comment_open;
gchar *comment_close;
gboolean comment_use_indent;
struct build_programs *programs;
/* struct build_programs *programs;
struct build_actions *actions; /* TODO: make private */
GeanyBuildCommand *filecmds; /* these need to be visible since used in build.c so not in private part */
GeanyBuildCommand *ftdefcmds; /* filetype dependent defaults for non_ft commands */
GeanyBuildCommand *execcmds;
GeanyBuildCommand *homefilecmds;
GeanyBuildCommand *homeexeccmds;
GeanyBuildCommand *projfilecmds;
GeanyBuildCommand *projexeccmds;
gint project_list_entry;
GeanyFiletypeGroupID group;
gchar *error_regex_string;

View File

@ -478,8 +478,6 @@ static void init_default_kb(void)
0, 0, "build_previouserror", _("Previous error"), NULL);
keybindings_set_item(group, GEANY_KEYS_BUILD_RUN, cb_func_build_action,
GDK_F5, 0, "build_run", _("Run"), NULL);
keybindings_set_item(group, GEANY_KEYS_BUILD_RUN2, cb_func_build_action,
0, 0, "build_run2", _("Run (alternative command)"), NULL);
keybindings_set_item(group, GEANY_KEYS_BUILD_OPTIONS, cb_func_build_action,
0, 0, "build_options", _("Build options"), NULL);
@ -1340,38 +1338,35 @@ static void cb_func_build_action(guint key_id)
if (! ft)
return;
menu_items = build_get_menu_items(ft->id);
/* TODO make it a table??*/
switch (key_id)
{
case GEANY_KEYS_BUILD_COMPILE:
item = menu_items->item_compile;
item = menu_items->menu_item[GBG_FT][GBO_TO_CMD(GBO_COMPILE)];
break;
case GEANY_KEYS_BUILD_LINK:
item = menu_items->item_link;
item = menu_items->menu_item[GBG_FT][GBO_TO_CMD(GBO_BUILD)];
break;
case GEANY_KEYS_BUILD_MAKE:
item = menu_items->item_make_all;
item = menu_items->menu_item[GBG_FT][GBO_TO_CMD(GBO_MAKE_ALL)];
break;
case GEANY_KEYS_BUILD_MAKEOWNTARGET:
item = menu_items->item_make_custom;
item = menu_items->menu_item[GBG_FT][GBO_TO_CMD(GBO_MAKE_CUSTOM)];
break;
case GEANY_KEYS_BUILD_MAKEOBJECT:
item = menu_items->item_make_object;
item = menu_items->menu_item[GBG_FT][GBO_TO_CMD(GBO_MAKE_OBJECT)];
break;
case GEANY_KEYS_BUILD_NEXTERROR:
item = menu_items->item_next_error;
item = menu_items->menu_item[GBG_FIXED][GBF_NEXT_ERROR];
break;
case GEANY_KEYS_BUILD_PREVIOUSERROR:
item = menu_items->item_previous_error;
item = menu_items->menu_item[GBG_FIXED][GBF_PREV_ERROR];
break;
case GEANY_KEYS_BUILD_RUN:
item = menu_items->item_exec;
break;
case GEANY_KEYS_BUILD_RUN2:
item = menu_items->item_exec2;
item = menu_items->menu_item[GBG_EXEC][GBO_TO_CMD(GBO_EXEC)];
break;
case GEANY_KEYS_BUILD_OPTIONS:
item = menu_items->item_set_args;
item = menu_items->menu_item[GBG_FIXED][GBF_COMMANDS];
break;
default:
item = NULL;

View File

@ -289,7 +289,6 @@ enum
GEANY_KEYS_BUILD_NEXTERROR,
GEANY_KEYS_BUILD_PREVIOUSERROR,
GEANY_KEYS_BUILD_RUN,
GEANY_KEYS_BUILD_RUN2,
GEANY_KEYS_BUILD_OPTIONS,
GEANY_KEYS_BUILD_COUNT
};

View File

@ -403,6 +403,9 @@ static void save_dialog_prefs(GKeyFile *config)
g_key_file_set_string(config, "tools", "grep_cmd", tool_prefs.grep_cmd ? tool_prefs.grep_cmd : "");
g_key_file_set_string(config, PACKAGE, "context_action_cmd", tool_prefs.context_action_cmd);
/* build menu */
save_build_menu( config, NULL, BCS_PREF );
/* printing */
g_key_file_set_string(config, "printing", "print_cmd", printing_prefs.external_print_cmd ? printing_prefs.external_print_cmd : "");
g_key_file_set_boolean(config, "printing", "use_gtk_printing", printing_prefs.use_gtk_printing);
@ -775,6 +778,12 @@ static void load_dialog_prefs(GKeyFile *config)
tool_prefs.context_action_cmd = utils_get_setting_string(config, PACKAGE, "context_action_cmd", "");
/* build menu */
set_build_grp_count( GBG_FT, utils_get_setting_integer( config, "build-menu", "number_ft_menu_items", 0 ));
set_build_grp_count( GBG_NON_FT, utils_get_setting_integer( config, "build-menu", "number_non_ft_menu_items", 0 ));
set_build_grp_count( GBG_EXEC, utils_get_setting_integer( config, "build-menu", "number_exec_menu_items", 0 ));
load_build_menu( config, BCS_PREF, NULL );
/* printing */
tmp_string2 = g_find_program_in_path(GEANY_DEFAULT_TOOLS_PRINTCMD);
#ifdef G_OS_WIN32

View File

@ -267,9 +267,9 @@ void msgwin_compiler_add_string(gint msg_color, const gchar *msg)
gtk_tree_path_free(path);
}
/* calling build_menu_update for every build message would be overkill */
gtk_widget_set_sensitive(build_get_menu_items(-1)->item_next_error, TRUE);
gtk_widget_set_sensitive(build_get_menu_items(-1)->item_previous_error, TRUE);
/* calling build_menu_update for every build message would be overkill, TODO really should call it once when all done */
gtk_widget_set_sensitive(build_get_menu_items(-1)->menu_item[GBG_FIXED][GBF_NEXT_ERROR], TRUE);
gtk_widget_set_sensitive(build_get_menu_items(-1)->menu_item[GBG_FIXED][GBF_PREV_ERROR], TRUE);
}

View File

@ -49,6 +49,7 @@
#include "editor.h"
#include "stash.h"
#include "treeviews.h"
#include "filetypes.h"
ProjectPrefs project_prefs = { NULL, FALSE, FALSE };
@ -78,6 +79,7 @@ typedef struct _PropertyDialogElements
GtkWidget *make_in_base_path;
GtkWidget *run_cmd;
GtkWidget *patterns;
TableData build_properties;
} PropertyDialogElements;
@ -322,9 +324,22 @@ static void update_ui(void)
}
static void remove_foreach_project_filetype( gpointer data, gpointer user_data )
{
GeanyFiletype *ft = (GeanyFiletype*)data;
if(ft!=NULL)
{
setptr( ft->projfilecmds, NULL);
setptr(ft->projexeccmds, NULL);
ft->project_list_entry = -1;
}
}
/* open_default will make function reload default session files on close */
void project_close(gboolean open_default)
{
gint i;
g_return_if_fail(app->project != NULL);
ui_set_statusbar(TRUE, _("Project \"%s\" closed."), app->project->name);
@ -332,6 +347,14 @@ void project_close(gboolean open_default)
/* use write_config() to save project session files */
write_config(FALSE);
/* remove project filetypes build entries */
g_ptr_array_foreach( app->project->build_filetypes_list, remove_foreach_project_filetype, NULL );
g_ptr_array_free(app->project->build_filetypes_list, FALSE);
/* remove project non filetype build menu items */
remove_command( BCS_PROJ, GBG_NON_FT, -1 );
remove_command( BCS_PROJ, GBG_EXEC, -1 );
g_free(app->project->name);
g_free(app->project->description);
g_free(app->project->file_name);
@ -369,6 +392,9 @@ static void create_properties_dialog(PropertyDialogElements *e)
GtkWidget *bbox;
GtkWidget *label;
GtkWidget *swin;
gpointer data;
GeanyDocument *doc = document_get_current();
GeanyFiletype *ft;
e->dialog = create_project_dialog();
gtk_window_set_transient_for(GTK_WINDOW(e->dialog), GTK_WINDOW(main_widgets.window));
@ -495,6 +521,10 @@ static void create_properties_dialog(PropertyDialogElements *e)
label = gtk_label_new(_("Project"));
gtk_widget_show(table); /* needed to switch current page */
gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), table, label, 0);
if(doc!=NULL) ft=doc->file_type;
table = build_commands_table( doc, BCS_PROJ, &(e->build_properties), ft );
label = gtk_label_new(_("Build"));
gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), table, label, 2);
gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
}
@ -562,6 +592,7 @@ void project_properties(void)
stash_group_update(indent_group, e->dialog);
}
free_build_fields( e->build_properties );
gtk_widget_destroy(e->dialog);
g_free(e);
}
@ -703,6 +734,9 @@ static gboolean update_config(const PropertyDialogElements *e)
GtkTextIter start, end;
/*gchar *tmp;*/
GtkTextBuffer *buffer;
GeanyDocument *doc = document_get_current();
GeanyBuildCommand **rbc_array[GBG_COUNT], *oldvalue;
GeanyFiletype *ft=NULL;
p->make_in_base_path = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(e->make_in_base_path));
@ -713,6 +747,28 @@ static gboolean update_config(const PropertyDialogElements *e)
gtk_text_buffer_get_start_iter(buffer, &start);
gtk_text_buffer_get_end_iter(buffer, &end);
setptr(p->description, g_strdup(gtk_text_buffer_get_text(buffer, &start, &end, FALSE)));
/* read the project build menu */
if( doc!=NULL )ft=doc->file_type;
if( ft!=NULL )
{
rbc_array[GBG_FT] = &(ft->projfilecmds);
oldvalue = ft->projfilecmds;
}
else
{
rbc_array[GBG_FT] = NULL;
oldvalue = NULL;
}
rbc_array[GBG_NON_FT] = &non_ft_proj;
rbc_array[GBG_EXEC] = &exec_proj;
read_build_commands( rbc_array, BCS_PROJ, e->build_properties, GTK_RESPONSE_ACCEPT );
if(ft!=NULL&&ft->projfilecmds!=oldvalue && ft->project_list_entry<0)
{
ft->project_list_entry = p->build_filetypes_list->len;
g_ptr_array_add( p->build_filetypes_list, ft );
}
build_menu_update(doc);
#if 0
/* get and set the project file patterns */
@ -952,6 +1008,7 @@ static gboolean load_config(const gchar *filename)
p->run_cmd = utils_get_setting_string(config, "project", "run_cmd", "");
p->file_patterns = g_key_file_get_string_list(config, "project", "file_patterns", NULL, NULL);
load_build_menu( config, BCS_PROJ, (gpointer)p );
if (project_prefs.project_session)
{
/* save current (non-project) session (it could has been changed since program startup) */
@ -1008,7 +1065,7 @@ static gboolean write_config(gboolean emit_signal)
/* store the session files into the project too */
if (project_prefs.project_session)
configuration_save_session_files(config);
save_build_menu( config, (gpointer)p, BCS_PROJ );
if (emit_signal)
{
g_signal_emit_by_name(geany_object, "project-save", config);
@ -1061,9 +1118,9 @@ gchar *project_get_make_dir(void)
{
GeanyProject *project = app->project;
if (project && ! project->make_in_base_path)
/* if (project && ! project->make_in_base_path)
return NULL;
else
else*/
return project_get_base_path();
}

View File

@ -41,6 +41,7 @@ typedef struct GeanyProject
gint type;
gchar **file_patterns; /**< Array of filename extension patterns. */
gboolean make_in_base_path;
GPtrArray *build_filetypes_list; /**< Project has custom filetype builds for these. */
struct GeanyProjectPrivate *priv; /* must be last, append fields before this item */
}