Index: functions.c
===================================================================
--- functions.c	(revision 2c48db84fb5806ea05fb81c7864cde21d29aa715)
+++ functions.c	(revision 129e60962226d924d19aa15f7f74b866733b8e47)
@@ -2249,18 +2249,14 @@
 void owl_function_show_filters(void)
 {
-  const owl_list *l;
   const owl_filter *f;
-  int i, j;
+  GList *fl;
   owl_fmtext fm;
 
   owl_fmtext_init_null(&fm);
 
-  l=owl_global_get_filterlist(&g);
-  j=owl_list_get_size(l);
-
   owl_fmtext_append_bold(&fm, "Filters:\n");
 
-  for (i=0; i<j; i++) {
-    f=owl_list_get_element(l, i);
+  for (fl = g.filterlist; fl; fl = g_list_next(fl)) {
+    f = fl->data;
     owl_fmtext_append_normal(&fm, "   ");
     if (owl_global_get_hascolors(&g)) {
Index: global.c
===================================================================
--- global.c	(revision 6fc40a789c812bcdaacbe64f88178bb1409d1071)
+++ global.c	(revision 129e60962226d924d19aa15f7f74b866733b8e47)
@@ -50,5 +50,6 @@
   owl_keys_setup_keymaps(&g->kh);
 
-  owl_list_create(&(g->filterlist));
+  owl_dict_create(&(g->filters));
+  g->filterlist = NULL;
   owl_list_create(&(g->puntlist));
   owl_list_create(&(g->messagequeue));
@@ -604,40 +605,36 @@
 
 /* filterlist */
-
-owl_list *owl_global_get_filterlist(owl_global *g) {
-  return(&(g->filterlist));
-}
+typedef struct _owl_global_filter_ent {         /* noproto */
+  owl_global *g;
+  owl_filter *f;
+} owl_global_filter_ent;
 
 owl_filter *owl_global_get_filter(const owl_global *g, const char *name) {
-  int i, j;
-  owl_filter *f;
-
-  j=owl_list_get_size(&(g->filterlist));
-  for (i=0; i<j; i++) {
-    f=owl_list_get_element(&(g->filterlist), i);
-    if (!strcmp(name, owl_filter_get_name(f))) {
-      return(f);
-    }
-  }
-  return(NULL);
+  owl_global_filter_ent *e = owl_dict_find_element(&(g->filters), name);
+  if (e) return e->f;
+  return NULL;
+}
+
+static void owl_global_free_filter_ent(void *data) {
+  owl_global_filter_ent *e = data;
+  e->g->filterlist = g_list_remove(e->g->filterlist, e->f);
+  owl_filter_delete(e->f);
+  owl_free(e);
 }
 
 void owl_global_add_filter(owl_global *g, owl_filter *f) {
-  owl_list_append_element(&(g->filterlist), f);
+  owl_global_filter_ent *e = owl_malloc(sizeof *e);
+  e->g = g;
+  e->f = f;
+
+  owl_dict_insert_element(&(g->filters), owl_filter_get_name(f),
+                          e, owl_global_free_filter_ent);
+  g->filterlist = g_list_append(g->filterlist, f);
 }
 
 void owl_global_remove_filter(owl_global *g, const char *name) {
-  int i, j;
-  owl_filter *f;
-
-  j=owl_list_get_size(&(g->filterlist));
-  for (i=0; i<j; i++) {
-    f=owl_list_get_element(&(g->filterlist), i);
-    if (!strcmp(name, owl_filter_get_name(f))) {
-      owl_filter_delete(f);
-      owl_list_remove_element(&(g->filterlist), i);
-      break;
-    }
-  }
+  owl_global_filter_ent *e = owl_dict_remove_element(&(g->filters), name);
+  if (e)
+    owl_global_free_filter_ent(e);
 }
 
Index: mainwin.c
===================================================================
--- mainwin.c	(revision f63a68156a4aac1c6a5146c331ac1859cc70c9bf)
+++ mainwin.c	(revision 129e60962226d924d19aa15f7f74b866733b8e47)
@@ -10,10 +10,10 @@
 {
   owl_message *m;
-  int i, p, q, lines, isfull, viewsize;
+  int i, lines, isfull, viewsize;
   int x, y, savey, recwinlines, start;
   int topmsg, curmsg, markedmsgid, fgcolor, bgcolor;
   WINDOW *recwin;
   const owl_view *v;
-  const owl_list *filtlist;
+  GList *fl;
   const owl_filter *f;
 
@@ -73,8 +73,6 @@
     fgcolor=OWL_COLOR_DEFAULT;
     bgcolor=OWL_COLOR_DEFAULT;
-    filtlist=owl_global_get_filterlist(&g);
-    q=owl_list_get_size(filtlist);
-    for (p=0; p<q; p++) {
-      f=owl_list_get_element(filtlist, p);
+    for (fl = g.filterlist; fl; fl = g_list_next(fl)) {
+      f = fl->data;
       if ((owl_filter_get_fgcolor(f)!=OWL_COLOR_DEFAULT) ||
           (owl_filter_get_bgcolor(f)!=OWL_COLOR_DEFAULT)) {
Index: owl.c
===================================================================
--- owl.c	(revision 6c812238bb0807fdc7b9d1f2feded908ff509286)
+++ owl.c	(revision 129e60962226d924d19aa15f7f74b866733b8e47)
@@ -176,7 +176,6 @@
 
   for (i = 0; filters[i].name != NULL; i++)
-    owl_list_append_element(owl_global_get_filterlist(&g),
-			    owl_filter_new_fromstring(filters[i].name,
-						      filters[i].desc));
+    owl_global_add_filter(&g, owl_filter_new_fromstring(filters[i].name,
+                                                        filters[i].desc));
 }
 
Index: owl.h
===================================================================
--- owl.h	(revision 8df704f223d93cca5a442bf8b462fdaabd069c05)
+++ owl.h	(revision 129e60962226d924d19aa15f7f74b866733b8e47)
@@ -539,5 +539,6 @@
   owl_history msghist;		/* outgoing message history */
   owl_keyhandler kh;
-  owl_list filterlist;
+  owl_dict filters;
+  GList *filterlist;
   owl_list puntlist;
   owl_vardict vars;
Index: perlglue.xs
===================================================================
--- perlglue.xs	(revision ffc4df61a846d99a75783f7d348fb98dd19910aa)
+++ perlglue.xs	(revision 129e60962226d924d19aa15f7f74b866733b8e47)
@@ -326,10 +326,12 @@
 all_filters()
 	PREINIT:
-		const owl_list *fl;
-	CODE:
-	{
-		fl = owl_global_get_filterlist(&g);
-		RETVAL = owl_new_av(fl, (SV*(*)(const void*))owl_filter_to_sv);
+		owl_list fl;
+	CODE:
+	{
+		owl_list_create(&fl);
+		owl_dict_get_keys(&g.filters, &fl);
+		RETVAL = owl_new_av(&fl, (SV*(*)(const void*))owl_new_sv);
 		sv_2mortal((SV*)RETVAL);
+		owl_list_free_all(&fl, owl_free);
 	}
 	OUTPUT:
