Kaydet (Commit) 79ff8771 authored tarafından Nick Treleaven's avatar Nick Treleaven

Add configurable default file extension setting for filetype

definition files.
Note: There is a bug with using the default extension, not the user
set one, if 'New with template' is used before any documents of the
same filetype are open.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2006 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 648735da
......@@ -7,6 +7,12 @@
* src/document.c:
Ensure document_update_tag_list() always shows the empty symbol list
when tags cannot be parsed.
* src/filetypes.c, doc/geany.txt, doc/geany.html, data/filetypes.*:
Add configurable default file extension setting for filetype
definition files.
Note: There is a bug with using the default extension, not the user
set one, if 'New with template' is used before any documents of the
same filetype are open.
2007-11-01 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
......@@ -26,6 +26,9 @@ directives=org list nolist page equivalent word text
[settings]
# default extension used when saving files
#extension=asm
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -33,6 +33,9 @@ secondary=
docComment=attention author brief bug class code date def enum example exception file fn namespace note param remarks return see since struct throw todo typedef var version warning union
[settings]
# default extension used when saving files
#extension=c
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -23,6 +23,9 @@ keywords_optional=option Some None ignore ref
[settings]
# default extension used when saving files
#extension=ml
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -12,6 +12,9 @@ defval=0x00007f;0xffffff;false;false
[settings]
# default extension used when saving files
#extension=conf
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -33,6 +33,9 @@ secondary=
docComment=attention author brief bug class code date def enum example exception file fn namespace note param remarks return see since struct throw todo typedef var version warning union
[settings]
# default extension used when saving files
#extension=cpp
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -33,6 +33,9 @@ secondary=
docComment=attention author brief bug class code date def enum example exception file fn namespace note param remarks return see since struct throw todo typedef var version warning union
[settings]
# default extension used when saving files
#extension=cs
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -25,6 +25,9 @@ pseudoclasses=first-letter first-line link active visited lang first-child focus
[settings]
# default extension used when saving files
#extension=css
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -29,6 +29,9 @@ docComment=Authors Bugs Copyright Date Deprecated Examples History License Macro
types=
[settings]
# default extension used when saving files
#extension=d
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -11,6 +11,9 @@ added=0x34b034;0xffffff;false;false
[settings]
# default extension used when saving files
#extension=diff
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -38,6 +38,9 @@ dtd=ELEMENT DOCTYPE ATTLIST ENTITY NOTATION
[settings]
# default extension used when saving files
#extension=docbook
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -29,6 +29,9 @@ types=boolean string number array object void XML Unix Sys String Stream Seriali
docComment=brief class declaration description end example extends function group implements modifies module namespace param protocol return return static type variable warning
[settings]
# default extension used when saving files
#extension=fe
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -27,6 +27,9 @@ user_functions=cdabs cdcos cdexp cdlog cdsin cdsqrt cotan cotand dcmplx dconjg d
[settings]
# default extension used when saving files
#extension=f
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -31,6 +31,9 @@ user1=
user2=
[settings]
# default extension used when saving files
#extension=bas
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -25,6 +25,9 @@ keywords=as case class data deriving do else if import in infixl infixr instance
[settings]
# default extension used when saving files
#extension=hs
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -30,6 +30,9 @@ classes=Array ArrayAccess Class Date DateTools EReg Hash IntHash IntIter Iterabl
[settings]
# default extension used when saving files
#extension=hx
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -4,6 +4,9 @@
[settings]
# default extension used when saving files
#extension=html
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -31,6 +31,9 @@ typedefs=
[settings]
# default extension used when saving files
#extension=java
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -27,6 +27,9 @@ globalclass=0x0000d0;0xffffff;true;false
primary=abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends final finally float for function goto if implements import in instanceof int interface long native new package private protected public return short static super switch synchronized this throw throws transient try typeof var void volatile while with
[settings]
# default extension used when saving files
#extension=js
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -13,6 +13,9 @@ primary=above abovedisplayshortskip abovedisplayskip abovewithdelims accent adjd
[settings]
# default extension used when saving files
#extension=tex
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -38,6 +38,9 @@ user3=
user4=
[settings]
# default extension used when saving files
#extension=lua
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -13,6 +13,9 @@ ideol=0x008000;0xffffff;false;false
[settings]
# default extension used when saving files
#extension=mak
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -19,6 +19,9 @@ primary=clear seq fillcols fillrowsgaspect gaddview gtitle gxaxis gyaxis max con
[settings]
# default extension used when saving files
#extension=oms
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -19,6 +19,9 @@ primary=absolute and array asm begin break case const constructor continue destr
[settings]
# default extension used when saving files
#extension=pas
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -37,6 +37,9 @@ primary=NULL __FILE__ __LINE__ __PACKAGE__ __DATA__ __END__ AUTOLOAD BEGIN CORE
[settings]
# default extension used when saving files
#extension=pl
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -4,6 +4,9 @@
[settings]
# default extension used when saving files
#extension=php
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -24,6 +24,9 @@ primary=and as assert break class continue def del elif else except exec finally
[settings]
# default extension used when saving files
#extension=py
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -41,6 +41,9 @@ primary=__FILE__ load define_method attr_accessor attr_writer attr_reader and de
[settings]
# default extension used when saving files
#extension=rb
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -18,6 +18,9 @@ primary=break case continue do done elif else esac eval exit export fi for funct
[settings]
# default extension used when saving files
#extension=sh
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -23,6 +23,9 @@ keywords=absolute action add admin after aggregate alias all allocate alter and
[settings]
# default extension used when saving files
#extension=sql
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -29,6 +29,9 @@ expand=
[settings]
# default extension used when saving files
#extension=tcl
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -28,6 +28,9 @@ std_types=boolean bit character severity_level integer real time delay_length na
userwords=
[settings]
# default extension used when saving files
#extension=vhd
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -75,6 +75,9 @@ sgml=ELEMENT DOCTYPE ATTLIST ENTITY NOTATION
[settings]
# default extension used when saving files
#extension=xml
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
......
......@@ -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="2007-10-19" />
<meta name="date" content="2007-10-28" />
<style type="text/css">
/*
......@@ -133,7 +133,7 @@ dt {
<br />Nick Treleaven
<br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>2007-10-19</td></tr>
<td>2007-10-28</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.13</td></tr>
</tbody>
......@@ -1321,10 +1321,12 @@ structure contained in it.</p>
<p>You can set an optional description for the project, but it is not
used elsewhere by Geany.</p>
<p>The <em>Base path</em> field is used as the directory to run the Make and Make
custom commands in.</p>
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>
<div class="section">
<h4><a class="toc-backref" href="#id65" id="run-command" name="run-command">Run command</a></h4>
<p>The Run command overrides the default run command. You can set this
<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>
<p>The following variables can be used:</p>
......@@ -2003,6 +2005,13 @@ an existing list.</p>
<div class="section">
<h4><a class="toc-backref" href="#id91" 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
including the period character (<tt class="docutils literal"><span class="pre">.</span></tt>). The extension used should
match one of the patterns associated with that filetype (see
<a class="reference" href="#filetype-extensions">Filetype extensions</a>).</p>
<p class="last"><em>Example:</em> <tt class="docutils literal"><span class="pre">extension=cxx</span></tt></p>
</dd>
<dt>wordchars</dt>
<dd><p class="first">These characters define word boundaries when making selections
and searching using word matching options.</p>
......@@ -2199,7 +2208,9 @@ when moving, selecting and deleting across word boundaries
</div>
<div class="section">
<h2><a class="toc-backref" href="#id94" id="filetype-extensions" name="filetype-extensions">Filetype extensions</a></h2>
<p>You can override the default extensions that Geany uses for each
<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
filetype using the <tt class="docutils literal"><span class="pre">filetype_extensions.conf</span></tt> file.</p>
<p>To override the system-wide configuration file, copy it from
<tt class="docutils literal"><span class="pre">$prefix/share/geany</span></tt> to your configuration directory, usually
......@@ -3096,7 +3107,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: 2007-10-22 12:32 UTC.
Generated on: 2007-11-01 16:20 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>
......
......@@ -1810,6 +1810,14 @@ an existing list.
[settings] Section
``````````````````
extension
This is the default file extension used when saving files, not
including the period character (``.``). The extension used should
match one of the patterns associated with that filetype (see
`Filetype extensions`_).
*Example:* ``extension=cxx``
wordchars
These characters define word boundaries when making selections
and searching using word matching options.
......@@ -2031,7 +2039,10 @@ whitespace_chars
Filetype extensions
-------------------
You can override the default extensions that Geany uses for each
To change the default filetype extension used when saving a new file,
see `Filetype definition files`_.
You can override the list of file extensions that Geany uses for each
filetype using the ``filetype_extensions.conf`` file.
To override the system-wide configuration file, copy it from
......
......@@ -795,6 +795,14 @@ void filetypes_get_config(GKeyFile *config, GKeyFile *configh, gint ft)
if (config == NULL || configh == NULL || ft < 0 || ft >= GEANY_MAX_FILE_TYPES) return;
// default extension
result = g_key_file_get_string(configh, "settings", "extension", NULL);
if (result == NULL) result = g_key_file_get_string(config, "settings", "extension", NULL);
if (result != NULL)
{
setptr(filetypes[ft]->extension, result);
}
// read comment notes
result = g_key_file_get_string(configh, "settings", "comment_open", NULL);
if (result == NULL) result = g_key_file_get_string(config, "settings", "comment_open", NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment