Revision: 2993
http://geany.svn.sourceforge.net/geany/?rev=2993&view=rev
Author: ntrel
Date: 2008-09-25 11:17:08 +0000 (Thu, 25 Sep 2008)
Log Message:
-----------
Fix copyright notices; use /usr/bin/env perl.
Modified Paths:
--------------
trunk/scripts/changelist.pl
trunk/scripts/svn-changes.sh
Modified: trunk/scripts/changelist.pl
===================================================================
--- trunk/scripts/changelist.pl 2008-09-25 10:30:46 UTC (rev 2992)
+++ trunk/scripts/changelist.pl 2008-09-25 11:17:08 UTC (rev 2993)
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
-# Author: Nick Treleaven
-# License: GNU GPL V2 or later
+#!/usr/bin/env perl
+# Copyright: 2008, Nick Treleaven
+# License: GNU GPL V2 or later
+# Warranty: NONE
# Searches a ChangeLog file for a line matching 'matchstring', then matches
# all lines until two consecutive empty lines are found. The process then
@@ -9,6 +10,7 @@
# are usually written in reverse date order).
use strict;
+use warnings;
my $scriptname = "changelist.pl";
my $argc = $#ARGV + 1;
Modified: trunk/scripts/svn-changes.sh
===================================================================
--- trunk/scripts/svn-changes.sh 2008-09-25 10:30:46 UTC (rev 2992)
+++ trunk/scripts/svn-changes.sh 2008-09-25 11:17:08 UTC (rev 2993)
@@ -1,6 +1,7 @@
#!/bin/bash
-# Author: Nick Treleaven
-# License: GNU GPL V2 or later
+# Copyright: 2008, Nick Treleaven
+# License: GNU GPL V2 or later
+# Warranty: NONE
# Displays a summary of Subversion working copy changes in ChangeLog
# format, plus warnings about any unknown files.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2992
http://geany.svn.sourceforge.net/geany/?rev=2992&view=rev
Author: ntrel
Date: 2008-09-25 10:30:46 +0000 (Thu, 25 Sep 2008)
Log Message:
-----------
Hopefully fix building when HAVE_REGCOMP is not defined.
Add debug message when trying to parse an error regex when
HAVE_REGCOMP is undefined.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/filetypes.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-09-24 12:07:22 UTC (rev 2991)
+++ trunk/ChangeLog 2008-09-25 10:30:46 UTC (rev 2992)
@@ -1,3 +1,11 @@
+2008-09-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/filetypes.c:
+ Hopefully fix building when HAVE_REGCOMP is not defined.
+ Add debug message when trying to parse an error regex when
+ HAVE_REGCOMP is undefined.
+
+
2008-09-24 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/main.h, src/about.c, src/main.c, src/socket.c:
Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c 2008-09-24 12:07:22 UTC (rev 2991)
+++ trunk/src/filetypes.c 2008-09-25 10:30:46 UTC (rev 2992)
@@ -55,8 +55,10 @@
{
GtkWidget *menu_item; /* holds a pointer to the menu item for this filetype */
gboolean keyfile_loaded;
+#ifdef HAVE_REGCOMP
regex_t error_regex;
gboolean error_regex_compiled;
+#endif
}
GeanyFiletypePrivate;
@@ -852,11 +854,13 @@
{
setptr(ft->error_regex_string, string);
+#ifdef HAVE_REGCOMP
if (ft->priv->error_regex_compiled)
regfree(&ft->priv->error_regex);
ft->priv->error_regex_compiled = FALSE;
/* regex will be compiled when needed */
+#endif
}
@@ -1208,6 +1212,8 @@
gchar **filename, gint *line)
{
#ifndef HAVE_REGCOMP
+ if (!NZV(ft->error_regex_string))
+ geany_debug("No regex support - maybe you should configure with --enable-gnu-regex!");
return FALSE;
#else
regex_t *regex = &ft->priv->error_regex;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2989
http://geany.svn.sourceforge.net/geany/?rev=2989&view=rev
Author: ntrel
Date: 2008-09-24 11:23:02 +0000 (Wed, 24 Sep 2008)
Log Message:
-----------
Add 2 scripts from Daniel Richard G. to replace C++ line comments and to show a summary of gcc warnings.
Added Paths:
-----------
trunk/scripts/fix-cxx-comments.pl
trunk/scripts/warning-summary.pl
Added: trunk/scripts/fix-cxx-comments.pl
===================================================================
--- trunk/scripts/fix-cxx-comments.pl (rev 0)
+++ trunk/scripts/fix-cxx-comments.pl 2008-09-24 11:23:02 UTC (rev 2989)
@@ -0,0 +1,78 @@
+#!/usr/bin/env perl
+# fix-cxx-comments.pl
+# Copyright (c) 2008, Daniel Richard G. <skunk(at)iskunk(dot)org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of the author nor the names of
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use warnings;
+
+sub xform($$$)
+{
+ my ($a, $b, $c) = @_;
+
+ $a =~ s!///!/**!;
+ $b =~ s!(\a\s*)///!$1 **!g;
+ $c =~ s!///! **!;
+
+ $a =~ s!//!/*!;
+ $b =~ s!(\a\s*)//!$1 *!g;
+ $c =~ s!//! *!;
+
+ $c .= ' */';
+
+ return $a . $b . $c . "\a";
+}
+
+sub fix_cxx_comments()
+{
+ s/\r//g; # This is Unix, not DOS
+ s/[\t ]+$//g; # Remove trailing whitespace
+ s/\n/\a/g; # Convert file to single line
+
+ # Process multi-line comments:
+ # $1 = first line of comment, $3 = last line, $2 = lines in between
+ s! (\a\s*//[^\a]*) ((?:\a\s*//[^\a]*)*) (\a\s*//[^\a]*)\a !xform($1,$2,$3)!egx;
+
+ # Process /// single-line comments
+ s! (\a\s*)///(\s?)([^\a]*)\a !$1/**$2$3$2*/\a!gx;
+ s! (\s+)///(\s?)([^\a]*)\a !$1/**$2$3$2*/\a!gx;
+
+ # Process // single-line comments
+ s! (\a\s*)//(\s?)([^\a]*)\a !$1/*$2$3$2*/\a!gx;
+ s! (\s+)//(\s?)([^\a]*)\a !$1/*$2$3$2*/\a!gx;
+
+ s/\a/\n/g; # Convert back to multiple lines
+}
+
+{
+ local $/;
+ $_ = <>;
+ fix_cxx_comments();
+ print;
+}
+
Property changes on: trunk/scripts/fix-cxx-comments.pl
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/scripts/warning-summary.pl
===================================================================
--- trunk/scripts/warning-summary.pl (rev 0)
+++ trunk/scripts/warning-summary.pl 2008-09-24 11:23:02 UTC (rev 2989)
@@ -0,0 +1,78 @@
+#!/usr/bin/env perl
+# warning-summary.pl
+# Copyright (c) 2008, Daniel Richard G. <skunk(at)iskunk(dot)org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of the author nor the names of
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use warnings;
+
+use encoding 'utf8';
+
+binmode(STDIN, ":utf8");
+
+open(OUT, "| sort | uniq -c | sort -nr");
+binmode(OUT, ":utf8");
+
+while (<>)
+{
+ /warning:/ || next;
+ /near initialization for/ && next;
+ /shadowed declaration is here/ && next;
+ /\(this will be reported only once per input file\)/ && next;
+
+ s/^.*: warning: //g;
+
+ tr/\x{2018}\x{2019}/''/;
+
+ s/\barg(ument|) \d+\b/arg$1 N/g;
+
+ s/\b(type|function|variable|enumeration value|declaration of|argument N of|parameter|type of|type of bit-field|prototype for) '[^']+'/$1 'blah'/g;
+
+ s/"[^"]+" (is not defined)/"BLAH" $1/g;
+
+ s/'[^']+' (defined but not used)/'blah' $1/g;
+
+ s/format '%\w+'/format '%blah'/g;
+
+ s/'%\w+' printf format/'%blah' printf format/g;
+
+ s/'\d+'/'NNN'/g;
+
+ s/'[^']+' (declared 'static' but never defined)/'blah' $1/g;
+
+ s/(missing braces around initializer for) '\w+'/$1 'blah'/g;
+
+ s/(missing initializer for member) '\w+::\w+'/$1 'Foo::bar'/g;
+
+ print OUT;
+}
+
+close(OUT);
+
+# end warning-summary.pl
+
Property changes on: trunk/scripts/warning-summary.pl
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2987
http://geany.svn.sourceforge.net/geany/?rev=2987&view=rev
Author: ntrel
Date: 2008-09-23 15:19:46 +0000 (Tue, 23 Sep 2008)
Log Message:
-----------
Minor formatting edits.
Modified Paths:
--------------
trunk/src/encodings.c
Modified: trunk/src/encodings.c
===================================================================
--- trunk/src/encodings.c 2008-09-23 14:46:42 UTC (rev 2986)
+++ trunk/src/encodings.c 2008-09-23 15:19:46 UTC (rev 2987)
@@ -256,7 +256,7 @@
#ifdef HAVE_REGCOMP
-/* Regexp detection of file enconding declared in the file itself.
+/* Regexp detection of file encoding declared in the file itself.
* Idea and parts of code taken from Bluefish, thanks.
* regex_compile() is used to compile regular expressions on program init and keep it in memory
* for faster access when opening a file. Pre-compiled regexps will be freed on program exit.
@@ -291,7 +291,7 @@
retval = regexec(preg, (tmp_buf != NULL) ? tmp_buf : buffer, 10, pmatch, 0);
if (retval == 0 && pmatch[0].rm_so != -1 && pmatch[1].rm_so != -1)
{
- encoding = g_strndup(&buffer[pmatch[1].rm_so], pmatch[1].rm_eo-pmatch[1].rm_so);
+ encoding = g_strndup(&buffer[pmatch[1].rm_so], pmatch[1].rm_eo - pmatch[1].rm_so);
geany_debug("Detected encoding by regex search: %s", encoding);
setptr(encoding, g_utf8_strup(encoding, -1));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2986
http://geany.svn.sourceforge.net/geany/?rev=2986&view=rev
Author: ntrel
Date: 2008-09-23 14:46:42 +0000 (Tue, 23 Sep 2008)
Log Message:
-----------
Add svn-changes.sh script to print SVN working copy changes in ChangeLog format, and warn about unknown files.
Modified Paths:
--------------
trunk/scripts/changelist.pl
Added Paths:
-----------
trunk/scripts/svn-changes.sh
Modified: trunk/scripts/changelist.pl
===================================================================
--- trunk/scripts/changelist.pl 2008-09-23 11:37:20 UTC (rev 2985)
+++ trunk/scripts/changelist.pl 2008-09-23 14:46:42 UTC (rev 2986)
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
# Author: Nick Treleaven
-# License: GPL V2 or later
+# License: GNU GPL V2 or later
# Searches a ChangeLog file for a line matching 'matchstring', then matches
# all lines until two consecutive empty lines are found. The process then
Added: trunk/scripts/svn-changes.sh
===================================================================
--- trunk/scripts/svn-changes.sh (rev 0)
+++ trunk/scripts/svn-changes.sh 2008-09-23 14:46:42 UTC (rev 2986)
@@ -0,0 +1,48 @@
+#!/bin/bash
+# Author: Nick Treleaven
+# License: GNU GPL V2 or later
+
+# Displays a summary of Subversion working copy changes in ChangeLog
+# format, plus warnings about any unknown files.
+
+# -s for spaces instead of comma separation
+if [[ $1 == -s ]]; then
+ SPACES="set"
+ shift
+fi
+
+status=`svn st $*`
+
+# get list of files changed.
+# remove extraneous text, e.g. ? entries
+files=`echo "$status" |egrep '^[A-Z]'`
+# get filenames on one line
+files=`echo "$files" |egrep -o '[^A-Z].[ ]+(.+)' |xargs`
+# add commas if -s argument is not given
+if [[ -z $SPACES ]]; then
+ files=`echo "$files" |sed "s/ /, /g"`
+fi
+
+# show modifications
+if [[ -n $files ]]; then
+ echo 'Changes:'
+ if [[ -z $SPACES ]]; then
+ files+=':'
+ fi
+ # indent and wrap
+ OUTFILE=/tmp/fmt
+ echo -n ' '$files | fmt -w 72 >$OUTFILE
+ # put ' * ' for first line
+ cat $OUTFILE | sed '1s/ / * /'
+else
+ echo 'No changes.'
+fi
+
+# warn about anything that isn't a modification or addition
+warn=`echo "$status" |egrep '^[^MA]'`
+if [[ -n $warn ]]; then
+ echo 'Warnings:'
+ echo $warn
+else
+ echo 'No warnings.'
+fi
Property changes on: trunk/scripts/svn-changes.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2985
http://geany.svn.sourceforge.net/geany/?rev=2985&view=rev
Author: ntrel
Date: 2008-09-23 11:37:20 +0000 (Tue, 23 Sep 2008)
Log Message:
-----------
Remove ParseData::dir argument as it's not necessary for parsing;
instead, use function make_absolute().
Refactor msgwin_parse_compiler_error_line().
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/msgwindow.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-09-23 11:25:23 UTC (rev 2984)
+++ trunk/ChangeLog 2008-09-23 11:37:20 UTC (rev 2985)
@@ -4,6 +4,10 @@
Move adding a lexer notes to 'Syntax highlighting' section; mention
adding the LINK_LEXER command manually.
Some minor edits (reST section grouping).
+ * src/msgwindow.c:
+ Remove ParseData::dir argument as it's not necessary for parsing;
+ instead, use function make_absolute().
+ Refactor msgwin_parse_compiler_error_line().
2008-09-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/msgwindow.c
===================================================================
--- trunk/src/msgwindow.c 2008-09-23 11:25:23 UTC (rev 2984)
+++ trunk/src/msgwindow.c 2008-09-23 11:37:20 UTC (rev 2985)
@@ -53,12 +53,12 @@
typedef struct
{
const gchar *string; /* line data */
- const gchar *dir; /* working directory when string was generated */
const gchar *pattern; /* pattern to split the error message into some fields */
guint min_fields; /* used to detect errors after parsing */
guint line_idx; /* idx of the field where the line is */
gint file_idx; /* idx of the field where the filename is or -1 */
-} ParseData;
+}
+ParseData;
MessageWindow msgwindow;
@@ -615,6 +615,25 @@
}
+static void make_absolute(gchar **filename, const gchar *dir)
+{
+ guint skip_dot_slash = 0; /* number of characters to skip at the beginning of the filename */
+
+ if (*filename == NULL)
+ return;
+
+ /* skip some characters at the beginning of the filename, at the moment only "./"
+ * can be extended if other "trash" is known */
+ if (strncmp(*filename, "./", 2) == 0)
+ skip_dot_slash = 2;
+
+ /* add directory */
+ if (! utils_is_absolute_path(*filename))
+ setptr(*filename, g_strconcat(dir, G_DIR_SEPARATOR_S,
+ *filename + skip_dot_slash, NULL));
+}
+
+
/* try to parse the file and line number where the error occured described in line
* and when something useful is found, it stores the line number in *line and the
* relevant file with the error in *filename.
@@ -624,12 +643,11 @@
{
gchar *end = NULL;
gchar **fields;
- guint skip_dot_slash = 0; /* number of characters to skip at the beginning of the filename */
*filename = NULL;
*line = -1;
- g_return_if_fail(data->dir != NULL && data->string != NULL);
+ g_return_if_fail(data->string != NULL);
fields = g_strsplit_set(data->string, data->pattern, data->min_fields);
@@ -660,42 +678,18 @@
return;
}
- /* skip some characters at the beginning of the filename, at the moment only "./"
- * can be extended if other "trash" is known */
- if (strncmp(fields[data->file_idx], "./", 2) == 0) skip_dot_slash = 2;
-
- /* get the build directory to get the path to look for other files */
- if (! utils_is_absolute_path(fields[data->file_idx]))
- *filename = g_strconcat(data->dir, G_DIR_SEPARATOR_S,
- fields[data->file_idx] + skip_dot_slash, NULL);
- else
- *filename = g_strdup(fields[data->file_idx]);
-
+ *filename = g_strdup(fields[data->file_idx]);
g_strfreev(fields);
}
-/* try to parse the file and line number where the error occured described in string
- * and when something useful is found, it stores the line number in *line and the
- * relevant file with the error in *filename.
- * *line will be -1 if no error was found in string.
- * *filename must be freed unless it is NULL. */
-void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir, gchar **filename, gint *line)
+void parse_compiler_error_line(const gchar *string,
+ gchar **filename, gint *line)
{
- ParseData data = {NULL, NULL, NULL, 0, 0, 0};
+ ParseData data = {NULL, NULL, 0, 0, 0};
data.string = string;
- data.dir = build_info.dir;
- *filename = NULL;
- *line = -1;
-
- if (dir != NULL)
- data.dir = dir;
-
- g_return_if_fail(build_info.dir != NULL || dir != NULL);
- if (string == NULL) return;
-
switch (build_info.file_type_id)
{
case GEANY_FILETYPES_PHP:
@@ -852,6 +846,29 @@
}
+/* try to parse the file and line number where the error occured described in string
+ * and when something useful is found, it stores the line number in *line and the
+ * relevant file with the error in *filename.
+ * *line will be -1 if no error was found in string.
+ * *filename must be freed unless it is NULL. */
+void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir,
+ gchar **filename, gint *line)
+{
+ *filename = NULL;
+ *line = -1;
+
+ if (string == NULL)
+ return;
+
+ if (dir == NULL)
+ dir = build_info.dir;
+ g_return_if_fail(dir != NULL);
+
+ parse_compiler_error_line(string, filename, line);
+ make_absolute(filename, dir);
+}
+
+
gboolean msgwin_goto_messages_file_line()
{
GtkTreeIter iter;
@@ -904,17 +921,18 @@
*filename = NULL;
*line = -1;
- if (string == NULL || msgwindow.find_in_files_dir == NULL) return;
+ if (string == NULL || msgwindow.find_in_files_dir == NULL)
+ return;
/* conflict:3:conflicting types for `foo' */
data.string = string;
- data.dir = msgwindow.find_in_files_dir;
data.pattern = ":";
data.min_fields = 3;
data.line_idx = 1;
data.file_idx = 0;
parse_file_line(&data, filename, line);
+ make_absolute(filename, msgwindow.find_in_files_dir);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2984
http://geany.svn.sourceforge.net/geany/?rev=2984&view=rev
Author: ntrel
Date: 2008-09-23 11:25:23 +0000 (Tue, 23 Sep 2008)
Log Message:
-----------
Move adding a lexer notes to 'Syntax highlighting' section; mention
adding the LINK_LEXER command manually.
Some minor edits (reST section grouping).
Modified Paths:
--------------
trunk/ChangeLog
trunk/HACKING
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-09-22 15:29:25 UTC (rev 2983)
+++ trunk/ChangeLog 2008-09-23 11:25:23 UTC (rev 2984)
@@ -1,3 +1,11 @@
+2008-09-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * HACKING:
+ Move adding a lexer notes to 'Syntax highlighting' section; mention
+ adding the LINK_LEXER command manually.
+ Some minor edits (reST section grouping).
+
+
2008-09-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/editor.c, src/ui_utils.c:
Modified: trunk/HACKING
===================================================================
--- trunk/HACKING 2008-09-22 15:29:25 UTC (rev 2983)
+++ trunk/HACKING 2008-09-23 11:25:23 UTC (rev 2984)
@@ -2,7 +2,7 @@
---------------
This file contains information for anyone wanting to work on the Geany
codebase. You should be aware of the open source licenses used - see
-the README file or the documentation.
+the README file or the documentation. It is pseudo-reStructuredText.
Writing plugins
---------------
@@ -154,8 +154,8 @@
printf("Prefix: " GEANY_PREFIX); but instead use
printf("Prefix: %s", GEANY_PREFIX);
-Adding a file foo.[hc] in src/ or plugins/
-------------------------------------------
+Adding a source file foo.[hc] in src/ or plugins/
+-------------------------------------------------
Add foo.c, foo.h to SRCS in path/Makefile.am.
Add foo.o to OBJS in path/makefile.win32.
Add path/foo.c to po/POTFILES.in (for string translation).
@@ -165,14 +165,6 @@
You can add a filetype without syntax highlighting or tag parsing, but
check to see if those features have been written in other projects first.
-For syntax highlighting, it may be possible to use an existing Scintilla
-lexer in the scintilla/ subdirectory - if not, you will need to find
-(or write) one, LexFoo.cxx. Try the Scintilla project first. Remember
-to update scintilla/Makefile.am and scintilla/makefile.win32.
-
-For tag parsing (e.g. for the symbol list), see 'Adding a TagManager
-parser' below.
-
Add GEANY_FILETYPES_FOO to filetypes.h.
Initialize GEANY_FILETYPES_FOO in init_builtin_filetypes() of
filetypes.c.
@@ -203,8 +195,17 @@
Syntax highlighting
^^^^^^^^^^^^^^^^^^^
+It may be possible to use an existing Scintilla lexer in the scintilla/
+subdirectory - if not, you will need to find (or write) one,
+LexFoo.cxx. Try the Scintilla project first. When adding a lexer, update:
+
+ * scintilla/Makefile.am
+ * scintilla/makefile.win32
+ * scintilla/KeyWords.cxx - add a LINK_LEXER command *manually*
+
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. You should probably
start by copying and adapting another filetype's initialization, such
@@ -232,9 +233,8 @@
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 filetype for Geany already exists.
First write or find a CTags compatible parser, foo.c. Note that there
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.