diff -Ncr geany-src/data/filetype_extensions.conf geany/data/filetype_extensions.conf
*** geany-src/data/filetype_extensions.conf	2009-07-16 23:42:08.000000000 +0200
--- geany/data/filetype_extensions.conf	2009-07-16 23:48:02.000000000 +0200
***************
*** 47,50 ****
--- 47,51 ----
  reStructuredText=*.rest;*.reST;*.rst;
  SQL=*.sql;
  YAML=*.yaml;*.yml;
+ Erlang=*.erl;*.hrl;
  None=*;
diff -Ncr geany-src/data/filetypes.erlang geany/data/filetypes.erlang
*** geany-src/data/filetypes.erlang	1970-01-01 01:00:00.000000000 +0100
--- geany/data/filetypes.erlang	2009-07-16 23:48:26.000000000 +0200
***************
*** 0 ****
--- 1,56 ----
+ # For complete documentation of this file, please see Geany's main documentation
+ [styling]
+ # foreground;background;bold;italic
+ default=0x000000;0xffffff;false;false
+ comment=0x808080;0xffffff;false;false
+ commentFunction=0x808080;0xffffff;false;false
+ commentModule=0x808080;0xffffff;false;false
+ commentDoc=0x808080;0xffffff;true;false
+ commentDocMacro=0x808080;0xffffff;true;false
+ variable=0x7f0000;0xffffff;false;false
+ number=0x007f00;0xffffff;false;false
+ string=0xff901e;0xffffff;false;false
+ function_name=0x00007f;0xffffff;false;false
+ character=0xff901e;0xffffff;false;false
+ macro=0xba00ab;0xffffff;false;false
+ record=0x635b00;0xffffff;false;false
+ node_name=0x000000;0xffffff;false;false
+ reservedWords=0x00007f;0xffffff;true;false
+ bifs=0x0000FF;0xffffff;true;false
+ modules=0x00CCCC;0xffffff;false;false
+ modulesAtt=0x007d7d;0xffffff;false;false
+ modulesFuncs=0x007d7d;0xffffff;false;false
+ preProc=0x007d7d;0xffffff;false;false
+ unknown=0x000000;0xffffff;false;false
+ 
+ [keywords]
+ # all items must be in one line
+ reservedWords=after and andalso band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse query receive rem try when xor
+ BIFs=erlang: abs adler32 adler32_combine erlang:append_element apply atom_to_binary atom_to_list binary_to_atom binary_to_existing_atom binary_to_list bitstring_to_list binary_to_term bit_size erlang:bump_reductions byte_size erlang:cancel_timer check_process_code concat_binary crc32 crc32_combine date decode_packet delete_module erlang:demonitor disconnect_node erlang:display element erase erlang:error exit float float_to_list erlang:fun_info erlang:fun_to_list erlang:function_exported garbage_collect get erlang:get_cookie get_keys erlang:get_stacktrace group_leader halt erlang:hash hd erlang:hibernate integer_to_list erlang:integer_to_list iolist_to_binary iolist_size is_alive is_atom is_binary is_bitstring is_boolean erlang:is_builtin is_float is_function is_integer is_list is_number is_pid is_port is_process_alive is_record is_reference is_tuple length link list_to_atom list_to_binary list_to_bitstring list_to_existing_atom list_to_float list_to_integer erlang:list_to_integer list_to_pid list_to_tuple load_module erlang:loaded erlang:localtime erlang:localtime_to_universaltime make_ref erlang:make_tuple erlang:max erlang:md5 erlang:md5_final erlang:md5_init erlang:md5_update erlang:memory erlang:min module_loaded erlang:monitor monitor_node node nodes now open_port erlang:phash erlang:phash2 pid_to_list port_close port_command port_connect port_control erlang:port_call erlang:port_info erlang:port_to_list erlang:ports pre_loaded erlang:process_display process_flag process_info processes purge_module put erlang:raise erlang:read_timer erlang:ref_to_list register registered erlang:resume_process round self erlang:send erlang:send_after erlang:send_nosuspend erlang:set_cookie setelement size spawn spawn_link spawn_monitor spawn_opt split_binary erlang:start_timer statistics erlang:suspend_process erlang:system_flag erlang:system_info erlang:system_monitor erlang:system_profile term_to_binary throw time tl erlang:trace erlang:trace_delivered erlang:trace_info erlang:trace_pattern trunc tuple_size tuple_to_list erlang:universaltime erlang:universaltime_to_localtime unlink unregister whereis erlang:yield
+ preprocessor=-define -else -endif -ifdef -ifndef -include -include_lib -undef
+ modulesAttributes=-behavior -behaviour -compile -created -created_by -export -file -import -module -modified -modified_by -record -revision -spec -type -vsn
+ doc=@author @clear @copyright @deprecated @doc @docfile @end @equiv @headerfile @hidden @private @reference @see @since @spec @throws @title @todo @TODO @type @version
+ docMacro=@date @docRoot @link @module @package @section @time @type @version
+ 
+ [settings]
+ # if only single comment char is supported like # in this file, leave comment_close blank
+ comment_open=%
+ comment_close=
+ 
+ # set to false if a comment character/string should start at column 0 of a line, true uses any
+ # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
+ 	#command_example();
+ # setting to false would generate this
+ #	command_example();
+ # This setting works only for single line comments
+ comment_use_indent=true
+ 
+ # context action command (please see Geany's main documentation for details)
+ context_action_cmd=
+ 
+ [build_settings]
+ # %f will be replaced by the complete filename
+ # %e will be replaced by the filename without extension
+ # (use only one of it at one time)
+ compiler=erlc "%f"
+ run_cmd=erl -noshell -run "%e" main -run erlang halt
diff -Ncr geany-src/scintilla/include/SciLexer.h geany/scintilla/include/SciLexer.h
*** geany-src/scintilla/include/SciLexer.h	2009-07-16 23:39:02.000000000 +0200
--- geany/scintilla/include/SciLexer.h	2009-07-16 23:49:33.000000000 +0200
***************
*** 778,795 ****
  #define SCE_METAPOST_EXTRA 6
  #define SCE_ERLANG_DEFAULT 0
  #define SCE_ERLANG_COMMENT 1
! #define SCE_ERLANG_VARIABLE 2
! #define SCE_ERLANG_NUMBER 3
! #define SCE_ERLANG_KEYWORD 4
! #define SCE_ERLANG_STRING 5
! #define SCE_ERLANG_OPERATOR 6
! #define SCE_ERLANG_ATOM 7
! #define SCE_ERLANG_FUNCTION_NAME 8
! #define SCE_ERLANG_CHARACTER 9
! #define SCE_ERLANG_MACRO 10
! #define SCE_ERLANG_RECORD 11
! #define SCE_ERLANG_SEPARATOR 12
  #define SCE_ERLANG_NODE_NAME 13
  #define SCE_ERLANG_UNKNOWN 31
  #define SCE_MSSQL_DEFAULT 0
  #define SCE_MSSQL_COMMENT 1
--- 778,801 ----
  #define SCE_METAPOST_EXTRA 6
  #define SCE_ERLANG_DEFAULT 0
  #define SCE_ERLANG_COMMENT 1
! #define SCE_ERLANG_COMMENT_FUNCTION 2
! #define SCE_ERLANG_COMMENT_MODULE 3
! #define SCE_ERLANG_COMMENT_DOC 4
! #define SCE_ERLANG_COMMENT_DOC_MACRO 5
! #define SCE_ERLANG_VARIABLE 6
! #define SCE_ERLANG_NUMBER 7
! #define SCE_ERLANG_STRING 8
! #define SCE_ERLANG_FUNCTION_NAME 9
! #define SCE_ERLANG_CHARACTER 10
! #define SCE_ERLANG_MACRO 11
! #define SCE_ERLANG_RECORD 12
  #define SCE_ERLANG_NODE_NAME 13
+ #define SCE_ERLANG_KEYWORD 14
+ #define SCE_ERLANG_BIFS 15
+ #define SCE_ERLANG_MODULES 16
+ #define SCE_ERLANG_MODULES_ATT 17
+ #define SCE_ERLANG_MODULES_FUNCS 18
+ #define SCE_ERLANG_PREPROC 19
  #define SCE_ERLANG_UNKNOWN 31
  #define SCE_MSSQL_DEFAULT 0
  #define SCE_MSSQL_COMMENT 1
diff -Ncr geany-src/scintilla/KeyWords.cxx geany/scintilla/KeyWords.cxx
*** geany-src/scintilla/KeyWords.cxx	2009-07-16 23:40:08.000000000 +0200
--- geany/scintilla/KeyWords.cxx	2009-07-16 23:59:01.000000000 +0200
***************
*** 150,155 ****
--- 150,156 ----
  	LINK_LEXER(lmCss);
  	LINK_LEXER(lmD);
  	LINK_LEXER(lmDiff);
+ 	LINK_LEXER(lmErlang);
  	LINK_LEXER(lmF77);
  	LINK_LEXER(lmFortran);
  	LINK_LEXER(lmFreeBasic);
diff -Ncr geany-src/scintilla/LexErlang.cxx geany/scintilla/LexErlang.cxx
*** geany-src/scintilla/LexErlang.cxx	1970-01-01 01:00:00.000000000 +0100
--- geany/scintilla/LexErlang.cxx	2009-07-16 23:51:24.000000000 +0200
***************
*** 0 ****
--- 1,267 ----
+ // Scintilla source code edit control
+ // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+ // The License.txt file describes the conditions under which this software may be distributed.
+ /** @file LexErlang.cxx
+  ** Lexer for Erlang
+  ** Written by lenain (etienne.girondel@gmail.com)
+  **/
+ 
+ #include <stdlib.h>
+ #include <string.h>
+ #include <ctype.h>
+ #include <stdio.h>
+ #include <stdarg.h>
+ 
+ #include "Platform.h"
+ #include "PropSet.h"
+ #include "Accessor.h"
+ #include "StyleContext.h"
+ #include "KeyWords.h"
+ #include "Scintilla.h"
+ #include "SciLexer.h"
+ 
+ #ifdef SCI_NAMESPACE
+ using namespace Scintilla;
+ #endif
+ 
+ static inline bool IsNewline(const int ch) {
+    return (ch == '\n' || ch == '\r');
+ }
+ 
+ static inline bool IsAWordChar(const int ch) {
+ 	return (ch < 0x80) && (ch != ' ') && (isalnum(ch) || ch == '_');
+ }
+ 
+ static inline bool IsAWordStart(const int ch) {
+ 	return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' ||
+ 		ch == '%' || ch == '@' || ch == '$' || ch == '?');
+ }
+ 
+ static void setDefaultIf(StyleContext* sc, bool cond) {
+ 	if (cond) {
+ 		(*sc).SetState(SCE_ERLANG_DEFAULT);
+ 		(*sc).ChangeState(SCE_ERLANG_DEFAULT);
+ 	}
+ }
+ 
+ static void ColouriseErlangDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+                             Accessor &styler) {
+ 
+ 	StyleContext sc(startPos, length, initStyle, styler);
+ 	WordList &reservedWords = *keywordlists[0];
+ 	WordList &erlangBIFs = *keywordlists[1];
+ 	WordList &erlangPreproc = *keywordlists[2];
+ 	WordList &erlangModulesAtt = *keywordlists[3];
+ 	WordList &erlangDoc = *keywordlists[4];
+ 	WordList &erlangDocMacro = *keywordlists[5];
+ 	
+ 	bool noNewState;
+ 	bool readingChar = false;
+ 	bool toLateForComment = false;
+ 	int style,oldstyle;
+ 	int i = 0;
+ 	char cur[100];
+ 	char tmp[100];
+ 	
+ 	for (; sc.More(); sc.Forward()) {
+ 		style = SCE_ERLANG_UNKNOWN;
+ 		switch (sc.state) {
+ 			case SCE_ERLANG_COMMENT : {
+ 				if (sc.ch == ' ') {
+ 					toLateForComment = true;
+ 				} else if (!toLateForComment && sc.ch == '%') {
+ 					sc.ChangeState(SCE_ERLANG_COMMENT_FUNCTION);
+ 					oldstyle=SCE_ERLANG_COMMENT_FUNCTION;
+ 					sc.Forward();
+ 				}
+ 			}
+ 			case SCE_ERLANG_COMMENT_FUNCTION : {
+ 				if (sc.ch == ' ') {
+ 					toLateForComment = true;
+ 				} else if (!toLateForComment && sc.ch == '%') {
+ 					sc.ChangeState(SCE_ERLANG_COMMENT_MODULE);
+ 					oldstyle=SCE_ERLANG_COMMENT_MODULE;
+ 				}
+ 			}
+ 			case SCE_ERLANG_COMMENT_MODULE : {
+ 				if (sc.state != SCE_ERLANG_COMMENT) {
+ 					if (sc.ch == '@') {
+ 						sc.SetState(SCE_ERLANG_COMMENT_DOC);
+ 					}
+ 					if (sc.ch == '{' && sc.chNext == '@' && sc.chPrev != '@') {
+ 						sc.ChangeState(SCE_ERLANG_COMMENT_DOC);
+ 						sc.Forward(1);
+ 						sc.SetState(SCE_ERLANG_COMMENT_DOC_MACRO);
+ 					}
+ 				}
+ 				if (sc.atLineEnd)
+ 					toLateForComment = false;
+ 				setDefaultIf(&sc,IsNewline(sc.ch));
+ 			} break;
+ 			case SCE_ERLANG_COMMENT_DOC : {
+ 				if (sc.ch == ' ' || IsNewline(sc.ch)) {
+ 					sc.GetCurrent(cur, sizeof(cur));
+ 					if (erlangDoc.InList(cur)) {
+ 						sc.ChangeState(SCE_ERLANG_COMMENT_DOC);	
+ 					} else {
+ 						sc.ChangeState(oldstyle);	
+ 					}
+ 					sc.SetState(oldstyle);
+ 				}
+ 			}
+ 			case SCE_ERLANG_COMMENT_DOC_MACRO : {
+ 				if ((sc.ch == '}')) {
+ 					sc.GetCurrent(cur, sizeof(cur));
+ 					for(i=0; i < strlen(cur); i++) {
+ 						if(cur[i] == ' ')
+ 							break;
+ 						tmp[i] = cur[i];
+ 					}
+ 					tmp[i]='\0';
+ 					if (erlangDocMacro.InList(tmp)) {
+ 						sc.ChangeState(SCE_ERLANG_COMMENT_DOC_MACRO);	
+ 					} else {
+ 						sc.ChangeState(SCE_ERLANG_COMMENT);	
+ 					}
+ 					sc.SetState(SCE_ERLANG_COMMENT_DOC);
+ 					sc.Forward();
+ 					sc.SetState(oldstyle);
+ 				}
+ 				if (sc.atLineEnd)
+ 					toLateForComment = false;
+ 				setDefaultIf(&sc,IsNewline(sc.ch));
+ 			} break;
+ 			case SCE_ERLANG_NUMBER : setDefaultIf(&sc,!IsADigit(sc.ch)); break;
+ 			case SCE_ERLANG_VARIABLE : 
+ 			case SCE_ERLANG_RECORD : 
+ 			case SCE_ERLANG_MACRO : setDefaultIf(&sc,!IsAWordChar(sc.ch)); break;
+ 			case SCE_ERLANG_STRING : {
+ 				if (sc.ch == '\"') {
+ 					sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ 				} else if (sc.ch == '\\') {
+ 					sc.Forward();
+ 				}
+ 			} break;
+ 			case SCE_ERLANG_CHARACTER : {
+ 				if (readingChar || (sc.ch == '\'')) {
+ 					readingChar = false;
+ 					sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ 				}
+ 			} break;
+ 			case SCE_ERLANG_BIFS : {
+ 				if (!IsAWordChar(sc.ch)) {
+ 					sc.GetCurrent(cur, sizeof(cur));
+ 					sc.ChangeState(SCE_ERLANG_UNKNOWN);
+ 					sc.SetState(SCE_ERLANG_DEFAULT);
+ 				}
+ 			} break;
+ 			case SCE_ERLANG_PREPROC : {
+ 				if (!IsAWordChar(sc.ch)) {
+ 					if ((sc.ch == '(') || (sc.ch == ' ')) {
+ 						sc.GetCurrent(cur, sizeof(cur));
+ 						if (erlangPreproc.InList(cur)) {
+ 							style = SCE_ERLANG_PREPROC;
+ 						} else if (erlangModulesAtt.InList(cur)) {
+ 							style = SCE_ERLANG_MODULES_ATT;
+ 						}
+ 					}
+ 					
+ 					sc.ChangeState(style);
+ 					sc.SetState(SCE_ERLANG_DEFAULT);
+ 				}
+ 			} break;
+ 			case SCE_ERLANG_MODULES : {
+ 				if (!IsAWordChar(sc.ch)) {
+ 					if ((sc.ch == '(')||(sc.ch == '/')) {
+ 						sc.GetCurrent(cur, sizeof(cur));
+ 						char* t = strcat(tmp,cur);
+ 						style = (erlangBIFs.InList(t))
+ 							? SCE_ERLANG_BIFS
+ 							: SCE_ERLANG_MODULES_FUNCS;
+ 					}
+ 					
+ 					sc.ChangeState(style);
+ 					sc.SetState(SCE_ERLANG_DEFAULT);
+ 				}
+ 			} break;
+ 			case SCE_ERLANG_UNKNOWN : {
+ 				if (sc.ch == ':') {
+ 					if (sc.chNext == ' ') {
+ 						sc.ChangeState(SCE_ERLANG_UNKNOWN);
+ 					} else {
+ 						sc.Forward(1);
+ 						if (isalnum(sc.ch))  {
+ 							sc.GetCurrent(tmp, sizeof(tmp));
+ 							sc.ChangeState(SCE_ERLANG_MODULES);
+ 							sc.SetState(SCE_ERLANG_MODULES);
+ 						}
+ 					}
+ 				} else if (!IsAWordChar(sc.ch)) {
+ 					sc.GetCurrent(cur, sizeof(cur));
+ 					
+ 					if (reservedWords.InList(cur)) {
+ 						style = SCE_ERLANG_KEYWORD;
+ 					} else if (erlangBIFs.InList(cur) && strcmp(cur,"erlang:")){
+ 						style = SCE_ERLANG_BIFS;
+ 					} else if (sc.ch == '('){
+ 						style = SCE_ERLANG_FUNCTION_NAME;
+ 					}
+ 					
+ 					sc.ChangeState(style);
+ 					sc.SetState(SCE_ERLANG_DEFAULT);
+ 				}
+ 			} break;
+ 			case SCE_ERLANG_DEFAULT : 
+ 			default : break;
+ 		}
+ 		
+ 		//----------------------------------------------------------------
+ 		// New state?
+ 		if (sc.state == SCE_ERLANG_DEFAULT) {
+ 			noNewState = false;
+ 			
+ 			switch(sc.ch) {
+ 				case '%' : sc.SetState(SCE_ERLANG_COMMENT); break;
+ 				case '.' : {
+ 					if (IsADigit(sc.chNext)) {
+ 						sc.SetState(SCE_ERLANG_NUMBER);
+ 						if (sc.ch == '0' && (sc.chNext == 'X' || sc.chNext == 'x'))
+ 							sc.Forward(1);
+ 					}
+ 				} break;
+ 				case '_' : sc.SetState(SCE_ERLANG_VARIABLE); break;
+ 				case '#' : sc.SetState(SCE_ERLANG_RECORD); break;
+ 				case '?' : sc.SetState(SCE_ERLANG_MACRO); break;
+ 				case '\"' : sc.SetState(SCE_ERLANG_STRING); break;
+ 				case '$' : readingChar = true;
+ 				case '\'' : sc.SetState(SCE_ERLANG_CHARACTER); break;
+ 				case '-' : sc.SetState(SCE_ERLANG_PREPROC); break;
+ 				default : noNewState=true; break;
+ 			}
+ 			
+ 			if (noNewState) {
+ 				if (IsADigit(sc.ch)) {
+ 					sc.SetState(SCE_ERLANG_NUMBER);
+ 				} else if (isupper(sc.ch)) {
+ 					sc.SetState(SCE_ERLANG_VARIABLE);
+ 				} else if (IsAWordStart(sc.ch)) {
+ 					sc.SetState(SCE_ERLANG_UNKNOWN);
+ 				}
+ 			}
+ 		}
+ 	}
+ 	sc.Complete();
+ }
+ 
+ static const char * const erlangWordListDesc[] = {
+ 	"Erlang Reserved words",
+ 	"Erlang BIFs",
+ 	"Erlang Preprocessor",
+ 	"Erlang Module Attributes",
+ 	"Erlang Documentation",
+ 	"Erlang Documentation Macro",
+ 	0
+ };
+ 
+ LexerModule lmErlang(SCLEX_ERLANG, ColouriseErlangDoc, "erlang", 0, erlangWordListDesc);
+ 
diff -Ncr geany-src/scintilla/Makefile.am geany/scintilla/Makefile.am
*** geany-src/scintilla/Makefile.am	2009-07-16 23:40:08.000000000 +0200
--- geany/scintilla/Makefile.am	2009-07-17 00:19:08.000000000 +0200
***************
*** 16,21 ****
--- 16,22 ----
  LexCrontab.cxx \
  LexCSS.cxx \
  LexD.cxx \
