SF.net SVN: geany: [2163] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Jan 11 16:53:25 UTC 2008


Revision: 2163
          http://geany.svn.sourceforge.net/geany/?rev=2163&view=rev
Author:   ntrel
Date:     2008-01-11 08:53:25 -0800 (Fri, 11 Jan 2008)

Log Message:
-----------
Add 'Make in base path' project file preference, on by default.
Add project_get_base_path(), separated from project_get_make_dir().

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/geany.html
    trunk/doc/geany.txt
    trunk/src/build.c
    trunk/src/project.c
    trunk/src/project.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-01-11 15:02:42 UTC (rev 2162)
+++ trunk/ChangeLog	2008-01-11 16:53:25 UTC (rev 2163)
@@ -1,3 +1,11 @@
+2008-01-11  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/build.c, src/project.c, src/project.h, doc/geany.txt,
+   doc/geany.html:
+   Add 'Make in base path' project file preference, on by default.
+   Add project_get_base_path(), separated from project_get_make_dir().
+
+
 2008-01-11  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * src/dialogs.c: Fix broken Rename functionality (closes #1868621).

Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html	2008-01-11 15:02:42 UTC (rev 2162)
+++ trunk/doc/geany.html	2008-01-11 16:53:25 UTC (rev 2163)
@@ -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="2008-01-06" />
+<meta name="date" content="2008-01-10" />
 <style type="text/css">
 
 /*
@@ -133,7 +133,7 @@
 <br />Nick Treleaven
 <br />Frank Lanitz</td></tr>
 <tr><th class="docinfo-name">Date:</th>
-<td>2008-01-06</td></tr>
+<td>2008-01-10</td></tr>
 <tr><th class="docinfo-name">Version:</th>
 <td>0.13</td></tr>
 </tbody>
@@ -238,74 +238,75 @@
 <li><a class="reference" href="#project-management" id="id64" name="id64">Project Management</a><ul>
 <li><a class="reference" href="#new-project" id="id65" name="id65">New Project</a></li>
 <li><a class="reference" href="#project-properties" id="id66" name="id66">Project Properties</a><ul>
-<li><a class="reference" href="#run-command" id="id67" name="id67">Run command</a></li>
+<li><a class="reference" href="#make-in-base-path" id="id67" name="id67">Make in base path</a></li>
+<li><a class="reference" href="#run-command" id="id68" name="id68">Run command</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#close-project" id="id68" name="id68">Close Project</a></li>
-<li><a class="reference" href="#open-project" id="id69" name="id69">Open Project</a></li>
+<li><a class="reference" href="#close-project" id="id69" name="id69">Close Project</a></li>
+<li><a class="reference" href="#open-project" id="id70" name="id70">Open Project</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#build-system" id="id70" name="id70">Build system</a><ul>
-<li><a class="reference" href="#compile" id="id71" name="id71">Compile</a></li>
-<li><a class="reference" href="#build" id="id72" name="id72">Build</a></li>
-<li><a class="reference" href="#make-all" id="id73" name="id73">Make all</a></li>
-<li><a class="reference" href="#make-custom-target" id="id74" name="id74">Make custom target</a></li>
-<li><a class="reference" href="#make-object" id="id75" name="id75">Make object</a></li>
-<li><a class="reference" href="#execute" id="id76" name="id76">Execute</a></li>
-<li><a class="reference" href="#stopping-running-processes" id="id77" name="id77">Stopping running processes</a><ul>
-<li><a class="reference" href="#terminal-emulators" id="id78" name="id78">Terminal emulators</a></li>
+<li><a class="reference" href="#build-system" id="id71" name="id71">Build system</a><ul>
+<li><a class="reference" href="#compile" id="id72" name="id72">Compile</a></li>
+<li><a class="reference" href="#build" id="id73" name="id73">Build</a></li>
+<li><a class="reference" href="#make-all" id="id74" name="id74">Make all</a></li>
+<li><a class="reference" href="#make-custom-target" id="id75" name="id75">Make custom target</a></li>
+<li><a class="reference" href="#make-object" id="id76" name="id76">Make object</a></li>
+<li><a class="reference" href="#execute" id="id77" name="id77">Execute</a></li>
+<li><a class="reference" href="#stopping-running-processes" id="id78" name="id78">Stopping running processes</a><ul>
+<li><a class="reference" href="#terminal-emulators" id="id79" name="id79">Terminal emulators</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#set-includes-and-arguments" id="id79" name="id79">Set Includes and Arguments</a><ul>
-<li><a class="reference" href="#one-step-compilation" id="id80" name="id80">One step compilation</a></li>
+<li><a class="reference" href="#set-includes-and-arguments" id="id80" name="id80">Set Includes and Arguments</a><ul>
+<li><a class="reference" href="#one-step-compilation" id="id81" name="id81">One step compilation</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#indicators" id="id81" name="id81">Indicators</a></li>
+<li><a class="reference" href="#indicators" id="id82" name="id82">Indicators</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#printing-support" id="id82" name="id82">Printing support</a></li>
-<li><a class="reference" href="#plugins" id="id83" name="id83">Plugins</a></li>
-<li><a class="reference" href="#keybindings" id="id84" name="id84">Keybindings</a><ul>
-<li><a class="reference" href="#switching-documents" id="id85" name="id85">Switching documents</a></li>
-<li><a class="reference" href="#configurable-keybindings" id="id86" name="id86">Configurable keybindings</a></li>
+<li><a class="reference" href="#printing-support" id="id83" name="id83">Printing support</a></li>
+<li><a class="reference" href="#plugins" id="id84" name="id84">Plugins</a></li>
+<li><a class="reference" href="#keybindings" id="id85" name="id85">Keybindings</a><ul>
+<li><a class="reference" href="#switching-documents" id="id86" name="id86">Switching documents</a></li>
+<li><a class="reference" href="#configurable-keybindings" id="id87" name="id87">Configurable keybindings</a></li>
 </ul>
 </li>
 </ul>
 </li>
-<li><a class="reference" href="#configuration-files" id="id87" name="id87">Configuration files</a><ul>
-<li><a class="reference" href="#global-configuration-file" id="id88" name="id88">Global configuration file</a></li>
-<li><a class="reference" href="#filetype-definition-files" id="id89" name="id89">Filetype definition files</a><ul>
-<li><a class="reference" href="#format" id="id90" name="id90">Format</a><ul>
-<li><a class="reference" href="#styling-section" id="id91" name="id91">[styling] Section</a></li>
-<li><a class="reference" href="#keywords-section" id="id92" name="id92">[keywords] Section</a></li>
-<li><a class="reference" href="#settings-section" id="id93" name="id93">[settings] Section</a></li>
-<li><a class="reference" href="#build-settings-section" id="id94" name="id94">[build_settings] Section</a></li>
+<li><a class="reference" href="#configuration-files" id="id88" name="id88">Configuration files</a><ul>
+<li><a class="reference" href="#global-configuration-file" id="id89" name="id89">Global configuration file</a></li>
+<li><a class="reference" href="#filetype-definition-files" id="id90" name="id90">Filetype definition files</a><ul>
+<li><a class="reference" href="#format" id="id91" name="id91">Format</a><ul>
+<li><a class="reference" href="#styling-section" id="id92" name="id92">[styling] Section</a></li>
+<li><a class="reference" href="#keywords-section" id="id93" name="id93">[keywords] Section</a></li>
+<li><a class="reference" href="#settings-section" id="id94" name="id94">[settings] Section</a></li>
+<li><a class="reference" href="#build-settings-section" id="id95" name="id95">[build_settings] Section</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#special-file-filetypes-common" id="id95" name="id95">Special file filetypes.common</a></li>
+<li><a class="reference" href="#special-file-filetypes-common" id="id96" name="id96">Special file filetypes.common</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#filetype-extensions" id="id96" name="id96">Filetype extensions</a></li>
-<li><a class="reference" href="#templates" id="id97" name="id97">Templates</a><ul>
-<li><a class="reference" href="#template-metadata" id="id98" name="id98">Template metadata</a></li>
-<li><a class="reference" href="#filetype-templates" id="id99" name="id99">Filetype templates</a></li>
-<li><a class="reference" href="#customizing-templates" id="id100" name="id100">Customizing templates</a><ul>
-<li><a class="reference" href="#template-wildcards" id="id101" name="id101">Template wildcards</a></li>
+<li><a class="reference" href="#filetype-extensions" id="id97" name="id97">Filetype extensions</a></li>
+<li><a class="reference" href="#templates" id="id98" name="id98">Templates</a><ul>
+<li><a class="reference" href="#template-metadata" id="id99" name="id99">Template metadata</a></li>
+<li><a class="reference" href="#filetype-templates" id="id100" name="id100">Filetype templates</a></li>
+<li><a class="reference" href="#customizing-templates" id="id101" name="id101">Customizing templates</a><ul>
+<li><a class="reference" href="#template-wildcards" id="id102" name="id102">Template wildcards</a></li>
 </ul>
 </li>
 </ul>
 </li>
 </ul>
 </li>
-<li><a class="reference" href="#contributing-to-this-document" id="id102" name="id102">Contributing to this document</a></li>
-<li><a class="reference" href="#scintilla-keyboard-commands" id="id103" name="id103">Scintilla keyboard commands</a><ul>
-<li><a class="reference" href="#keyboard-commands" id="id104" name="id104">Keyboard commands</a></li>
+<li><a class="reference" href="#contributing-to-this-document" id="id103" name="id103">Contributing to this document</a></li>
+<li><a class="reference" href="#scintilla-keyboard-commands" id="id104" name="id104">Scintilla keyboard commands</a><ul>
+<li><a class="reference" href="#keyboard-commands" id="id105" name="id105">Keyboard commands</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#hidden-preferences" id="id105" name="id105">Hidden preferences</a></li>
-<li><a class="reference" href="#compile-time-options" id="id106" name="id106">Compile-time options</a></li>
-<li><a class="reference" href="#gnu-general-public-license" id="id107" name="id107">GNU General Public License</a></li>
-<li><a class="reference" href="#license-for-scintilla-and-scite" id="id108" name="id108">License for Scintilla and SciTE</a></li>
+<li><a class="reference" href="#hidden-preferences" id="id106" name="id106">Hidden preferences</a></li>
+<li><a class="reference" href="#compile-time-options" id="id107" name="id107">Compile-time options</a></li>
+<li><a class="reference" href="#gnu-general-public-license" id="id108" name="id108">GNU General Public License</a></li>
+<li><a class="reference" href="#license-for-scintilla-and-scite" id="id109" name="id109">License for Scintilla and SciTE</a></li>
 </ul>
 </div>
 <div class="section">
@@ -1397,9 +1398,16 @@
 <p>The <em>Base path</em> field is used as the directory to run the Make and Make
 custom commands in. It is also used as working directory for the project
 specific <em>Run command</em>.
-The specified path can be absolute or relative to the project's file name.</p>
+The specified path can be an absolute path or relative to the project's
+file name.</p>
 <div class="section">
-<h4><a class="toc-backref" href="#id67" id="run-command" name="run-command">Run command</a></h4>
+<h4><a class="toc-backref" href="#id67" id="make-in-base-path" name="make-in-base-path">Make in base path</a></h4>
+<p>This setting makes the <em>Build->Make</em> command use the project's base
+path. Uncheck this if you want to use the current file's directory
+instead.</p>
+</div>
+<div class="section">
+<h4><a class="toc-backref" href="#id68" id="run-command" name="run-command">Run command</a></h4>
 <p>The <em>Run command</em> overrides the default run command. You can set this
 to the executable or main script file for the project, and append
 any command-line arguments.</p>
@@ -1412,17 +1420,17 @@
 </div>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id68" id="close-project" name="close-project">Close Project</a></h3>
+<h3><a class="toc-backref" href="#id69" id="close-project" name="close-project">Close Project</a></h3>
 <p>Project file settings are saved when the project is closed.</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id69" id="open-project" name="open-project">Open Project</a></h3>
+<h3><a class="toc-backref" href="#id70" id="open-project" name="open-project">Open Project</a></h3>
 <p>The Open command displays a standard file chooser, starting in
 <tt class="docutils literal"><span class="pre">~/projects</span></tt>.</p>
 </div>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id70" id="build-system" name="build-system">Build system</a></h2>
+<h2><a class="toc-backref" href="#id71" 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
@@ -1446,7 +1454,7 @@
 <li>Set Includes and Arguments</li>
 </ul>
 <div class="section">
-<h3><a class="toc-backref" href="#id71" id="compile" name="compile">Compile</a></h3>
+<h3><a class="toc-backref" href="#id72" id="compile" name="compile">Compile</a></h3>
 <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>
@@ -1456,7 +1464,7 @@
 will run the file in its language interpreter.</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id72" id="build" name="build">Build</a></h3>
+<h3><a class="toc-backref" href="#id73" id="build" name="build">Build</a></h3>
 <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
@@ -1464,7 +1472,7 @@
 <p>Interpreted languages do not use the Build command.</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id73" id="make-all" name="make-all">Make all</a></h3>
+<h3><a class="toc-backref" href="#id74" id="make-all" name="make-all">Make all</a></h3>
 <p>This effectively runs "make all" in the same directory as the
 current file.</p>
 <div class="note">
@@ -1474,19 +1482,19 @@
 </div>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id74" id="make-custom-target" name="make-custom-target">Make custom target</a></h3>
+<h3><a class="toc-backref" href="#id75" 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
 the make target name to be passed to the Make tool. For example,
 typing 'clean' in the dialog prompt will run "make clean".</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id75" id="make-object" name="make-object">Make object</a></h3>
+<h3><a class="toc-backref" href="#id76" id="make-object" name="make-object">Make object</a></h3>
 <p>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
 for compiling just the current file without building the whole project.</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id76" id="execute" name="execute">Execute</a></h3>
+<h3><a class="toc-backref" href="#id77" id="execute" name="execute">Execute</a></h3>
 <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 -
@@ -1497,7 +1505,7 @@
 output from the program before the terminal window is closed.</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id77" id="stopping-running-processes" name="stopping-running-processes">Stopping running processes</a></h3>
+<h3><a class="toc-backref" href="#id78" 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
 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))
@@ -1506,7 +1514,7 @@
 cannot be stopped. This can happen when the process creates more than
 one child process.</p>
 <div class="section">
-<h4><a class="toc-backref" href="#id78" id="terminal-emulators" name="terminal-emulators">Terminal emulators</a></h4>
+<h4><a class="toc-backref" href="#id79" id="terminal-emulators" name="terminal-emulators">Terminal emulators</a></h4>
 <p>Xterm is known to work properly. If you are using "Terminal"
 (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
@@ -1515,7 +1523,7 @@
 </div>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id79" id="set-includes-and-arguments" name="set-includes-and-arguments">Set Includes and Arguments</a></h3>
+<h3><a class="toc-backref" href="#id80" 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
 linker with only the basic arguments needed by all programs. Using
 Set Includes and Arguments you can add any include paths and compile
@@ -1532,14 +1540,14 @@
 different settings, then writing a Makefile and using the Make commands
 is recommended.</p>
 <div class="section">
-<h4><a class="toc-backref" href="#id80" id="one-step-compilation" name="one-step-compilation">One step compilation</a></h4>
+<h4><a class="toc-backref" href="#id81" 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="#id81" id="indicators" name="indicators">Indicators</a></h3>
+<h3><a class="toc-backref" href="#id82" id="indicators" name="indicators">Indicators</a></h3>
 <p>Indicators are red squiggly underlines which are used to highlight
 errors which occured while compiling the current file. So you can
 easily see where your code failed to compile. To remove the indicators,
@@ -1549,7 +1557,7 @@
 </div>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id82" id="printing-support" name="printing-support">Printing support</a></h2>
+<h2><a class="toc-backref" href="#id83" 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
@@ -1597,7 +1605,7 @@
 gtklp or similar programs can be used.</p>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id83" id="plugins" name="plugins">Plugins</a></h2>
+<h2><a class="toc-backref" href="#id84" 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
@@ -1617,13 +1625,13 @@
 provides some.</p>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id84" id="keybindings" name="keybindings">Keybindings</a></h2>
+<h2><a class="toc-backref" href="#id85" 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="#id85" id="switching-documents" name="switching-documents">Switching documents</a></h3>
+<h3><a class="toc-backref" href="#id86" 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">
@@ -1653,7 +1661,7 @@
 </table>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id86" id="configurable-keybindings" name="configurable-keybindings">Configurable keybindings</a></h3>
+<h3><a class="toc-backref" href="#id87" 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
@@ -2043,9 +2051,9 @@
 </div>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id87" id="configuration-files" name="configuration-files">Configuration files</a></h1>
+<h1><a class="toc-backref" href="#id88" id="configuration-files" name="configuration-files">Configuration files</a></h1>
 <div class="section">
-<h2><a class="toc-backref" href="#id88" id="global-configuration-file" name="global-configuration-file">Global configuration file</a></h2>
+<h2><a class="toc-backref" href="#id89" 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
@@ -2065,7 +2073,7 @@
 </div>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id89" id="filetype-definition-files" name="filetype-definition-files">Filetype definition files</a></h2>
+<h2><a class="toc-backref" href="#id90" id="filetype-definition-files" name="filetype-definition-files">Filetype definition files</a></h2>
 <p>All colour definitions and other filetype specific settings are
 stored in the filetype definition files. Those settings are colours
 for syntax highlighting, general settings like comment characters or
@@ -2093,9 +2101,9 @@
 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="#id90" id="format" name="format">Format</a></h3>
+<h3><a class="toc-backref" href="#id91" id="format" name="format">Format</a></h3>
 <div class="section">
-<h4><a class="toc-backref" href="#id91" id="styling-section" name="styling-section">[styling] Section</a></h4>
+<h4><a class="toc-backref" href="#id92" id="styling-section" name="styling-section">[styling] Section</a></h4>
 <p>In this section the colours for syntax highlighting are defined. The
 format is always: key=forground_colour;background_colour;bold;italic</p>
 <p>Colours have to be specified as RGB hex values prefixed by
@@ -2105,7 +2113,7 @@
 value is something other than "true" or "false", "false" is assumed.</p>
 </div>
 <div class="section">
-<h4><a class="toc-backref" href="#id92" id="keywords-section" name="keywords-section">[keywords] Section</a></h4>
+<h4><a class="toc-backref" href="#id93" 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
@@ -2116,7 +2124,7 @@
 </div>
 </div>
 <div class="section">
-<h4><a class="toc-backref" href="#id93" id="settings-section" name="settings-section">[settings] Section</a></h4>
+<h4><a class="toc-backref" href="#id94" 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
@@ -2177,7 +2185,7 @@
 </dl>
 </div>
 <div class="section">
-<h4><a class="toc-backref" href="#id94" id="build-settings-section" name="build-settings-section">[build_settings] Section</a></h4>
+<h4><a class="toc-backref" href="#id95" id="build-settings-section" name="build-settings-section">[build_settings] Section</a></h4>
 <dl class="docutils">
 <dt>compiler</dt>
 <dd><p class="first">This item specifies the command to compile source code files. But
@@ -2210,7 +2218,7 @@
 </div>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id95" id="special-file-filetypes-common" name="special-file-filetypes-common">Special file filetypes.common</a></h3>
+<h3><a class="toc-backref" href="#id96" 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>
@@ -2320,7 +2328,7 @@
 </div>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id96" id="filetype-extensions" name="filetype-extensions">Filetype extensions</a></h2>
+<h2><a class="toc-backref" href="#id97" 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
@@ -2346,7 +2354,7 @@
 </pre>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id97" id="templates" name="templates">Templates</a></h2>
+<h2><a class="toc-backref" href="#id98" id="templates" name="templates">Templates</a></h2>
 <p>Geany supports the following templates:</p>
 <ul class="simple">
 <li>ChangeLog entry</li>
@@ -2369,7 +2377,7 @@
 function description won't contain the correct function name but "unknown"
 instead.</p>
 <div class="section">
-<h3><a class="toc-backref" href="#id98" id="template-metadata" name="template-metadata">Template metadata</a></h3>
+<h3><a class="toc-backref" href="#id99" id="template-metadata" name="template-metadata">Template metadata</a></h3>
 <p>Metadata can be used with all templates, but by default user set
 metadata is only used for the ChangeLog and File header templates.</p>
 <p>In the configuration dialog you can find a tab "Templates" (see
@@ -2379,7 +2387,7 @@
 at startup.</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id99" id="filetype-templates" name="filetype-templates">Filetype templates</a></h3>
+<h3><a class="toc-backref" href="#id100" id="filetype-templates" name="filetype-templates">Filetype templates</a></h3>
 <p>Filetype 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>
@@ -2400,7 +2408,7 @@
 the New command is used without a filetype. This is empty by default.</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id100" id="customizing-templates" name="customizing-templates">Customizing templates</a></h3>
+<h3><a class="toc-backref" href="#id101" 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">~/.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
@@ -2408,7 +2416,7 @@
 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="#id101" id="template-wildcards" name="template-wildcards">Template wildcards</a></h4>
+<h4><a class="toc-backref" href="#id102" id="template-wildcards" name="template-wildcards">Template wildcards</a></h4>
 <p>All wildcards must be enclosed by "{" and "}", e.g. {date}.</p>
 <table border="1" class="docutils">
 <colgroup>
@@ -2517,7 +2525,7 @@
 </div>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id102" id="contributing-to-this-document" name="contributing-to-this-document">Contributing to this document</a></h1>
+<h1><a class="toc-backref" href="#id103" 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 "reST"). 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
@@ -2537,7 +2545,7 @@
 and Fedora systems.</p>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id103" id="scintilla-keyboard-commands" name="scintilla-keyboard-commands">Scintilla keyboard commands</a></h1>
+<h1><a class="toc-backref" href="#id104" id="scintilla-keyboard-commands" name="scintilla-keyboard-commands">Scintilla keyboard commands</a></h1>
 <p>Copyright © 1998, 2006 Neil Hodgson <neilh(at)scintilla(dot)org></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
@@ -2546,7 +2554,7 @@
 Scintilla and SciTE</a>.</p>
 <p>20 June 2006</p>
 <div class="section">
-<h2><a class="toc-backref" href="#id104" id="keyboard-commands" name="keyboard-commands">Keyboard commands</a></h2>
+<h2><a class="toc-backref" href="#id105" 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
@@ -2646,7 +2654,7 @@
 </div>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id105" id="hidden-preferences" name="hidden-preferences">Hidden preferences</a></h1>
+<h1><a class="toc-backref" href="#id106" 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">~/.geany/geany.conf</span></tt>, then
 restarting Geany. Search for the key name, then edit the value. Example:</p>
@@ -2711,7 +2719,7 @@
 </table>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id106" id="compile-time-options" name="compile-time-options">Compile-time options</a></h1>
+<h1><a class="toc-backref" href="#id107" 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. To
 change these options, edit the file src/geany.h. Look for a block of
 lines starting with <tt class="docutils literal"><span class="pre">#define</span> <span class="pre">GEANY_*</span></tt>. Any definitions which are
@@ -2861,7 +2869,7 @@
 </table>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id107" id="gnu-general-public-license" name="gnu-general-public-license">GNU General Public License</a></h1>
+<h1><a class="toc-backref" href="#id108" 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
@@ -3206,7 +3214,7 @@
 </pre>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id108" 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="#id109" 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 <neilh(at)scintilla(dot)org></p>
 <p>All Rights Reserved</p>
 <p>Permission to use, copy, modify, and distribute this software and
@@ -3226,7 +3234,7 @@
 <div class="footer">
 <hr class="footer" />
 <a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2008-01-10 16:57 UTC.
+Generated on: 2008-01-11 16:41 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>

Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt	2008-01-11 15:02:42 UTC (rev 2162)
+++ trunk/doc/geany.txt	2008-01-11 16:53:25 UTC (rev 2163)
@@ -1249,9 +1249,18 @@
 The *Base path* field is used as the directory to run the Make and Make
 custom commands in. It is also used as working directory for the project
 specific *Run command*.
-The specified path can be absolute or relative to the project's file name.
+The specified path can be an absolute path or relative to the project's
+file name.
 
 
+Make in base path
+`````````````````
+
+This setting makes the *Build->Make* command use the project's base
+path. Uncheck this if you want to use the current file's directory
+instead.
+
+
 Run command
 ```````````
 

Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c	2008-01-11 15:02:42 UTC (rev 2162)
+++ trunk/src/build.c	2008-01-11 16:53:25 UTC (rev 2163)
@@ -690,7 +690,7 @@
 
 	if (have_project)
 	{
-		gchar *project_base_path = project_get_make_dir();
+		gchar *project_base_path = project_get_base_path();
 		working_dir = utils_get_locale_from_utf8(project_base_path);
 		g_free(project_base_path);
 	}

Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c	2008-01-11 15:02:42 UTC (rev 2162)
+++ trunk/src/project.c	2008-01-11 16:53:25 UTC (rev 2163)
@@ -64,6 +64,7 @@
 	GtkWidget *description;
 	GtkWidget *file_name;
 	GtkWidget *base_path;
+	GtkWidget *make_in_base_path;
 	GtkWidget *run_cmd;
 	GtkWidget *patterns;
 } PropertyDialogElements;
@@ -332,7 +333,7 @@
 }
 
 
-void project_properties()
+static void create_properties_dialog(PropertyDialogElements *e)
 {
 	GtkWidget *vbox;
 	GtkWidget *table;
@@ -342,12 +343,7 @@
 	GtkWidget *label;
 	GtkWidget *swin;
 	GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips"));
-	PropertyDialogElements *e = g_new(PropertyDialogElements, 1);
-	GeanyProject *p = app->project;
-	gint response;
 
-	g_return_if_fail(app->project != NULL);
-
 	e->dialog = gtk_dialog_new_with_buttons(_("Project Properties"), GTK_WINDOW(app->window),
 										 GTK_DIALOG_DESTROY_WITH_PARENT,
 										 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
@@ -356,8 +352,6 @@
 
 	vbox = ui_dialog_vbox_new(GTK_DIALOG(e->dialog));
 
-	entries_modified = FALSE;
-
 	table = gtk_table_new(6, 2, FALSE);
 	gtk_table_set_row_spacings(GTK_TABLE(table), 5);
 	gtk_table_set_col_spacings(GTK_TABLE(table), 10);
@@ -366,7 +360,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
 
 	e->name = gtk_entry_new();
 	gtk_entry_set_max_length(GTK_ENTRY(e->name), MAX_NAME_LEN);
@@ -378,7 +372,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
 
 	e->file_name = gtk_entry_new();
 	gtk_editable_set_editable(GTK_EDITABLE(e->file_name), FALSE);	// read-only
@@ -390,7 +384,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (GTK_FILL), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
 
 	e->description = gtk_text_view_new();
 	gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(e->description), GTK_WRAP_WORD);
@@ -407,7 +401,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
 
 	e->base_path = gtk_entry_new();
 	gtk_tooltips_set_tip(tooltips, e->base_path,
@@ -420,11 +414,16 @@
 					(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
 
+	e->make_in_base_path = gtk_check_button_new_with_label(_("Make in base path"));
+	gtk_table_attach(GTK_TABLE(table), e->make_in_base_path, 0, 3, 4, 5,
+					(GtkAttachOptions) (GTK_FILL),
+					(GtkAttachOptions) (0), 0, 0);
+
 	label = gtk_label_new(_("Run command:"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5,
+	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
 
 	e->run_cmd = gtk_entry_new();
 	gtk_tooltips_set_tip(tooltips, e->run_cmd,
@@ -439,17 +438,17 @@
 	bbox = gtk_hbox_new(FALSE, 6);
 	gtk_box_pack_start_defaults(GTK_BOX(bbox), e->run_cmd);
 	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
-	gtk_table_attach(GTK_TABLE(table), bbox, 1, 2, 4, 5,
+	gtk_table_attach(GTK_TABLE(table), bbox, 1, 2, 5, 6,
 					(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
 
 #if 0
 	label = gtk_label_new(_("File patterns:"));
 	// <small>Separate multiple patterns by a new line</small>
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6,
+	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 6, 7,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (GTK_FILL), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
 
 	e->patterns = gtk_text_view_new();
 	swin = gtk_scrolled_window_new(NULL, NULL);
@@ -457,13 +456,27 @@
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
 				GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(swin), GTK_WIDGET(e->patterns));
-	gtk_table_attach(GTK_TABLE(table), swin, 1, 2, 5, 6,
+	gtk_table_attach(GTK_TABLE(table), swin, 1, 2, 6, 7,
 					(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
 #endif
 
 	gtk_container_add(GTK_CONTAINER(vbox), table);
+}
 
+
+void project_properties()
+{
+	PropertyDialogElements *e = g_new(PropertyDialogElements, 1);
+	GeanyProject *p = app->project;
+	gint response;
+
+	g_return_if_fail(app->project != NULL);
+
+	entries_modified = FALSE;
+
+	create_properties_dialog(e);
+
 	// fill the elements with the appropriate data
 	gtk_entry_set_text(GTK_ENTRY(e->name), p->name);
 
@@ -496,6 +509,8 @@
 
 	gtk_entry_set_text(GTK_ENTRY(e->file_name), p->file_name);
 	gtk_entry_set_text(GTK_ENTRY(e->base_path), p->base_path);
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e->make_in_base_path),
+		p->make_in_base_path);
 	if (p->run_cmd != NULL)
 		gtk_entry_set_text(GTK_ENTRY(e->run_cmd), p->run_cmd);
 
@@ -584,8 +599,6 @@
 	}
 
 	base_path = gtk_entry_get_text(GTK_ENTRY(e->base_path));
-	/* For now, the base path can be empty, so that Make uses the current directory.
-	 * In future, it would be best to add a Make path setting for projects. */
 	if (NZV(base_path))
 	{	// check whether the given directory actually exists
 		gchar *locale_path = utils_get_locale_from_utf8(base_path);
@@ -631,7 +644,7 @@
 	p->file_name = g_strdup(file_name);
 
 	if (p->base_path != NULL) g_free(p->base_path);
-	p->base_path = g_strdup(base_path);
+	p->base_path = g_strdup(NZV(base_path) ? base_path : "./"); // use "." if base_path is empty
 
 	if (! new_project)	// save properties specific fields
 	{
@@ -639,6 +652,8 @@
 		//gchar *tmp;
 		GtkTextBuffer *buffer;
 
+		p->make_in_base_path = gtk_toggle_button_get_active(
+			GTK_TOGGLE_BUTTON(e->make_in_base_path));
 		if (p->run_cmd != NULL) g_free(p->run_cmd);
 		p->run_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(e->run_cmd)));
 
@@ -862,6 +877,7 @@
 	p->description = utils_get_setting_string(config, "project", "description", "");
 	p->file_name = utils_get_utf8_from_locale(filename);
 	p->base_path = utils_get_setting_string(config, "project", "base_path", "");
+	p->make_in_base_path = utils_get_setting_boolean(config, "project", "make_in_base_path", TRUE);
 	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);
 
