On Sun, 22 Mar 2009 17:30:23 +0000, Neil wrote: Hi,
>It would be very useful if geany could recognise debian/control and >other RFC2822 files, not only as a configuration file (which currently >does some highlighting but gets confused if a line does not include the this has just been improved in current SVN version. The highlighting is now more robust when styling RFC2822 text. It's not perfect but better than before. >: marker) but also if it could recognise stanzas as tags suitable for >the symbol browser. This would make it a lot easier to use geany to >update packaging information and similar, even in source packages that >generate a lot of binary packages. I don't feel like adding this to Geany directly as this is Debian-specific and we are trying to keep as distro-clean as we can. Anyway, attached is a small patch which adds parsing of the "Package" and "Source" keywords for Debian's control files. I leave it up to Damián to include this patch or some improved version into the Debian package. >This support could also be used with .changes files and similar, e.g.: > >$ dpkg-buildpackage >$ debc>1|geany 1|rm 1 I'd say it should be debc > 1.conf && geany 1.conf; rm 1.conf :) Regards, Enrico -- Get my GPG key from http://www.uvena.de/pub.asc
Index: tagmanager/conf.c
===================================================================
--- tagmanager/conf.c (revision 3669)
+++ tagmanager/conf.c (working copy)
@@ -14,6 +14,7 @@
#include "general.h" /* must always come first */
#include <ctype.h>
+#include <string.h>
#include "parse.h"
#include "read.h"
@@ -74,6 +75,20 @@ static void findConfTags (void)
continue;
}
+ /* look for a stanza */
+ if (*cp != '\0' && (strncmp((const char*) cp, "Source:", 7) == 0 ||
+ strncmp((const char*) cp, "Package:", 8) == 0))
+ {
+ cp = (const unsigned char*) strchr((const char*) cp, ':') + 1;
+ while (isspace ((int) *cp))
+ ++cp;
+ vStringCopyS (name, (const char*) cp);
+ vStringTerminate (name);
+ makeSimpleTag (name, ConfKinds, K_SECTION);
+ vStringClear (name);
+ continue;
+ }
+
while (*cp != '\0')
{
/* We look for any sequence of identifier characters following a white space */
pgpk9bVZgMT54.pgp
Description: PGP signature