+ LexErlang.cxx \
  LexFortran.cxx \
  LexHaskell.cxx \
  LexHTML.cxx \
diff -Ncr geany-src/scintilla/makefile.win32 geany/scintilla/makefile.win32
*** geany-src/scintilla/makefile.win32	2009-07-16 23:40:08.000000000 +0200
--- geany/scintilla/makefile.win32	2009-07-16 23:51:46.000000000 +0200
***************
*** 62,68 ****
  LEXOBJS=\
  LexAda.o LexBash.o LexAsm.o LexCSS.o LexCPP.o LexCrontab.o LexHTML.o LexOthers.o LexPascal.o \
  LexPerl.o LexPython.o LexSQL.o LexCaml.o LexTCL.o LexRuby.o LexFortran.o LexVHDL.o LexMatlab.o \
! LexD.o LexLua.o LexHaskell.o LexBasic.o LexR.o LexYAML.o LexCmake.o LexNsis.o
  #--Autogenerated -- end of automatically generated section
  
  all: $(COMPLIB)
--- 62,68 ----
  LEXOBJS=\
  LexAda.o LexBash.o LexAsm.o LexCSS.o LexCPP.o LexCrontab.o LexHTML.o LexOthers.o LexPascal.o \
  LexPerl.o LexPython.o LexSQL.o LexCaml.o LexTCL.o LexRuby.o LexFortran.o LexVHDL.o LexMatlab.o \