@@ -905,6 +921,7 @@
 
 	if (p->description)
 		g_key_file_set_string(config, "project", "description", p->description);
+	g_key_file_set_boolean(config, "project", "make_in_base_path", p->make_in_base_path);
 	if (p->run_cmd)
 		g_key_file_set_string(config, "project", "run_cmd", p->run_cmd);
 	if (p->file_patterns)
@@ -936,24 +953,38 @@
  * base path if it is absolute or it is built out of project file name's dir and base_path.
  * If there is no project or project's base_path is invalid, NULL will be returned.
  * The returned string should be freed when no longer needed. */
-gchar *project_get_make_dir()
+gchar *project_get_base_path()
 {
-	if (app->project != NULL && NZV(app->project->base_path))
+	GeanyProject *project = app->project;
+
+	if (project && NZV(project->base_path))
 	{
-		if (g_path_is_absolute(app->project->base_path))
-			return g_strdup(app->project->base_path);
+		if (g_path_is_absolute(project->base_path))
+			return g_strdup(project->base_path);
 		else
 		{	// build base_path out of project file name's dir and base_path
 			gchar *path;
-			gchar *dir = g_path_get_dirname(app->project->file_name);
+			gchar *dir = g_path_get_dirname(project->file_name);
 
-			path = g_strconcat(dir, G_DIR_SEPARATOR_S, app->project->base_path, NULL);
+			path = g_strconcat(dir, G_DIR_SEPARATOR_S, project->base_path, NULL);
 			g_free(dir);
 			return path;
 		}
 	}
+	return NULL;
+}
+
+
+/* Returns: NULL if the default path should be used, or a UTF-8 path.
+ * Maybe in future this will support a separate project make path from base path. */
+gchar *project_get_make_dir()
+{
+	GeanyProject *project = app->project;
+
+	if (project && ! project->make_in_base_path)
+		return NULL;
 	else
-		return NULL;
+		return project_get_base_path();
 }
 
 

Modified: trunk/src/project.h
===================================================================
--- trunk/src/project.h	2008-01-11 15:02:42 UTC (rev 2162)
+++ trunk/src/project.h	2008-01-11 16:53:25 UTC (rev 2163)
@@ -41,6 +41,8 @@
 							// by a plugin
 
 	gchar **file_patterns;	// array of filename extension patterns
+
+	gboolean make_in_base_path;
 };
 
 typedef struct
@@ -62,6 +64,8 @@
 
 gboolean project_load_file(const gchar *locale_file_name);
 
+gchar *project_get_base_path();
+
 gchar *project_get_make_dir();
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list