Index: ChangeLog
===================================================================
--- ChangeLog	(revision 73624b445ce7ec3252a00b29ef2396a3c97e3700)
+++ ChangeLog	(revision ef56a6724cbce9cfe55d35d4b300df48c8c464c6)
@@ -12,4 +12,7 @@
 	New 'sepbar_disable' variable can turn off sepbar info
 	Updated contributor info
+	added the 'show view' command.
+	removed 'set style'
+	A style is now part of a view, the view command has been revamped
 
 2.0.4-pre-1
Index: commands.c
===================================================================
--- commands.c	(revision 0c502e9628cc58f86762f4588401e8c19a55a5e4)
+++ commands.c	(revision ef56a6724cbce9cfe55d35d4b300df48c8c464c6)
@@ -486,17 +486,21 @@
   OWLCMD_ARGS("view", owl_command_view, OWL_CTX_INTERACTIVE,
 	      "view messages matching a filter",
+	      "view [<viewname>] [-f <filter> | --home ] [-s <style>]\n"
 	      "view <filter>\n"
 	      "view -d <expression>\n"
 	      "view --home",
-	      "In the first usage, The view command sets the current view to\n"
-	      "the specified filter.   This causes only messages matching\n"
-	      "that filter to be displayed.\n"
+	      "The view command sets information associated with a particular view,\n"
+	      "such as view's filter or style.  In the first general usage listed\n"
+	      "above <viewname> is the name of the view to be changed.  If not\n"
+	      "specified the default view 'main' will be used.  A filter can be set\n"
+	      "for the view by listing a named filter after the -f argument.  If\n"
+	      "the --home argument is used the filter will be set to the filter named\n"
+	      "by the\n 'view_home' variable.  The style can be set by listing the\n"
+              "name style after the -s argument.\n"
 	      "\n"
-	      "In the second usage a filter expression\n"
-	      "and be specified directly\n"
-	      "after -d.  Owl will build an internal filter based on this\n"
-	      "filter and change the current view to use it.\n\n"
-	      "If --home is specified, switches to the view specified by\n"
-	      "the 'view_home' variable.\n\n"
+	      "The other usages listed above are abbreivated forms that simply set\n"
+	      "the filter of the current view. The -d option allows you to write a\n"
+              "filter expression that will be dynamically created by owl and then\n"
+              "applied as the view's filter\n"
 	      "SEE ALSO: filter, viewclass, viewuser\n"),
 
@@ -558,4 +562,5 @@
 	      "show terminal\n"
 	      "show version\n"
+	      "show view [<view>]\n"
 	      "show status\n",
 
@@ -1651,16 +1656,26 @@
 
 char *owl_command_view(int argc, char **argv, char *buff) {
-  if (argc<2) {
-    owl_function_makemsg("Wrong number of arguments to view command");
-    return NULL;
-  }
-
+
+  /* Backwards compatability has made this kind of complicated:
+   * view [<viewname>] [-f <filter> | -d <expression> | --home ] [-s <style>]
+   * view <filter>
+   * view -d <expression>
+   * view --home
+   */
+
+  /* First take the 'view --home' case */
   if (argc == 2 && !strcmp(argv[1], "--home")) {
     owl_function_change_view(owl_global_get_view_home(&g));
-    return NULL;
-  }
-
-  /* is it a dynamic filter? */
-  if (!strcmp(argv[1], "-d")) {
+    return(NULL);
+  }
+
+  /* Now look for 'view <filter>' */
+  if (argc==2) {
+    owl_function_change_view(argv[1]);
+    return(NULL);
+  }
+
+  /* Now get 'view -d <expression>' */
+  if (argc==3 && !strcmp(argv[1], "-d")) {
     char **myargv;
     int i;
@@ -1678,11 +1693,47 @@
   }
 
-  /* otherwise it's a normal view command */
-  if (argc>2) {
-    owl_function_makemsg("Wrong number of arguments to view command");
-    return NULL;
-  }
-  owl_function_change_view(argv[1]);
-  return NULL;
+  /* Finally handle the general case */
+  if (argc<3) {
+    owl_function_makemsg("Too few arguments to the view command.");
+    return(NULL);
+  }
+  argc--;
+  argv++;
+  if (strcmp(argv[0], "-f") && strcmp(argv[0], "-d") && strcmp(argv[0], "--home") && strcmp(argv[0], "-s")) {
+    if (strcmp(argv[0], "main")) {
+      owl_function_makemsg("No view named '%s'", argv[0]);
+      return(NULL);
+    }
+    argc--;
+    argv++;
+  }
+  while (argc) {
+    if (!strcmp(argv[0], "-f")) {
+      if (argc<2) {
+	owl_function_makemsg("Too few argments to the view command");
+	return(NULL);
+      }
+      owl_function_change_view(argv[1]);
+      argc-=2;
+      argv+=2;
+    } else if (!strcmp(argv[0], "--home")) {
+      owl_function_change_view(owl_global_get_view_home(&g));
+      argc--;
+      argv++;
+    } else if (!strcmp(argv[0], "-s")) {
+      if (argc<2) {
+	owl_function_makemsg("Too few argments to the view command");
+	return(NULL);
+      }
+      owl_function_change_style(owl_global_get_current_view(&g), argv[1]);
+      argc-=2;
+      argv+=2;
+    } else {
+      owl_function_makemsg("Too few argments to the view command");
+      return(NULL);
+    }
+    
+  }
+  return(NULL);
 }
 
