SF.net SVN: geany:[5902] trunk

colombanw at users.sourceforge.net colombanw at xxxxx
Thu Aug 25 20:14:18 UTC 2011


Revision: 5902
          http://geany.svn.sourceforge.net/geany/?rev=5902&view=rev
Author:   colombanw
Date:     2011-08-25 20:14:17 +0000 (Thu, 25 Aug 2011)
Log Message:
-----------
Add support for filetype-specific indentation settings

Closes #3339420 and #3390435.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/data/filetypes.actionscript
    trunk/data/filetypes.ada
    trunk/data/filetypes.asm
    trunk/data/filetypes.c
    trunk/data/filetypes.caml
    trunk/data/filetypes.cmake
    trunk/data/filetypes.cobol
    trunk/data/filetypes.conf
    trunk/data/filetypes.cpp
    trunk/data/filetypes.cs
    trunk/data/filetypes.css
    trunk/data/filetypes.d
    trunk/data/filetypes.diff
    trunk/data/filetypes.docbook
    trunk/data/filetypes.erlang
    trunk/data/filetypes.f77
    trunk/data/filetypes.ferite
    trunk/data/filetypes.forth
    trunk/data/filetypes.fortran
    trunk/data/filetypes.freebasic
    trunk/data/filetypes.glsl
    trunk/data/filetypes.haskell
    trunk/data/filetypes.haxe
    trunk/data/filetypes.html
    trunk/data/filetypes.java
    trunk/data/filetypes.javascript
    trunk/data/filetypes.latex
    trunk/data/filetypes.lisp
    trunk/data/filetypes.lua
    trunk/data/filetypes.makefile
    trunk/data/filetypes.matlab
    trunk/data/filetypes.nsis
    trunk/data/filetypes.pascal
    trunk/data/filetypes.perl
    trunk/data/filetypes.php
    trunk/data/filetypes.po
    trunk/data/filetypes.python
    trunk/data/filetypes.r
    trunk/data/filetypes.restructuredtext
    trunk/data/filetypes.ruby
    trunk/data/filetypes.sh
    trunk/data/filetypes.sql
    trunk/data/filetypes.tcl
    trunk/data/filetypes.vala
    trunk/data/filetypes.verilog
    trunk/data/filetypes.vhdl
    trunk/data/filetypes.xml
    trunk/data/filetypes.yaml
    trunk/doc/geany.html
    trunk/doc/geany.txt
    trunk/src/document.c
    trunk/src/filetypes.c
    trunk/src/filetypes.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/ChangeLog	2011-08-25 20:14:17 UTC (rev 5902)
