From 3e6b304c7764abe86166a7ba4cc1ee10abfa7e68 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Wed, 2 Dec 2009 16:38:20 +0000 Subject: [PATCH] Add/improve debug messages for custom filetypes. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4464 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 2 ++ src/filetypes.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 65e9c59f..edc708bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * doc/geany.txt, doc/geany.html: Warn about not using BOM for configuration files (confuses GKeyFile parser, at least on my system). + * src/filetypes.c: + Add/improve debug messages for custom filetypes. 2009-11-30 Frank Lanitz diff --git a/src/filetypes.c b/src/filetypes.c index 4842697c..27ec0ac1 100644 --- a/src/filetypes.c +++ b/src/filetypes.c @@ -695,13 +695,13 @@ static void add_custom_filetype(const gchar *filename) if (g_hash_table_lookup(filetypes_hash, fn)) return; - geany_debug("Adding filetype %s.", fn); ft = filetype_new(); ft->name = g_strdup(fn); filetype_make_title(ft, TITLE_FILE); ft->pattern = g_new0(gchar*, 1); ft->priv->custom = TRUE; filetype_add(ft); + geany_debug("Added filetype %s (%d).", ft->name, ft->id); } @@ -1241,6 +1241,8 @@ static void load_settings(gint ft_id, GKeyFile *config, GKeyFile *configh) if (result) { ft->lang = tm_source_file_get_named_lang(result); + if (ft->lang < 0) + geany_debug("Cannot find tag parser '%s' for custom filetype '%s'.", result, ft->name); g_free(result); } @@ -1250,6 +1252,8 @@ static void load_settings(gint ft_id, GKeyFile *config, GKeyFile *configh) if (result) { ft->lexer_filetype = filetypes_lookup_by_name(result); + if (!ft->lexer_filetype) + geany_debug("Cannot find lexer filetype '%s' for custom filetype '%s'.", result, ft->name); g_free(result); }