! LexD.o LexLua.o LexHaskell.o LexBasic.o LexR.o LexYAML.o LexCmake.o LexNsis.o LexErlang.o
  #--Autogenerated -- end of automatically generated section
  
  all: $(COMPLIB)
diff -Ncr geany-src/src/editor.c geany/src/editor.c
*** geany-src/src/editor.c	2009-07-16 23:40:42.000000000 +0200
--- geany/src/editor.c	2009-07-16 23:52:31.000000000 +0200
***************
*** 3349,3354 ****
--- 3349,3357 ----
  				style == SCE_ADA_STRING ||
  				style == SCE_ADA_CHARACTEREOL ||
  				style == SCE_ADA_STRINGEOL);
+ 		case SCLEX_ERLANG:
+ 			return (style == SCE_ERLANG_CHARACTER ||
+ 				style == SCE_ERLANG_STRING);
  	}
  	return FALSE;
  }
***************
*** 3474,3479 ****
--- 3477,3489 ----
  		case SCLEX_ADA:
  			return (style == SCE_ADA_COMMENTLINE ||
  				style == SCE_NSIS_COMMENTBOX);
+ 
+ 		case SCLEX_ERLANG:
+ 			return (style == SCE_ERLANG_COMMENT || 
+ 				style == SCE_ERLANG_COMMENT_DOC || 
+ 				style == SCE_ERLANG_COMMENT_DOC_MACRO || 
+ 				style == SCE_ERLANG_COMMENT_FUNCTION || 
+ 				style == SCE_ERLANG_COMMENT_MODULE);
  	}
  	return FALSE;
  }