@@ -1,3 +1,11 @@
+2011-08-25  Colomban Wendling  <colomban(at)geany(dot)org>
+
+ * src/document.c, src/filetypes.c, src/filetypes.h, doc/geany.txt,
+   doc/geany.html, data/filetypes.*:
+   Add support for filetype-specific indentation settings (closes
+   #3339420 and #3390435).
+
+
 2011-08-24  Colomban Wendling  <colomban(at)geany(dot)org>
 
  * src/editor.c:

Modified: trunk/data/filetypes.actionscript
===================================================================
--- trunk/data/filetypes.actionscript	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.actionscript	2011-08-25 20:14:17 UTC (rev 5902)
@@ -54,6 +54,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.ada
===================================================================
--- trunk/data/filetypes.ada	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.ada	2011-08-25 20:14:17 UTC (rev 5902)
@@ -43,7 +43,12 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
 
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.asm
===================================================================
--- trunk/data/filetypes.asm	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.asm	2011-08-25 20:14:17 UTC (rev 5902)
@@ -49,6 +49,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.c
===================================================================
--- trunk/data/filetypes.c	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.c	2011-08-25 20:14:17 UTC (rev 5902)
@@ -63,6 +63,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.caml
===================================================================
--- trunk/data/filetypes.caml	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.caml	2011-08-25 20:14:17 UTC (rev 5902)
@@ -46,6 +46,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.cmake
===================================================================
--- trunk/data/filetypes.cmake	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.cmake	2011-08-25 20:14:17 UTC (rev 5902)
@@ -47,3 +47,8 @@
 
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/data/filetypes.cobol
===================================================================
--- trunk/data/filetypes.cobol	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.cobol	2011-08-25 20:14:17 UTC (rev 5902)
@@ -41,3 +41,8 @@
 
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/data/filetypes.conf
===================================================================
--- trunk/data/filetypes.conf	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.conf	2011-08-25 20:14:17 UTC (rev 5902)
@@ -36,3 +36,8 @@
 
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/data/filetypes.cpp
===================================================================
--- trunk/data/filetypes.cpp	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.cpp	2011-08-25 20:14:17 UTC (rev 5902)
@@ -65,6 +65,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.cs
===================================================================
--- trunk/data/filetypes.cs	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.cs	2011-08-25 20:14:17 UTC (rev 5902)
@@ -65,6 +65,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.css
===================================================================
--- trunk/data/filetypes.css	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.css	2011-08-25 20:14:17 UTC (rev 5902)
@@ -61,3 +61,8 @@
 
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/data/filetypes.d
===================================================================
--- trunk/data/filetypes.d	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.d	2011-08-25 20:14:17 UTC (rev 5902)
@@ -55,6 +55,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.diff
===================================================================
--- trunk/data/filetypes.diff	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.diff	2011-08-25 20:14:17 UTC (rev 5902)
@@ -26,3 +26,8 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+

Modified: trunk/data/filetypes.docbook
===================================================================
--- trunk/data/filetypes.docbook	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.docbook	2011-08-25 20:14:17 UTC (rev 5902)
@@ -67,3 +67,8 @@
 # if this setting is set to true, a new line after a line ending with an
 # unclosed tag will be automatically indented
 xml_indent_tags=true
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/data/filetypes.erlang
===================================================================
--- trunk/data/filetypes.erlang	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.erlang	2011-08-25 20:14:17 UTC (rev 5902)
@@ -65,6 +65,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.f77
===================================================================
--- trunk/data/filetypes.f77	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.f77	2011-08-25 20:14:17 UTC (rev 5902)
@@ -50,6 +50,10 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+type=0
 
 [build_settings]
 # %f will be replaced by the complete filename

Modified: trunk/data/filetypes.ferite
===================================================================
--- trunk/data/filetypes.ferite	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.ferite	2011-08-25 20:14:17 UTC (rev 5902)
@@ -54,6 +54,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.forth
===================================================================
--- trunk/data/filetypes.forth	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.forth	2011-08-25 20:14:17 UTC (rev 5902)
@@ -45,3 +45,8 @@
 
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/data/filetypes.fortran
===================================================================
--- trunk/data/filetypes.fortran	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.fortran	2011-08-25 20:14:17 UTC (rev 5902)
@@ -50,7 +50,12 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
 
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.freebasic
===================================================================
--- trunk/data/filetypes.freebasic	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.freebasic	2011-08-25 20:14:17 UTC (rev 5902)
@@ -54,6 +54,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.glsl
===================================================================
--- trunk/data/filetypes.glsl	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.glsl	2011-08-25 20:14:17 UTC (rev 5902)
@@ -68,6 +68,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.haskell
===================================================================
--- trunk/data/filetypes.haskell	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.haskell	2011-08-25 20:14:17 UTC (rev 5902)
@@ -48,6 +48,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.haxe
===================================================================
--- trunk/data/filetypes.haxe	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.haxe	2011-08-25 20:14:17 UTC (rev 5902)
@@ -55,6 +55,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.html
===================================================================
--- trunk/data/filetypes.html	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.html	2011-08-25 20:14:17 UTC (rev 5902)
@@ -38,6 +38,11 @@
 # unclosed tag will be automatically indented
 xml_indent_tags=true
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.java
===================================================================
--- trunk/data/filetypes.java	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.java	2011-08-25 20:14:17 UTC (rev 5902)
@@ -56,7 +56,12 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
 
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.javascript
===================================================================
--- trunk/data/filetypes.javascript	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.javascript	2011-08-25 20:14:17 UTC (rev 5902)
@@ -53,6 +53,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.latex
===================================================================
--- trunk/data/filetypes.latex	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.latex	2011-08-25 20:14:17 UTC (rev 5902)
@@ -36,6 +36,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.lisp
===================================================================
--- trunk/data/filetypes.lisp	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.lisp	2011-08-25 20:14:17 UTC (rev 5902)
@@ -46,6 +46,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.lua
===================================================================
--- trunk/data/filetypes.lua	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.lua	2011-08-25 20:14:17 UTC (rev 5902)
@@ -61,6 +61,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.makefile
===================================================================
--- trunk/data/filetypes.makefile	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.makefile	2011-08-25 20:14:17 UTC (rev 5902)
@@ -35,3 +35,8 @@
 
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+type=1

Modified: trunk/data/filetypes.matlab
===================================================================
--- trunk/data/filetypes.matlab	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.matlab	2011-08-25 20:14:17 UTC (rev 5902)
@@ -39,6 +39,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.nsis
===================================================================
--- trunk/data/filetypes.nsis	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.nsis	2011-08-25 20:14:17 UTC (rev 5902)
@@ -57,6 +57,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.pascal
===================================================================
--- trunk/data/filetypes.pascal	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.pascal	2011-08-25 20:14:17 UTC (rev 5902)
@@ -50,6 +50,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.perl
===================================================================
--- trunk/data/filetypes.perl	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.perl	2011-08-25 20:14:17 UTC (rev 5902)
@@ -69,6 +69,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.php
===================================================================
--- trunk/data/filetypes.php	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.php	2011-08-25 20:14:17 UTC (rev 5902)
@@ -34,6 +34,11 @@
 # unclosed tag will be automatically indented
 xml_indent_tags=true
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.po
===================================================================
--- trunk/data/filetypes.po	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.po	2011-08-25 20:14:17 UTC (rev 5902)
@@ -38,7 +38,12 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
 
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.python
===================================================================
--- trunk/data/filetypes.python	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.python	2011-08-25 20:14:17 UTC (rev 5902)
@@ -54,6 +54,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=0
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.r
===================================================================
--- trunk/data/filetypes.r	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.r	2011-08-25 20:14:17 UTC (rev 5902)
@@ -49,3 +49,8 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+

Modified: trunk/data/filetypes.restructuredtext
===================================================================
--- trunk/data/filetypes.restructuredtext	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.restructuredtext	2011-08-25 20:14:17 UTC (rev 5902)
@@ -28,3 +28,8 @@
 
 # sort tags by appearance
 symbol_list_sort_mode=1
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/data/filetypes.ruby
===================================================================
--- trunk/data/filetypes.ruby	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.ruby	2011-08-25 20:14:17 UTC (rev 5902)
@@ -66,6 +66,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.sh
===================================================================
--- trunk/data/filetypes.sh	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.sh	2011-08-25 20:14:17 UTC (rev 5902)
@@ -44,6 +44,11 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.sql
===================================================================
--- trunk/data/filetypes.sql	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.sql	2011-08-25 20:14:17 UTC (rev 5902)
@@ -45,3 +45,8 @@
 
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/data/filetypes.tcl
===================================================================
--- trunk/data/filetypes.tcl	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.tcl	2011-08-25 20:14:17 UTC (rev 5902)
@@ -51,7 +51,12 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
 
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.vala
===================================================================
--- trunk/data/filetypes.vala	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.vala	2011-08-25 20:14:17 UTC (rev 5902)
@@ -66,6 +66,11 @@
 # context action command (please see Geany's main documentation for details)
 #context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
 [build_settings]
 # %f will be replaced by the complete filename
 # %e will be replaced by the filename without extension

Modified: trunk/data/filetypes.verilog
===================================================================
--- trunk/data/filetypes.verilog	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.verilog	2011-08-25 20:14:17 UTC (rev 5902)
@@ -46,4 +46,9 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
 
+

Modified: trunk/data/filetypes.vhdl
===================================================================
--- trunk/data/filetypes.vhdl	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.vhdl	2011-08-25 20:14:17 UTC (rev 5902)
@@ -51,4 +51,9 @@
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
 
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
 
+

Modified: trunk/data/filetypes.xml
===================================================================
--- trunk/data/filetypes.xml	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.xml	2011-08-25 20:14:17 UTC (rev 5902)
@@ -108,3 +108,8 @@
 # if this setting is set to true, a new line after a line ending with an
 # unclosed tag will be automatically indented
 xml_indent_tags=true
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/data/filetypes.yaml
===================================================================
--- trunk/data/filetypes.yaml	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/data/filetypes.yaml	2011-08-25 20:14:17 UTC (rev 5902)
@@ -41,3 +41,8 @@
 
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1

Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/doc/geany.html	2011-08-25 20:14:17 UTC (rev 5902)
@@ -430,88 +430,89 @@
 <li><a class="reference internal" href="#keywords-section" id="id189">[keywords] section</a></li>
 <li><a class="reference internal" href="#lexer-properties-section" id="id190">[lexer_properties] section</a></li>
 <li><a class="reference internal" href="#settings-section" id="id191">[settings] section</a></li>
-<li><a class="reference internal" href="#build-settings-section" id="id192">[build_settings] section</a></li>
+<li><a class="reference internal" href="#indentation-section" id="id192">[indentation] section</a></li>
+<li><a class="reference internal" href="#build-settings-section" id="id193">[build_settings] section</a></li>
 </ul>
 </li>
-<li><a class="reference internal" href="#special-file-filetypes-common" id="id193">Special file filetypes.common</a><ul>
-<li><a class="reference internal" href="#named-styles-section" id="id194">[named_styles] section</a></li>
-<li><a class="reference internal" href="#id4" id="id195">[styling] section</a></li>
-<li><a class="reference internal" href="#id5" id="id196">[settings] section</a></li>
+<li><a class="reference internal" href="#special-file-filetypes-common" id="id194">Special file filetypes.common</a><ul>
+<li><a class="reference internal" href="#named-styles-section" id="id195">[named_styles] section</a></li>
+<li><a class="reference internal" href="#id4" id="id196">[styling] section</a></li>
+<li><a class="reference internal" href="#id5" id="id197">[settings] section</a></li>
 </ul>
 </li>
 </ul>
 </li>
-<li><a class="reference internal" href="#filetype-extensions" id="id197">Filetype extensions</a></li>
-<li><a class="reference internal" href="#filetype-group-membership" id="id198">Filetype group membership</a></li>
-<li><a class="reference internal" href="#preferences-file-format" id="id199">Preferences file format</a><ul>
-<li><a class="reference internal" href="#build-menu-section" id="id200">[build-menu] section</a></li>
+<li><a class="reference internal" href="#filetype-extensions" id="id198">Filetype extensions</a></li>
+<li><a class="reference internal" href="#filetype-group-membership" id="id199">Filetype group membership</a></li>
+<li><a class="reference internal" href="#preferences-file-format" id="id200">Preferences file format</a><ul>
+<li><a class="reference internal" href="#build-menu-section" id="id201">[build-menu] section</a></li>
 </ul>
 </li>
-<li><a class="reference internal" href="#project-file-format" id="id201">Project file format</a><ul>
-<li><a class="reference internal" href="#build-menu-additions" id="id202">[build-menu] additions</a></li>
+<li><a class="reference internal" href="#project-file-format" id="id202">Project file format</a><ul>
+<li><a class="reference internal" href="#build-menu-additions" id="id203">[build-menu] additions</a></li>
 </ul>
 </li>
-<li><a class="reference internal" href="#templates" id="id203">Templates</a><ul>
-<li><a class="reference internal" href="#template-meta-data" id="id204">Template meta data</a></li>
-<li><a class="reference internal" href="#file-templates" id="id205">File templates</a><ul>
-<li><a class="reference internal" href="#adding-file-templates" id="id206">Adding file templates</a></li>
+<li><a class="reference internal" href="#templates" id="id204">Templates</a><ul>
+<li><a class="reference internal" href="#template-meta-data" id="id205">Template meta data</a></li>
+<li><a class="reference internal" href="#file-templates" id="id206">File templates</a><ul>
+<li><a class="reference internal" href="#adding-file-templates" id="id207">Adding file templates</a></li>
 </ul>
 </li>
-<li><a class="reference internal" href="#customizing-templates" id="id207">Customizing templates</a><ul>
-<li><a class="reference internal" href="#template-wildcards" id="id208">Template wildcards</a><ul>
-<li><a class="reference internal" href="#special-command-wildcard" id="id209">Special {command:} wildcard</a></li>
+<li><a class="reference internal" href="#customizing-templates" id="id208">Customizing templates</a><ul>
+<li><a class="reference internal" href="#template-wildcards" id="id209">Template wildcards</a><ul>
+<li><a class="reference internal" href="#special-command-wildcard" id="id210">Special {command:} wildcard</a></li>
 </ul>
 </li>
 </ul>
 </li>
 </ul>
 </li>
-<li><a class="reference internal" href="#customizing-the-toolbar" id="id210">Customizing the toolbar</a><ul>
-<li><a class="reference internal" href="#manually-editing-the-toolbar-layout" id="id211">Manually editing the toolbar layout</a></li>
-<li><a class="reference internal" href="#available-toolbar-elements" id="id212">Available toolbar elements</a></li>
+<li><a class="reference internal" href="#customizing-the-toolbar" id="id211">Customizing the toolbar</a><ul>
+<li><a class="reference internal" href="#manually-editing-the-toolbar-layout" id="id212">Manually editing the toolbar layout</a></li>
+<li><a class="reference internal" href="#available-toolbar-elements" id="id213">Available toolbar elements</a></li>
 </ul>
 </li>
 </ul>
 </li>
-<li><a class="reference internal" href="#plugin-documentation" id="id213">Plugin documentation</a><ul>
-<li><a class="reference internal" href="#html-characters" id="id214">HTML Characters</a><ul>
-<li><a class="reference internal" href="#insert-entity-dialog" id="id215">Insert entity dialog</a></li>
-<li><a class="reference internal" href="#replace-special-chars-by-its-entity" id="id216">Replace special chars by its entity</a><ul>
-<li><a class="reference internal" href="#at-typing-time" id="id217">At typing time</a></li>
-<li><a class="reference internal" href="#bulk-replacement" id="id218">Bulk replacement</a></li>
+<li><a class="reference internal" href="#plugin-documentation" id="id214">Plugin documentation</a><ul>
+<li><a class="reference internal" href="#html-characters" id="id215">HTML Characters</a><ul>
+<li><a class="reference internal" href="#insert-entity-dialog" id="id216">Insert entity dialog</a></li>
+<li><a class="reference internal" href="#replace-special-chars-by-its-entity" id="id217">Replace special chars by its entity</a><ul>
+<li><a class="reference internal" href="#at-typing-time" id="id218">At typing time</a></li>
+<li><a class="reference internal" href="#bulk-replacement" id="id219">Bulk replacement</a></li>
 </ul>
 </li>
 </ul>
 </li>
-<li><a class="reference internal" href="#save-actions" id="id219">Save Actions</a><ul>
-<li><a class="reference internal" href="#instant-save" id="id220">Instant Save</a></li>
-<li><a class="reference internal" href="#backup-copy" id="id221">Backup Copy</a></li>
+<li><a class="reference internal" href="#save-actions" id="id220">Save Actions</a><ul>
+<li><a class="reference internal" href="#instant-save" id="id221">Instant Save</a></li>
+<li><a class="reference internal" href="#backup-copy" id="id222">Backup Copy</a></li>
 </ul>
 </li>
 </ul>
 </li>
-<li><a class="reference internal" href="#contributing-to-this-document" id="id222">Contributing to this document</a></li>
-<li><a class="reference internal" href="#scintilla-keyboard-commands" id="id223">Scintilla keyboard commands</a><ul>
-<li><a class="reference internal" href="#keyboard-commands" id="id224">Keyboard commands</a></li>
+<li><a class="reference internal" href="#contributing-to-this-document" id="id223">Contributing to this document</a></li>
+<li><a class="reference internal" href="#scintilla-keyboard-commands" id="id224">Scintilla keyboard commands</a><ul>
+<li><a class="reference internal" href="#keyboard-commands" id="id225">Keyboard commands</a></li>
 </ul>
 </li>
-<li><a class="reference internal" href="#tips-and-tricks" id="id225">Tips and tricks</a><ul>
-<li><a class="reference internal" href="#document-notebook" id="id226">Document notebook</a></li>
-<li><a class="reference internal" href="#editor" id="id227">Editor</a></li>
-<li><a class="reference internal" href="#interface" id="id228">Interface</a></li>
-<li><a class="reference internal" href="#gtk-related" id="id229">GTK-related</a></li>
+<li><a class="reference internal" href="#tips-and-tricks" id="id226">Tips and tricks</a><ul>
+<li><a class="reference internal" href="#document-notebook" id="id227">Document notebook</a></li>
+<li><a class="reference internal" href="#editor" id="id228">Editor</a></li>
+<li><a class="reference internal" href="#interface" id="id229">Interface</a></li>
+<li><a class="reference internal" href="#gtk-related" id="id230">GTK-related</a></li>
 </ul>
 </li>
-<li><a class="reference internal" href="#compile-time-options" id="id230">Compile-time options</a><ul>
-<li><a class="reference internal" href="#src-geany-h" id="id231">src/geany.h</a></li>
-<li><a class="reference internal" href="#project-h" id="id232">project.h</a></li>
-<li><a class="reference internal" href="#editor-h" id="id233">editor.h</a></li>
-<li><a class="reference internal" href="#keyfile-c" id="id234">keyfile.c</a></li>
-<li><a class="reference internal" href="#build-c" id="id235">build.c</a></li>
+<li><a class="reference internal" href="#compile-time-options" id="id231">Compile-time options</a><ul>
+<li><a class="reference internal" href="#src-geany-h" id="id232">src/geany.h</a></li>
+<li><a class="reference internal" href="#project-h" id="id233">project.h</a></li>
+<li><a class="reference internal" href="#editor-h" id="id234">editor.h</a></li>
+<li><a class="reference internal" href="#keyfile-c" id="id235">keyfile.c</a></li>
+<li><a class="reference internal" href="#build-c" id="id236">build.c</a></li>
 </ul>
 </li>
-<li><a class="reference internal" href="#gnu-general-public-license" id="id236">GNU General Public License</a></li>
-<li><a class="reference internal" href="#license-for-scintilla-and-scite" id="id237">License for Scintilla and SciTE</a></li>
+<li><a class="reference internal" href="#gnu-general-public-license" id="id237">GNU General Public License</a></li>
+<li><a class="reference internal" href="#license-for-scintilla-and-scite" id="id238">License for Scintilla and SciTE</a></li>
 </ul>
 </div>
 <div class="section" id="introduction">
@@ -4914,8 +4915,44 @@
 this setting in their system configuration files.</dd>
 </dl>
 </div>
+<div class="section" id="indentation-section">
+<h4><a class="toc-backref" href="#id192">[indentation] section</a></h4>
+<p>This section allows definition of default indentation settings specific to
+the file type, overriding the ones configured in the preferences.  This can
+be useful for file types requiring specific indentation settings (e.g. tabs
+only for Makefile).  These settings don't override auto-detection if activated.</p>
+<dl class="docutils">
+<dt>width</dt>
+<dd>The forced indentation width.</dd>
+<dt>type</dt>
+<dd><p class="first">The forced indentation type.</p>
+<table border="1" class="last docutils">
+<colgroup>
+<col width="18%" />
+<col width="82%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Value</th>
+<th class="head">Indentation type</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>0</td>
+<td>Spaces only</td>
+</tr>
+<tr><td>1</td>
+<td>Tabs only</td>
+</tr>
+<tr><td>2</td>
+<td>Mixed (tabs and spaces)</td>
+</tr>
+</tbody>
+</table>
+</dd>
+</dl>
+</div>
 <div class="section" id="build-settings-section">
-<h4><a class="toc-backref" href="#id192">[build_settings] section</a></h4>
+<h4><a class="toc-backref" href="#id193">[build_settings] section</a></h4>
 <p>As of Geany 0.19 this section is supplemented by the <a class="reference internal" href="#build-menu-section">[build-menu] section</a>.
 Values that are set in the [build-menu] section will override those in this section.</p>
 <dl class="docutils">
@@ -4968,7 +5005,7 @@
 </div>
 </div>
 <div class="section" id="special-file-filetypes-common">
-<h3><a class="toc-backref" href="#id193">Special file filetypes.common</a></h3>
+<h3><a class="toc-backref" href="#id194">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>
@@ -4983,7 +5020,7 @@
 <p class="last">See the <a class="reference internal" href="#filetype-configuration">Filetype configuration</a> section for how to define styles.</p>
 </div>
 <div class="section" id="named-styles-section">
-<h4><a class="toc-backref" href="#id194">[named_styles] section</a></h4>
+<h4><a class="toc-backref" href="#id195">[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>
@@ -5010,7 +5047,7 @@
 schemes menu</a>.</p>
 </div>
 <div class="section" id="id4">
-<h4><a class="toc-backref" href="#id195">[styling] section</a></h4>
+<h4><a class="toc-backref" href="#id196">[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
@@ -5194,7 +5231,7 @@
 </dl>
 </div>
 <div class="section" id="id5">
-<h4><a class="toc-backref" href="#id196">[settings] section</a></h4>
+<h4><a class="toc-backref" href="#id197">[settings] section</a></h4>
 <dl class="docutils">
 <dt>whitespace_chars</dt>
 <dd><p class="first">Characters to treat as whitespace. These characters are ignored
@@ -5208,7 +5245,7 @@
 </div>
 </div>
 <div class="section" id="filetype-extensions">
-<h2><a class="toc-backref" href="#id197">Filetype extensions</a></h2>
+<h2><a class="toc-backref" href="#id198">Filetype extensions</a></h2>
 <p>To change the default filetype extension used when saving a new file,
 see <a class="reference internal" href="#filetype-definition-files">Filetype definition files</a>.</p>
 <p>You can override the list of file extensions that Geany uses to detect
@@ -5228,7 +5265,7 @@
 </pre>
 </div>
 <div class="section" id="filetype-group-membership">
-<h2><a class="toc-backref" href="#id198">Filetype group membership</a></h2>
+<h2><a class="toc-backref" href="#id199">Filetype group membership</a></h2>
 <p>Group membership is also stored in <tt class="docutils literal">filetype_extensions.conf</tt>. This
 file is used to store information Geany needs at startup, whereas the
 separate filetype definition files hold information only needed when
@@ -5249,13 +5286,13 @@
 </div>
 </div>
 <div class="section" id="preferences-file-format">
-<h2><a class="toc-backref" href="#id199">Preferences file format</a></h2>
+<h2><a class="toc-backref" href="#id200">Preferences file format</a></h2>
 <p>The user preferences file <tt class="docutils literal">geany.conf</tt> holds settings for all the items configured
 in the preferences dialog. This file should not be edited while Geany is running
 as the file will be overwritten when the preferences in Geany are changed or Geany
 is quit.</p>
 <div class="section" id="build-menu-section">
-<h3><a class="toc-backref" href="#id200">[build-menu] section</a></h3>
+<h3><a class="toc-backref" href="#id201">[build-menu] section</a></h3>
 <p>The [build-menu] section contains the configuration of the build menu.
 This section can occur in filetype, preferences and project files and
 always has the format described here.  Different menu items are loaded
@@ -5287,11 +5324,11 @@
 </div>
 </div>
 <div class="section" id="project-file-format">
-<h2><a class="toc-backref" href="#id201">Project file format</a></h2>
+<h2><a class="toc-backref" href="#id202">Project file format</a></h2>
 <p>The project file contains project related settings and possibly a
 record of the current session files.</p>
 <div class="section" id="build-menu-additions">
-<h3><a class="toc-backref" href="#id202">[build-menu] additions</a></h3>
+<h3><a class="toc-backref" href="#id203">[build-menu] additions</a></h3>
 <p>The project file also can have extra fields in the [build-menu] section
 in addition to those listed in <a class="reference internal" href="#build-menu-section">[build-menu] section</a> above.</p>
 <p>When filetype menu items are configured for the project they are stored
@@ -5307,7 +5344,7 @@
 </div>
 </div>
 <div class="section" id="templates">
-<h2><a class="toc-backref" href="#id203">Templates</a></h2>
+<h2><a class="toc-backref" href="#id204">Templates</a></h2>
 <p>Geany supports the following templates:</p>
 <ul class="simple">
 <li>ChangeLog entry</li>
@@ -5336,7 +5373,7 @@
 also force this by selecting <em>Tools->Reload Configuration</em>.</p>
 </div>
 <div class="section" id="template-meta-data">
-<h3><a class="toc-backref" href="#id204">Template meta data</a></h3>
+<h3><a class="toc-backref" href="#id205">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 "Templates" (see
@@ -5344,7 +5381,7 @@
 which will be inserted in the templates.</p>
 </div>
 <div class="section" id="file-templates">
-<h3><a class="toc-backref" href="#id205">File templates</a></h3>
+<h3><a class="toc-backref" href="#id206">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>
@@ -5356,7 +5393,7 @@
 wildcard can be placed anywhere, but it's usually put on the first
 line of the file, followed by a blank line.</p>
 <div class="section" id="adding-file-templates">
-<h4><a class="toc-backref" href="#id206">Adding file templates</a></h4>
+<h4><a class="toc-backref" href="#id207">Adding file templates</a></h4>
 <p>File templates are read from <tt class="docutils literal">templates/files</tt> under the
 <a class="reference internal" href="#configuration-file-paths">Configuration file paths</a>.</p>
 <p>The filetype to use is detected from the template file's extension, if
@@ -5367,7 +5404,7 @@
 </div>
 </div>
 <div class="section" id="customizing-templates">
-<h3><a class="toc-backref" href="#id207">Customizing templates</a></h3>
+<h3><a class="toc-backref" href="#id208">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 internal" href="#command-line-options">Command line options</a> for further information about the configuration
@@ -5375,7 +5412,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" id="template-wildcards">
-<h4><a class="toc-backref" href="#id208">Template wildcards</a></h4>
+<h4><a class="toc-backref" href="#id209">Template wildcards</a></h4>
 <p>All wildcards must be enclosed by "{" and "}", e.g. {date}.</p>
 <p><strong>Wildcards for character escaping</strong></p>
 <table border="1" class="docutils">
@@ -5588,7 +5625,7 @@
 </tbody>
 </table>
 <div class="section" id="special-command-wildcard">
-<h5><a class="toc-backref" href="#id209">Special {command:} wildcard</a></h5>
+<h5><a class="toc-backref" href="#id210">Special {command:} wildcard</a></h5>
 <p>The {command:} wildcard is a special one because it can execute
 a specified command and put the command's output (stdout) into
 the template.</p>
@@ -5623,14 +5660,14 @@
 </div>
 </div>
 <div class="section" id="customizing-the-toolbar">
-<h2><a class="toc-backref" href="#id210">Customizing the toolbar</a></h2>
+<h2><a class="toc-backref" href="#id211">Customizing the toolbar</a></h2>
 <p>You can add, remove and reorder the elements in the toolbar by using
 the toolbar editor, or by manually editing the configuration file
 <tt class="docutils literal">ui_toolbar.xml</tt>.</p>
 <p>The toolbar editor can be opened from the preferences editor on the Toolbar tab or
 by right-clicking on the toolbar itself and choosing it from the menu.</p>
 <div class="section" id="manually-editing-the-toolbar-layout">
-<h3><a class="toc-backref" href="#id211">Manually editing the toolbar layout</a></h3>
+<h3><a class="toc-backref" href="#id212">Manually editing the toolbar layout</a></h3>
 <p>To override the system-wide configuration file, copy it to your user
 configuration directory (see <a class="reference internal" href="#configuration-file-paths">Configuration file paths</a>).</p>
 <p>For example:</p>
@@ -5652,7 +5689,7 @@
 </div>
 </div>
 <div class="section" id="available-toolbar-elements">
-<h3><a class="toc-backref" href="#id212">Available toolbar elements</a></h3>
+<h3><a class="toc-backref" href="#id213">Available toolbar elements</a></h3>
 <table border="1" class="docutils">
 <colgroup>
 <col width="19%" />
@@ -5766,13 +5803,13 @@
 </div>
 </div>
 <div class="section" id="plugin-documentation">
-<h1><a class="toc-backref" href="#id213">Plugin documentation</a></h1>
+<h1><a class="toc-backref" href="#id214">Plugin documentation</a></h1>
 <div class="section" id="html-characters">
-<h2><a class="toc-backref" href="#id214">HTML Characters</a></h2>
+<h2><a class="toc-backref" href="#id215">HTML Characters</a></h2>
 <p>The HTML Characters plugin helps when working with special
 characters in XML/HTML, e.g. German Umlauts ü and ä.</p>
 <div class="section" id="insert-entity-dialog">
-<h3><a class="toc-backref" href="#id215">Insert entity dialog</a></h3>
+<h3><a class="toc-backref" href="#id216">Insert entity dialog</a></h3>
 <p>When the plugin is enabled, you can insert special character
 entities using <em>Tools->Insert Special HTML Characters</em>.</p>
 <p>This opens up a dialog where you can find a huge amount of special
@@ -5784,7 +5821,7 @@
 might also like to double click the chosen entity instead.</p>
 </div>
 <div class="section" id="replace-special-chars-by-its-entity">
-<h3><a class="toc-backref" href="#id216">Replace special chars by its entity</a></h3>
+<h3><a class="toc-backref" href="#id217">Replace special chars by its entity</a></h3>
 <p>To help make a XML/HTML document valid the plugin supports
 replacement of special chars known by the plugin. Both bulk
 replacement and immediate replacement during typing are supported.</p>
@@ -5800,7 +5837,7 @@
 </dd>
 </dl>
 <div class="section" id="at-typing-time">
-<h4><a class="toc-backref" href="#id217">At typing time</a></h4>
+<h4><a class="toc-backref" href="#id218">At typing time</a></h4>
 <p>You can activate/deactivate this feature using the <em>Tools->HTML
 Replacement->Auto-replace Special Characters</em> menu item. If it's
 activated, all special characters (beside the given exceptions from
@@ -5809,7 +5846,7 @@
 of this feature.</p>
 </div>
 <div class="section" id="bulk-replacement">
-<h4><a class="toc-backref" href="#id218">Bulk replacement</a></h4>
+<h4><a class="toc-backref" href="#id219">Bulk replacement</a></h4>
 <p>After inserting a huge amount of text, e.g. by using copy & paste, the
 plugin allows bulk replacement of all known characters (beside the
 mentioned exceptions). You can find the function under the same
@@ -5819,9 +5856,9 @@
 </div>
 </div>
 <div class="section" id="save-actions">
-<h2><a class="toc-backref" href="#id219">Save Actions</a></h2>
+<h2><a class="toc-backref" href="#id220">Save Actions</a></h2>
 <div class="section" id="instant-save">
-<h3><a class="toc-backref" href="#id220">Instant Save</a></h3>
+<h3><a class="toc-backref" href="#id221">Instant Save</a></h3>
 <p>This plugin sets on every new file (<em>File->New</em> or <em>File->New (with template)</em>)
 a randomly chosen filename and set its filetype appropriate to the used template
 or when no template was used, to a configurable default filetype.
@@ -5831,7 +5868,7 @@
 similar.</p>
 </div>
 <div class="section" id="backup-copy">
-<h3><a class="toc-backref" href="#id221">Backup Copy</a></h3>
+<h3><a class="toc-backref" href="#id222">Backup Copy</a></h3>
 <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
@@ -5842,7 +5879,7 @@
 </div>
 </div>
 <div class="section" id="contributing-to-this-document">
-<h1><a class="toc-backref" href="#id222">Contributing to this document</a></h1>
+<h1><a class="toc-backref" href="#id223">Contributing to this document</a></h1>
 <p>This document (<tt class="docutils literal">geany.txt</tt>) is written in <a class="reference external" 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">doc</tt>
 subdirectory.  If you intend on making changes, you should grab the
@@ -5862,7 +5899,7 @@
 and Fedora systems.</p>
 </div>
 <div class="section" id="scintilla-keyboard-commands">
-<h1><a class="toc-backref" href="#id223">Scintilla keyboard commands</a></h1>
+<h1><a class="toc-backref" href="#id224">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
@@ -5871,7 +5908,7 @@
 Scintilla and SciTE</a>.</p>
 <p>20 June 2006</p>
 <div class="section" id="keyboard-commands">
-<h2><a class="toc-backref" href="#id224">Keyboard commands</a></h2>
+<h2><a class="toc-backref" href="#id225">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
@@ -5953,9 +5990,9 @@
 </div>
 </div>
 <div class="section" id="tips-and-tricks">
-<h1><a class="toc-backref" href="#id225">Tips and tricks</a></h1>
+<h1><a class="toc-backref" href="#id226">Tips and tricks</a></h1>
 <div class="section" id="document-notebook">
-<h2><a class="toc-backref" href="#id226">Document notebook</a></h2>
+<h2><a class="toc-backref" href="#id227">Document notebook</a></h2>
 <ul class="simple">
 <li>Double-click on empty space in the notebook tab bar to open a
 new document.</li>
@@ -5968,7 +6005,7 @@
 </ul>
 </div>
 <div class="section" id="editor">
-<h2><a class="toc-backref" href="#id227">Editor</a></h2>
+<h2><a class="toc-backref" href="#id228">Editor</a></h2>
 <ul class="simple">
 <li>Alt-scroll wheel moves up/down a page.</li>
 <li>Ctrl-scroll wheel zooms in/out.</li>
@@ -5978,13 +6015,13 @@
 </ul>
 </div>
 <div class="section" id="interface">
-<h2><a class="toc-backref" href="#id228">Interface</a></h2>
+<h2><a class="toc-backref" href="#id229">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" id="gtk-related">
-<h2><a class="toc-backref" href="#id229">GTK-related</a></h2>
+<h2><a class="toc-backref" href="#id230">GTK-related</a></h2>
 <ul class="simple">
 <li>Scrolling the mouse wheel over a notebook tab bar will switch
 notebook pages.</li>
@@ -5999,7 +6036,7 @@
 </div>
 </div>
 <div class="section" id="compile-time-options">
-<h1><a class="toc-backref" href="#id230">Compile-time options</a></h1>
+<h1><a class="toc-backref" href="#id231">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
@@ -6011,7 +6048,7 @@
 <p class="last">Most users should not need to change these options.</p>
 </div>
 <div class="section" id="src-geany-h">
-<h2><a class="toc-backref" href="#id231">src/geany.h</a></h2>
+<h2><a class="toc-backref" href="#id232">src/geany.h</a></h2>
 <table border="1" class="docutils">
 <colgroup>
 <col width="33%" />
@@ -6068,7 +6105,7 @@
 </table>
 </div>
 <div class="section" id="project-h">
-<h2><a class="toc-backref" href="#id232">project.h</a></h2>
+<h2><a class="toc-backref" href="#id233">project.h</a></h2>
 <table border="1" class="docutils">
 <colgroup>
 <col width="33%" />
@@ -6093,7 +6130,7 @@
 </table>
 </div>
 <div class="section" id="editor-h">
-<h2><a class="toc-backref" href="#id233">editor.h</a></h2>
+<h2><a class="toc-backref" href="#id234">editor.h</a></h2>
 <table border="1" class="docutils">
 <colgroup>
 <col width="33%" />
@@ -6119,7 +6156,7 @@
 </table>
 </div>
 <div class="section" id="keyfile-c">
-<h2><a class="toc-backref" href="#id234">keyfile.c</a></h2>
+<h2><a class="toc-backref" href="#id235">keyfile.c</a></h2>
 <p>These are default settings that can be overridden in the <a class="reference internal" href="#preferences">Preferences</a> dialog.</p>
 <table border="1" class="docutils">
 <colgroup>
@@ -6200,7 +6237,7 @@
 </table>
 </div>
 <div class="section" id="build-c">
-<h2><a class="toc-backref" href="#id235">build.c</a></h2>
+<h2><a class="toc-backref" href="#id236">build.c</a></h2>
 <table border="1" class="docutils">
 <colgroup>
 <col width="33%" />
@@ -6245,7 +6282,7 @@
 </div>
 </div>
 <div class="section" id="gnu-general-public-license">
-<h1><a class="toc-backref" href="#id236">GNU General Public License</a></h1>
+<h1><a class="toc-backref" href="#id237">GNU General Public License</a></h1>
 <pre class="literal-block">
             GNU GENERAL PUBLIC LICENSE
                Version 2, June 1991
@@ -6590,7 +6627,7 @@
 </pre>
 </div>
 <div class="section" id="license-for-scintilla-and-scite">
-<h1><a class="toc-backref" href="#id237">License for Scintilla and SciTE</a></h1>
+<h1><a class="toc-backref" href="#id238">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
@@ -6610,7 +6647,7 @@
 <div class="footer">
 <hr class="footer" />
 <a class="reference external" href="geany.txt">View document source</a>.
-Generated on: 2011-07-28 17:42 UTC.
+Generated on: 2011-08-25 15:23 UTC.
 Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/doc/geany.txt	2011-08-25 20:14:17 UTC (rev 5902)
@@ -4050,6 +4050,29 @@
     this setting in their system configuration files.
 
 
+[indentation] section
+`````````````````````
+
+This section allows definition of default indentation settings specific to
+the file type, overriding the ones configured in the preferences.  This can
+be useful for file types requiring specific indentation settings (e.g. tabs
+only for Makefile).  These settings don't override auto-detection if activated.
+
+width
+    The forced indentation width.
+
+type
+    The forced indentation type.
+
+    =====   =======================
+    Value   Indentation type
+    =====   =======================
+    0       Spaces only
+    1       Tabs only
+    2       Mixed (tabs and spaces)
+    =====   =======================
+
+
 [build_settings] section
 ````````````````````````
 

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/src/document.c	2011-08-25 20:14:17 UTC (rev 5902)
@@ -950,16 +950,19 @@
 }
 
 
-/* Detect the indent type based on counting the leading indent characters for each line. */
-static GeanyIndentType detect_indent_type(GeanyEditor *editor)
+/* Detect the indent type based on counting the leading indent characters for each line.
+ * Returns whether detection succeeded, and the detected type in *type_ upon success */
+static gboolean detect_indent_type(GeanyEditor *editor, GeanyIndentType *type_)
 {
-	const GeanyIndentPrefs *iprefs = editor_get_indent_prefs(editor);
 	ScintillaObject *sci = editor->sci;
 	gint line, line_count;
 	gsize tabs = 0, spaces = 0;
 
 	if (detect_tabs_and_spaces(editor))
-		return GEANY_INDENT_TYPE_BOTH;
+	{
+		*type_ = GEANY_INDENT_TYPE_BOTH;
+		return TRUE;
+	}
 
 	line_count = sci_get_line_count(sci);
 	for (line = 0; line < line_count; line++)
@@ -980,20 +983,23 @@
 			spaces++;
 	}
 	if (spaces == 0 && tabs == 0)
-		return iprefs->type;
+		return FALSE;
 
 	/* the factors may need to be tweaked */
 	if (spaces > tabs * 4)
-		return GEANY_INDENT_TYPE_SPACES;
+		*type_ = GEANY_INDENT_TYPE_SPACES;
 	else if (tabs > spaces * 4)
-		return GEANY_INDENT_TYPE_TABS;
+		*type_ = GEANY_INDENT_TYPE_TABS;
 	else
-		return GEANY_INDENT_TYPE_BOTH;
+		*type_ = GEANY_INDENT_TYPE_BOTH;
+
+	return TRUE;
 }
 
 
-/* Detect the indent width based on counting the leading indent characters for each line. */
-static gint detect_indent_width(GeanyEditor *editor, GeanyIndentType type)
+/* Detect the indent width based on counting the leading indent characters for each line.
+ * Returns whether detection succeeded, and the detected width in *width_ upon success */
+static gboolean detect_indent_width(GeanyEditor *editor, GeanyIndentType type, gint *width_)
 {
 	const GeanyIndentPrefs *iprefs = editor_get_indent_prefs(editor);
 	ScintillaObject *sci = editor->sci;
@@ -1003,7 +1009,7 @@
 
 	/* can't easily detect the supposed width of a tab, guess the default is OK */
 	if (type == GEANY_INDENT_TYPE_TABS)
-		return iprefs->width;
+		return FALSE;
 
 	/* force 8 at detection time for tab & spaces -- anyway we don't use tabs at this point */
 	sci_set_tab_width(sci, 8);
@@ -1038,41 +1044,23 @@
 		}
 	}
 
-	return width;
-}
+	if (count == 0)
+		return FALSE;
 
-
-/* returns the forced indent type or -1 if none is forced */
-static gint get_forced_indent_type(GeanyDocument *doc)
-{
-	switch (doc->file_type->id)
-	{
-		case GEANY_FILETYPES_MAKE:
-			/* force using tabs for indentation for Makefiles */
-			return GEANY_INDENT_TYPE_TABS;
-		case GEANY_FILETYPES_F77:
-			/* force using spaces for indentation for Fortran 77 */
-			return GEANY_INDENT_TYPE_SPACES;
-		default:
-			return -1;
-	}
+	*width_ = width;
+	return TRUE;
 }
 
 
 void document_apply_indent_settings(GeanyDocument *doc)
 {
 	const GeanyIndentPrefs *iprefs = editor_get_indent_prefs(NULL);
-	gint type;
+	GeanyIndentType type = iprefs->type;
 	gint width = iprefs->width;
 
-	type = get_forced_indent_type(doc);
-	if (type < 0 && ! iprefs->detect_type)
-		type = iprefs->type;
-	else if (type < 0)
+	if (iprefs->detect_type && detect_indent_type(doc->editor, &type))
 	{
-		type = detect_indent_type(doc->editor);
-
-		if (type != (gint)iprefs->type)
+		if (type != iprefs->type)
 		{
 			const gchar *name = NULL;
 
@@ -1094,16 +1082,20 @@
 				DOC_FILENAME(doc));
 		}
 	}
-	if (iprefs->detect_width)
-	{
-		width = detect_indent_width(doc->editor, type);
+	else if (doc->file_type->indent_type > -1)
+		type = doc->file_type->indent_type;
 
+	if (iprefs->detect_width && detect_indent_width(doc->editor, type, &width))
+	{
 		if (width != iprefs->width)
 		{
 			ui_set_statusbar(TRUE, _("Setting indentation width to %d for %s."), width,
 				DOC_FILENAME(doc));
 		}
 	}
+	else if (doc->file_type->indent_width > -1)
+		width = doc->file_type->indent_width;
+
 	editor_set_indent(doc->editor, type, width);
 }
 
@@ -2499,13 +2491,18 @@
 
 	if (ft_changed)
 	{
-		gint forced_indent_type = get_forced_indent_type(doc);
+		const GeanyIndentPrefs *iprefs = editor_get_indent_prefs(NULL);
 
-		if (forced_indent_type >= 0)
-		{	/* update forced indents, like Makefiles and F77 */
-			editor_set_indent_type(doc->editor, forced_indent_type);
+		/* assume that if previous filetype was none and the settings are the default ones, this
+		 * is the first time the filetype is carefully set, so we should apply indent settings */
+		if (old_ft && old_ft->id == GEANY_FILETYPES_NONE &&
+			doc->editor->indent_type == iprefs->type &&
+			doc->editor->indent_width == iprefs->width)
+		{
+			document_apply_indent_settings(doc);
 			ui_document_show_hide(doc);
 		}
+
 		sidebar_openfiles_update(doc); /* to update the icon */
 		g_signal_emit_by_name(geany_object, "document-filetype-set", doc, old_ft);
 	}

Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/src/filetypes.c	2011-08-25 20:14:17 UTC (rev 5902)
@@ -498,6 +498,8 @@
 	/* pattern must not be null */
 	ft->pattern = g_new0(gchar*, 1);
 	ft->project_list_entry = -1; /* no entry */
+	ft->indent_width = -1;
+	ft->indent_type = -1;
 
 	ft->priv = g_new0(GeanyFiletypePrivate, 1);
 	return ft;
@@ -1118,6 +1120,27 @@
 }
 
 
+static void load_indent_settings(GeanyFiletype *ft, GKeyFile *config, GKeyFile *configh)
+{
+	ft->indent_width = utils_get_setting(integer, configh, config, "indentation", "width", -1);
+	ft->indent_type = utils_get_setting(integer, configh, config, "indentation", "type", -1);
+	/* check whether the indent type is OK */
+	switch (ft->indent_type)
+	{
+		case GEANY_INDENT_TYPE_TABS:
+		case GEANY_INDENT_TYPE_SPACES:
+		case GEANY_INDENT_TYPE_BOTH:
+		case -1:
+			break;
+
+		default:
+			g_warning("Invalid indent type %d in file type %s", ft->indent_type, ft->name);
+			ft->indent_type = -1;
+			break;
+	}
+}
+
+
 static void load_settings(gint ft_id, GKeyFile *config, GKeyFile *configh)
 {
 	GeanyFiletype *ft = filetypes[ft_id];
@@ -1188,6 +1211,9 @@
 	ft->priv->xml_indent_tags = utils_get_setting(boolean, configh, config, "settings",
 		"xml_indent_tags", FALSE);
 
+	/* read indent settings */
+	load_indent_settings(ft, config, configh);
+
 	/* read build settings */
 	build_load_menu(config, GEANY_BCS_FT, (gpointer)ft);
 	build_load_menu(configh, GEANY_BCS_HOME_FT, (gpointer)ft);

Modified: trunk/src/filetypes.h
===================================================================
--- trunk/src/filetypes.h	2011-08-25 20:12:56 UTC (rev 5901)
+++ trunk/src/filetypes.h	2011-08-25 20:14:17 UTC (rev 5902)
@@ -136,6 +136,9 @@
 	gchar			 *mime_type;
 	GdkPixbuf		 *icon;
 	gchar			 *comment_single; /* single-line comment */
+	/* filetype indent settings, -1 if not set */
+	gint			  indent_type;
+	gint			  indent_width;
 
 	struct GeanyFiletypePrivate	*priv;	/* must be last, append fields before this item */
 #ifdef GEANY_PRIVATE

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