SF.net SVN: geany: [495] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Tue Jun 27 15:31:40 UTC 2006


Revision: 495
Author:   eht16
Date:     2006-06-27 08:31:32 -0700 (Tue, 27 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/geany/?rev=495&view=rev

Log Message:
-----------
Add support for parsing compiler output for LaTeX with latex's --file-line-error-style command line argument.
Removed unneeded function utils_free_ptr_array().

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/data/filetypes.latex
    trunk/src/utils.c
    trunk/src/utils.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-06-27 15:29:33 UTC (rev 494)
+++ trunk/ChangeLog	2006-06-27 15:31:32 UTC (rev 495)
@@ -2,6 +2,10 @@
 
  * data/filetypes.php, data/filetypes.pascal, src/callbacks.c,
    src/build.c: Parse stdout of compiler output too.
+ * src/utils.c, data/filetypes.latex:
+   Add support for parsing compiler output for LaTeX with latex's
+   --file-line-error-style command line argument.
+   Removed unneeded function utils_free_ptr_array().
 
 
 2006-06-27  Nick Treleaven  <nick.treleaven at btinternet.com>

Modified: trunk/data/filetypes.latex
===================================================================
--- trunk/data/filetypes.latex	2006-06-27 15:29:33 UTC (rev 494)
+++ trunk/data/filetypes.latex	2006-06-27 15:31:32 UTC (rev 495)
@@ -32,8 +32,8 @@
 # %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=latex "%f"
+compiler=latex --file-line-error-style "%f"
 # it is called linker, but here it is an alternative compiler command
-linker=pdflatex "%f"
+linker=pdflatex --file-line-error-style "%f"
 run_cmd=xdvi "%f"
 run_cmd2=xpdf "%f"

Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c	2006-06-27 15:29:33 UTC (rev 494)
+++ trunk/src/utils.c	2006-06-27 15:31:32 UTC (rev 495)
@@ -385,7 +385,8 @@
 {
 	static GList *tag_names = NULL;
 
-	if (doc_list[idx].is_valid && doc_list[idx].tm_file && doc_list[idx].tm_file->tags_array)
+	if (idx >= 0 && doc_list[idx].is_valid && doc_list[idx].tm_file &&
+		doc_list[idx].tm_file->tags_array)
 	{
 		TMTag *tag;
 		guint i;
@@ -769,9 +770,7 @@
 			gtk_widget_set_sensitive(app->tagbar, FALSE);
 			gtk_container_add(GTK_CONTAINER(app->tagbar), app->default_tag_tree);
 		}
-
 	}
-
 }
 
 
@@ -1881,17 +1880,6 @@
 }
 
 
-void utils_free_ptr_array(gchar *array[], gint len)
-{
-	gint i;
-
-	for (i = 0; i < len; i++)
-	{
-		g_free(array[i]);
-	}
-}
-
-
 void utils_update_fold_items(void)
 {
 	gtk_widget_set_sensitive(lookup_widget(app->window, "menu_fold_all1"), app->pref_editor_folding);
@@ -2327,10 +2315,11 @@
 	gchar *end = NULL;
 	gchar *path;
 	gchar **fields;
-	gchar *pattern;			// pattern to split the error message into some fields
-	guint field_min_len;	// used to detect errors after parsing
-	guint field_idx_line;	// idx of the field where the line is
-	guint field_idx_file;	// idx of the field where the filename is
+	gchar *pattern;				// pattern to split the error message into some fields
+	guint field_min_len;		// used to detect errors after parsing
+	guint field_idx_line;		// idx of the field where the line is
+	guint field_idx_file;		// idx of the field where the filename is
+	guint skip_dot_slash = 0;	// number of characters to skip at the beginning of the filename
 	
 	*filename = NULL;
 	*line = -1;
@@ -2355,6 +2344,15 @@
 			field_idx_file = 0;
 			break;
 		}
+		case GEANY_FILETYPES_LATEX:
+		{
+			// ./kommtechnik_2b.tex:18: Emergency stop.
+			pattern = ":";
+			field_min_len = 3;
+			field_idx_line = 1;
+			field_idx_file = 0;
+			break;
+		}
 		case GEANY_FILETYPES_PHP:
 		{
 			// Parse error: parse error, unexpected T_CASE in brace_bug.php on line 3
@@ -2416,9 +2414,13 @@
 		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[field_idx_file], "./", 2) == 0) skip_dot_slash = 2;
+
 	// get the basename of the built file to get the path to look for other files
 	path = g_path_get_dirname(doc_list[app->cur_idx].file_name);
-	*filename = g_strconcat(path, G_DIR_SEPARATOR_S, fields[field_idx_file], NULL);
+	*filename = g_strconcat(path, G_DIR_SEPARATOR_S, fields[field_idx_file] + skip_dot_slash, NULL);
 	g_free(path);
 
 	g_strfreev(fields);

Modified: trunk/src/utils.h
===================================================================
--- trunk/src/utils.h	2006-06-27 15:29:33 UTC (rev 494)
+++ trunk/src/utils.h	2006-06-27 15:31:32 UTC (rev 495)
@@ -171,8 +171,6 @@
 
 void utils_update_toolbar_icons(GtkIconSize size);
 
-void utils_free_ptr_array(gchar *array[], gint len);
-
 void utils_update_recent_menu(void);
 
 gboolean utils_get_setting_boolean(GKeyFile *config, const gchar *section, const gchar *key, const gboolean default_value);


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