diff -Ncr geany-src/src/filetypes.c geany/src/filetypes.c
*** geany-src/src/filetypes.c	2009-07-16 23:40:42.000000000 +0200
--- geany/src/filetypes.c	2009-07-16 23:53:03.000000000 +0200
***************
*** 577,582 ****
--- 577,593 ----
  	ft->comment_open = g_strdup("--");
  	ft->comment_close = NULL;
  	ft->group = GEANY_FILETYPE_GROUP_COMPILED;
+ 
+ #define ERLANG
+ 	ft = filetypes[GEANY_FILETYPES_ERLANG];
+ 	ft->lang = -2;
+ 	ft->name = g_strdup("Erlang");
+ 	ft->title = g_strdup_printf(_("%s source file"), "Erlang");
+ 	ft->extension = g_strdup("erl");
+ 	ft->pattern = utils_strv_new("*.erl", "*.hrl", NULL);
+ 	ft->comment_open = g_strdup("%%");
+ 	ft->comment_close = NULL;
+ 	ft->group = GEANY_FILETYPE_GROUP_COMPILED;
  }
  
  
diff -Ncr geany-src/src/filetypes.h geany/src/filetypes.h
*** geany-src/src/filetypes.h	2009-07-16 23:40:42.000000000 +0200
--- geany/src/filetypes.h	2009-07-16 23:53:21.000000000 +0200
***************
*** 76,82 ****
  	GEANY_FILETYPES_VHDL,
  	GEANY_FILETYPES_ADA,
  	GEANY_FILETYPES_CMAKE,
! 
  	/* ^ append items here */
  	GEANY_MAX_BUILT_IN_FILETYPES	/* Don't use this, use filetypes_array->len instead */
  }
--- 76,82 ----
  	GEANY_FILETYPES_VHDL,
  	GEANY_FILETYPES_ADA,
  	GEANY_FILETYPES_CMAKE,
! 	GEANY_FILETYPES_ERLANG,
  	/* ^ append items here */
  	GEANY_MAX_BUILT_IN_FILETYPES	/* Don't use this, use filetypes_array->len instead */
  }
diff -Ncr geany-src/src/highlighting.c geany/src/highlighting.c
*** geany-src/src/highlighting.c	2009-07-16 23:40:42.000000000 +0200
--- geany/src/highlighting.c	2009-07-17 00:01:33.000000000 +0200
***************
*** 2784,2789 ****
--- 2784,2934 ----
  	set_sci_style(sci, SCE_HA_DATA, GEANY_FILETYPES_HASKELL, 16);
  }
  