@@ -1722,4 +1773,10 @@
       owl_function_show_keymap(argv[2]);
     }
+  } else if (!strcmp(argv[1], "view")) {
+    if (argc==3) {
+      owl_function_show_view(argv[2]);
+    } else {
+      owl_function_show_view(NULL);
+    }
   } else if (!strcmp(argv[1], "colors")) {
     owl_function_show_colors();
Index: functions.c
===================================================================
--- functions.c	(revision 93817821ac2aa28dfa72e12d58d96069fd6e4ea1)
+++ functions.c	(revision ef56a6724cbce9cfe55d35d4b300df48c8c464c6)
@@ -59,4 +59,24 @@
   owl_fmtext_free(&fm);
 }
+
+
+void owl_function_show_view(char *viewname)
+{
+  owl_view *v;
+  owl_fmtext fm;
+
+  /* we only have the one view right now */
+  v=owl_global_get_current_view(&g);
+  if (viewname && strcmp(viewname, owl_view_get_name(v))) {
+    owl_function_makemsg("No view named '%s'", viewname);
+    return;
+  }
+
+  owl_fmtext_init_null(&fm);
+  owl_view_to_fmtext(v, &fm);
+  owl_function_popless_fmtext(&fm);
+  owl_fmtext_free(&fm);
+}
+
 
 char *owl_function_cmd_describe(void *name)
@@ -3019,14 +3039,30 @@
 }
 
+
+void owl_function_change_style(owl_view *v, char *stylename)
+{
+  owl_view_set_style(v, owl_global_get_style_by_name(&g, stylename));
+  owl_messagelist_invalidate_formats(owl_global_get_msglist(&g));
+  owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);
+  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
+  
+}
+
 void owl_function_toggleoneline()
 {
-  char *style;
-
-  style=owl_global_get_style(&g);
-
-  if (strcmp(style, "oneline")) {
-    owl_global_set_style(&g, "oneline");
+  owl_view *v;
+  owl_style *s;
+
+  v=owl_global_get_current_view(&g);
+  s=owl_view_get_style(v);
+
+  if (!owl_style_matches_name(s, "oneline")) {
+    owl_function_change_style(v, "oneline");
   } else {
-    owl_global_set_style(&g, owl_global_get_default_style(&g));
-  }
-}
+    owl_function_change_style(v, owl_global_get_default_style(&g));
+  }
+
+  owl_messagelist_invalidate_formats(owl_global_get_msglist(&g));
+  owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);
+  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
+}
Index: global.c
===================================================================
--- global.c	(revision bd3f2322e69e72e9760505782651c29325f28b4b)
+++ global.c	(revision ef56a6724cbce9cfe55d35d4b300df48c8c464c6)
@@ -748,8 +748,4 @@
 }
 
