SF.net SVN: geany: [2586] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Wed May 14 16:44:34 UTC 2008
Revision: 2586
http://geany.svn.sourceforge.net/geany/?rev=2586&view=rev
Author: ntrel
Date: 2008-05-14 09:44:18 -0700 (Wed, 14 May 2008)
Log Message:
-----------
Update adding a filetype section, make clearer.
Modified Paths:
--------------
trunk/ChangeLog
trunk/HACKING
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-05-14 16:37:09 UTC (rev 2585)
+++ trunk/ChangeLog 2008-05-14 16:44:18 UTC (rev 2586)
@@ -33,6 +33,8 @@
* src/document.c:
Fix line breaking not getting reset for new documents sometimes.
Merge all document default settings into init_doc_struct().
+ * HACKING:
+ Update adding a filetype section, make clearer.
2008-05-13 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/HACKING
===================================================================
--- trunk/HACKING 2008-05-14 16:37:09 UTC (rev 2585)
+++ trunk/HACKING 2008-05-14 16:44:18 UTC (rev 2586)
@@ -174,7 +174,8 @@
parser' below.
Add GEANY_FILETYPES_FOO to filetypes.h.
-Initialize GEANY_FILETYPES_FOO in filetypes_init_types() of filetypes.c.
+Initialize GEANY_FILETYPES_FOO in init_builtin_filetypes() of
+filetypes.c.
Rebuild Geany.
From your geany/ directory, run:
src/geany --generate-data-files
@@ -186,28 +187,37 @@
--generate-data-files argument to work - this is always defined in the
SVN version. Alternatively, edit the file by hand.
+filetypes.* configuration file
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
All languages need a data/filetypes.foo configuration file. See
-data/filetypes.c for an example. For languages with a Scintilla lexer,
-there should be a [styling] section, to correspond to the styles used
-in styleset_foo().
+data/filetypes.c for an example.
Programming languages should have:
[keywords] if the lexer supports it.
[settings] mostly for comment settings.
[build_settings] for commands to run.
+For languages with a Scintilla lexer, there should be a [styling] section,
+to correspond to the styles used in styleset_foo() in highlighting.c -
+see below.
+
+Syntax highlighting
+^^^^^^^^^^^^^^^^^^^
For syntax highlighting, you will need to edit highlighting.c and add
the following things:
1. Write styleset_foo_init() to setup default styles and load style
-settings from the filetypes.foo configuration file. For details, see
-styleset_c_init().
+settings from the filetypes.foo configuration file. You should probably
+start by copying and adapting another filetype's initialization, such
+as styleset_asm_init().
2. Write styleset_foo() to apply styles when a new scintilla widget
-is created. For details, see styleset_c().
+is created. Again you could copy and adapt a function like styleset_asm().
3. Add this in highlighting_init_styles():
init_styleset_case(GEANY_FILETYPES_FOO, foo);
4. Add this in highlighting_set_styles():
styleset_case(GEANY_FILETYPES_FOO, foo);
+Other features
+^^^^^^^^^^^^^^
Error message parsing is done in msgwin_parse_compiler_error_line() of
msgwindow.c. See the ParseData typedef for more information. (In future
this may be done with a regex).
@@ -219,13 +229,13 @@
in editor.c. For now, this prevents calltips and autocompletion when
typing in a comment (but it can still be forced by the user).
-If the Scintilla lexer supports user type keywords (e.g. SCLEX_CPP),
-see editor_lexer_get_type_keyword_idx() in editor.c.
+If the Scintilla lexer supports user type keyword highlighting (e.g.
+SCLEX_CPP), update editor_lexer_get_type_keyword_idx() in editor.c.
Adding a TagManager parser
--------------------------
-This assumes the Geany filetype already exists.
+This assumes the filetype for Geany already exists.
First write or find a CTags compatible parser, foo.c. Note that there
are some language patches for CTags at:
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