+ static void styleset_erlang_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
+ {
+ 	new_style_array(GEANY_FILETYPES_ERLANG, 21);
+ 
+ 	get_keyfile_hex(config, config_home, "default", 0x000000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[0]);
+ 
+ 	get_keyfile_hex(config, config_home, "comment", 0x808080, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[1]);
+ 	get_keyfile_hex(config, config_home, "commentFunction", 0x808080, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[2]);
+ 	get_keyfile_hex(config, config_home, "commentModule", 0x808080, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[3]);
+ 	get_keyfile_hex(config, config_home, "commentDoc", 0x808080, 0xffffff, TRUE, &style_sets[GEANY_FILETYPES_ERLANG].styling[4]);
+ 	get_keyfile_hex(config, config_home, "commentDocMacro", 0x808080, 0xffffff, TRUE, &style_sets[GEANY_FILETYPES_ERLANG].styling[5]);
+ 	
+ 	get_keyfile_hex(config, config_home, "variable", 0x7f0000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[6]);
+ 	get_keyfile_hex(config, config_home, "number", 0x007f00, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[7]);
+ 	get_keyfile_hex(config, config_home, "string", 0xff901e, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[8]);
+ 	get_keyfile_hex(config, config_home, "function_name", 0x00007f, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[9]);
+ 	get_keyfile_hex(config, config_home, "character", 0xff901e, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[10]);
+ 	get_keyfile_hex(config, config_home, "macro", 0xba00ab, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[11]);
+ 	get_keyfile_hex(config, config_home, "record", 0x635b00, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[12]);
+ 	get_keyfile_hex(config, config_home, "node_name", 0x000000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[13]);
+ 	
+ 	get_keyfile_hex(config, config_home, "reservedWords", 0x00007f, 0xffffff, TRUE, &style_sets[GEANY_FILETYPES_ERLANG].styling[14]);	
+ 	get_keyfile_hex(config, config_home, "bifs", 0x0000FF, 0xffffff, TRUE, &style_sets[GEANY_FILETYPES_ERLANG].styling[15]);
+ 	get_keyfile_hex(config, config_home, "modules", 0x00CCCC, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[16]);
+ 	get_keyfile_hex(config, config_home, "modulesAtt", 0x007d7d, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[17]);
+ 	get_keyfile_hex(config, config_home, "modulesFuncs", 0x007d7d, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[18]);
+ 	get_keyfile_hex(config, config_home, "preProc", 0x007d7d, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[19]);
+ 	
+ 	get_keyfile_hex(config, config_home, "unknown", 0x000000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_ERLANG].styling[20]);
+ 
+ 	style_sets[GEANY_FILETYPES_ERLANG].keywords = g_new(gchar*, 7);
+ 	get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_ERLANG, 0,
+ 			"after and andalso \
+ 			band begin bnot bor bsl bsr bxor \
+ 			case  catch cond \
+ 			div \
+ 			end \
+ 			fun \
+ 			if \
+ 			let \
+ 			not \
+ 			of or orelse \
+ 			query \
+ 			receive rem \
+ 			try \
+ 			when \
+ 			xor");
+ 
+ 	get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_ERLANG, 1, 
+ 			"erlang: abs adler32 adler32_combine erlang:append_element apply atom_to_binary atom_to_list \
+ 			binary_to_atom binary_to_existing_atom binary_to_list bitstring_to_list binary_to_term bit_size erlang:bump_reductions byte_size \
+ 			erlang:cancel_timer check_process_code concat_binary crc32 crc32_combine \
+ 			date decode_packet delete_module erlang:demonitor disconnect_node erlang:display \
+ 			element erase erlang:error exit \
+ 			float float_to_list erlang:fun_info erlang:fun_to_list erlang:function_exported \
+ 			garbage_collect get erlang:get_cookie get_keys erlang:get_stacktrace group_leader \
+ 			halt erlang:hash hd erlang:hibernate \
+ 			integer_to_list erlang:integer_to_list iolist_to_binary iolist_size is_alive is_atom is_binary is_bitstring is_boolean erlang:is_builtin is_float is_function is_integer is_list is_number is_pid is_port is_process_alive is_record is_reference is_tuple \
+ 			length link list_to_atom list_to_binary list_to_bitstring list_to_existing_atom list_to_float list_to_integer erlang:list_to_integer list_to_pid list_to_tuple load_module erlang:loaded erlang:localtime erlang:localtime_to_universaltime \
+ 			make_ref erlang:make_tuple erlang:max erlang:md5 erlang:md5_final erlang:md5_init erlang:md5_update erlang:memory erlang:min module_loaded erlang:monitor monitor_node \
+ 			node nodes now \
+ 			open_port \
+ 			erlang:phash erlang:phash2 pid_to_list port_close port_command port_connect port_control erlang:port_call erlang:port_info erlang:port_to_list erlang:ports pre_loaded erlang:process_display process_flag process_info processes purge_module put \
+ 			erlang:raise erlang:read_timer erlang:ref_to_list register registered erlang:resume_process round \
+ 			self erlang:send erlang:send_after erlang:send_nosuspend erlang:set_cookie setelement size spawn spawn_link spawn_monitor spawn_opt split_binary erlang:start_timer statistics erlang:suspend_process erlang:system_flag erlang:system_info erlang:system_monitor erlang:system_profile \
+ 			term_to_binary throw time tl erlang:trace erlang:trace_delivered erlang:trace_info erlang:trace_pattern trunc tuple_size tuple_to_list \
+ 			erlang:universaltime erlang:universaltime_to_localtime unlink unregister \
+ 			whereis \
+ 			erlang:yield");
+ 	get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_ERLANG, 2,
+ 			"-define \
+ 			-else -endif \
+ 			-ifdef -ifndef -include -include_lib \
+ 			-undef");
+ 	get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_ERLANG, 3,
+ 			"-behavior -behaviour \
+ 			-compile -created -created_by \
+ 			-export \
+ 			-file \
+ 			-import \
+ 			-module -modified -modified_by \
+ 			-record -revision \
+ 			-spec \
+ 			-type \
+ 			-vsn");
+ 	get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_ERLANG, 4,
+ 			"@author \
+ 			@clear @copyright \
+ 			@deprecated @doc @docfile \
+ 			@end @equiv \
+ 			@headerfile @hidden \
+ 			@private \
+ 			@reference \
+ 			@see @since @spec \
+ 			@throws @title @todo @TODO @type \
+ 			@version");
+ 	get_keyfile_keywords(config, config_home, "keywords", GEANY_FILETYPES_ERLANG, 5,
+ 			"@date @docRoot \
+ 			@link \
+ 			@module \
+ 			@package \
+ 			@section \
+ 			@time @type \
+ 			@version");
+ 	style_sets[GEANY_FILETYPES_ERLANG].keywords[6] = NULL;
+ 	get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_ERLANG].wordchars);
+ }
+ 
+ 
+ static void styleset_erlang(ScintillaObject *sci)
+ {
+ 	const filetype_id ft_id = GEANY_FILETYPES_ERLANG;
+ 
+ 	apply_filetype_properties(sci, SCLEX_ERLANG, ft_id);
+ 
+ 	SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_ERLANG].keywords[0]);
+ 	SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_ERLANG].keywords[1]);
+ 	SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_ERLANG].keywords[2]);
+ 	SSM(sci, SCI_SETKEYWORDS, 3, (sptr_t) style_sets[GEANY_FILETYPES_ERLANG].keywords[3]);
+ 	SSM(sci, SCI_SETKEYWORDS, 4, (sptr_t) style_sets[GEANY_FILETYPES_ERLANG].keywords[4]);
+ 	SSM(sci, SCI_SETKEYWORDS, 5, (sptr_t) style_sets[GEANY_FILETYPES_ERLANG].keywords[5]);
+ 
+ 	set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_ERLANG, 0);
+ 	set_sci_style(sci, SCE_ERLANG_DEFAULT, GEANY_FILETYPES_ERLANG, 0);
+ 	set_sci_style(sci, SCE_ERLANG_COMMENT, GEANY_FILETYPES_ERLANG, 1);
+ 	set_sci_style(sci, SCE_ERLANG_COMMENT_FUNCTION, GEANY_FILETYPES_ERLANG, 2);
+ 	set_sci_style(sci, SCE_ERLANG_COMMENT_MODULE, GEANY_FILETYPES_ERLANG, 3);
+ 	set_sci_style(sci, SCE_ERLANG_COMMENT_DOC, GEANY_FILETYPES_ERLANG, 4);
+ 	set_sci_style(sci, SCE_ERLANG_COMMENT_DOC_MACRO, GEANY_FILETYPES_ERLANG, 5);
+ 	set_sci_style(sci, SCE_ERLANG_VARIABLE, GEANY_FILETYPES_ERLANG, 6);
+ 	set_sci_style(sci, SCE_ERLANG_NUMBER, GEANY_FILETYPES_ERLANG, 7);
+ 	set_sci_style(sci, SCE_ERLANG_STRING, GEANY_FILETYPES_ERLANG, 8);
+ 	set_sci_style(sci, SCE_ERLANG_FUNCTION_NAME, GEANY_FILETYPES_ERLANG, 9);
+ 	set_sci_style(sci, SCE_ERLANG_CHARACTER, GEANY_FILETYPES_ERLANG, 10);
+ 	set_sci_style(sci, SCE_ERLANG_MACRO, GEANY_FILETYPES_ERLANG, 11);
+ 	set_sci_style(sci, SCE_ERLANG_RECORD, GEANY_FILETYPES_ERLANG, 12);
+ 	set_sci_style(sci, SCE_ERLANG_NODE_NAME, GEANY_FILETYPES_ERLANG, 13);
+ 	set_sci_style(sci, SCE_ERLANG_KEYWORD, GEANY_FILETYPES_ERLANG, 14);
+ 	set_sci_style(sci, SCE_ERLANG_BIFS, GEANY_FILETYPES_ERLANG, 15);
+ 	set_sci_style(sci, SCE_ERLANG_MODULES, GEANY_FILETYPES_ERLANG, 16);
+ 	set_sci_style(sci, SCE_ERLANG_MODULES_ATT, GEANY_FILETYPES_ERLANG, 17);
+ 	set_sci_style(sci, SCE_ERLANG_MODULES_FUNCS, GEANY_FILETYPES_ERLANG, 18);
+ 	set_sci_style(sci, SCE_ERLANG_PREPROC, GEANY_FILETYPES_ERLANG, 19);	
+ 	set_sci_style(sci, SCE_ERLANG_UNKNOWN, GEANY_FILETYPES_ERLANG, 20);
+ }
  
  static void styleset_caml_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
  {
***************
*** 3614,3619 ****
--- 3759,3765 ----
  		init_styleset_case(GEANY_FILETYPES_VHDL,	vhdl);
  		init_styleset_case(GEANY_FILETYPES_XML,		markup);
  		init_styleset_case(GEANY_FILETYPES_YAML,	yaml);
+ 		init_styleset_case(GEANY_FILETYPES_ERLANG,	erlang);
  	}
  }
  
***************
*** 3676,3681 ****
--- 3822,3828 ----
  		styleset_case(GEANY_FILETYPES_VHDL,		vhdl);
  		styleset_case(GEANY_FILETYPES_XML,		xml);
  		styleset_case(GEANY_FILETYPES_YAML,		yaml);
+ 		styleset_case(GEANY_FILETYPES_ERLANG,	erlang);
  		default:
  		styleset_case(GEANY_FILETYPES_NONE,		none);
  	}