-owl_style *owl_global_get_current_style(owl_global *g) {
-  return(owl_global_get_style_by_name(g, owl_global_get_style(g)));
-}
-
 void owl_global_add_style(owl_global *g, owl_style *s) {
   owl_list_append_element(&(g->stylelist), s);
Index: message.c
===================================================================
--- message.c	(revision be0a79f9aaeb37a5353c2e701b12ecb9eccc7366)
+++ message.c	(revision ef56a6724cbce9cfe55d35d4b300df48c8c464c6)
@@ -114,9 +114,13 @@
 {
   owl_style *s;
+  owl_view *v;
 
   if (m->invalid_format) {
+    /* for now we assume there's jsut the one view and use that style */
+    v=owl_global_get_current_view(&g);
+    s=owl_view_get_style(v);
+
     owl_fmtext_free(&(m->fmtext));
     owl_fmtext_init_null(&(m->fmtext));
-    s=owl_global_get_current_style(&g);
     owl_style_get_formattext(s, &(m->fmtext), m);
     m->invalid_format=0;
Index: owl.c
===================================================================
--- owl.c	(revision 3723f312b0fc28e1c5bf84b0a56207a1737796db)
+++ owl.c	(revision ef56a6724cbce9cfe55d35d4b300df48c8c464c6)
@@ -271,9 +271,9 @@
    *  formatting function */
   if (owl_global_is_config_format(&g)) {
-    owl_global_set_style(&g, "perl");
+    owl_view_set_style(owl_global_get_current_view(&g), owl_global_get_style_by_name(&g, "perl"));
   } else if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES)) {
-    owl_global_set_style(&g, "default");
+    owl_view_set_style(owl_global_get_current_view(&g), owl_global_get_style_by_name(&g, "default"));
   } else {
-    owl_global_set_style(&g, "basic");
+    owl_view_set_style(owl_global_get_current_view(&g), owl_global_get_style_by_name(&g, "basic"));
   }
 
Index: style.c
===================================================================
--- style.c	(revision 5639bf26c7fb78670232420c08a2665fa4e4547a)
+++ style.c	(revision ef56a6724cbce9cfe55d35d4b300df48c8c464c6)
@@ -23,4 +23,9 @@
   if (!strcmp(s->name, name)) return(1);
   return(0);
+}
+
+char *owl_style_get_name(owl_style *s)
+{
+  return(s->name);
 }
 
@@ -50,9 +55,4 @@
 }
 
-char *owl_style_get_name(owl_style *s)
-{
-  return(s->name);
-}
-
 void owl_style_free(owl_style *s)
 {
Index: variable.c
===================================================================
--- variable.c	(revision 73624b445ce7ec3252a00b29ef2396a3c97e3700)
+++ variable.c	(revision ef56a6724cbce9cfe55d35d4b300df48c8c464c6)
@@ -201,10 +201,4 @@
   OWLVAR_STRING_FULL( "tty" /* %OwlVarStub */, "", "tty name for zephyr location", "",
 		      NULL, owl_variable_tty_set, NULL),
-
-  OWLVAR_STRING_FULL( "style" /* %OwlVarStub */, "default", "name of the current formatting style",
-		      "This sets the current message formatting style. Possbile\n"
-		      "values include 'default' 'basic' 'oneline' and if\n"
-		      "available, 'perl'\n",
-		      NULL, owl_variable_style_set, NULL),
 
   OWLVAR_STRING( "default_style" /* %OwlVarStub */, "default",
Index: view.c
===================================================================
--- view.c	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
+++ view.c	(revision ef56a6724cbce9cfe55d35d4b300df48c8c464c6)
@@ -13,4 +13,8 @@
 }
 
+char *owl_view_get_name(owl_view *v)
+{
+  return(v->name);
+}
 
 /* if the message matches the filter then add to view */
@@ -58,4 +62,9 @@
 {
   v->style=s;
+}
+
+owl_style *owl_view_get_style(owl_view *v)
+{
+  return(v->style);
 }
 
@@ -113,4 +122,20 @@
 }
 
+/* fmtext should already be initialized */
+void owl_view_to_fmtext(owl_view *v, owl_fmtext *fm)
+{
+  owl_fmtext_append_normal(fm, "Name: ");
+  owl_fmtext_append_normal(fm, v->name);
+  owl_fmtext_append_normal(fm, "\n");
+
+  owl_fmtext_append_normal(fm, "Filter: ");
+  owl_fmtext_append_normal(fm, owl_filter_get_name(v->filter));
+  owl_fmtext_append_normal(fm, "\n");
+
+  owl_fmtext_append_normal(fm, "Style: ");
+  owl_fmtext_append_normal(fm, owl_style_get_name(v->style));
+  owl_fmtext_append_normal(fm, "\n");
+}
+
 char *owl_view_get_filtname(owl_view *v)
 {
