Index: gedit/gedit-document-loader.c
===================================================================
--- gedit/gedit-document-loader.c	(revision 5608)
+++ gedit/gedit-document-loader.c	(working copy)
@@ -38,6 +38,7 @@
 #include <sys/mman.h>
 #include <string.h>
 #include <errno.h>
+#include <stdlib.h>
 
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
@@ -491,6 +492,12 @@
 	g_object_unref (loader);		       
 }
 
+static gboolean
+is_gzipped_file (gchar *uri)
+{
+	return (strncmp(&uri[strlen(uri) - 3], ".gz", 3) == 0 ? TRUE : FALSE);
+}
+
 /* ----------- local files ----------- */
 
 #define MAX_MIME_SNIFF_SIZE 4096
@@ -949,6 +956,22 @@
 	local_path = gnome_vfs_get_local_path_from_uri (uri);
 	if (local_path != NULL)
 	{
+		if (is_gzipped_file(local_path)) {
+				fprintf(stderr, "Possible gzipped file (%s) detected\n", local_path);
+				gchar* temp_file_name = tempnam("/tmp/", "gedit");
+
+				size_t buf_size = strlen(local_path) + strlen(temp_file_name) + 32;
+				gchar* cmd = g_malloc(buf_size);
+				snprintf(cmd, buf_size, "zcat %s > %s", local_path, temp_file_name);
+
+				if (system(cmd) == 0) {
+					chmod(temp_file_name, S_IRUSR);
+					g_free(local_path);
+					local_path = temp_file_name;
+				}
+				g_free(cmd);
+		}
+
 		load_local_file (loader, local_path);
 		g_free (local_path);
 	}
